carbon: workaround for #12490. needs further investigation

git-svn-id: trunk@20763 -
This commit is contained in:
dmitry 2009-06-29 12:42:31 +00:00
parent df02752fd5
commit 1afac02c06
3 changed files with 14 additions and 1 deletions

View File

@ -173,6 +173,8 @@ type
procedure DestroyWidget; override;
public
function GetPreferredSize: TPoint; override;
procedure AddToWidget(AParent: TCarbonWidget); override;
function GetMousePos: TPoint; override;
function GetTopParentWindow: WindowRef; override;

View File

@ -1070,6 +1070,7 @@ function TCarbonControl.GetPreferredSize: TPoint;
var
R: MacOSAll.Rect;
S: SmallInt;
b: HIRect;
begin
Result.X := 0;
Result.Y := 0;
@ -1078,7 +1079,7 @@ begin
if OSError(GetBestControlRect(ControlRef(Widget), R, S), Self,
'GetPreferredSize', 'GetBestControlRect') then Exit;
Result.X := R.right - R.left;
Result.Y := R.bottom - R.top;
end;

View File

@ -1242,6 +1242,16 @@ begin
//Widget := nil;
end;
function TCarbonWindow.GetPreferredSize: TPoint;
const
MinWinSize = 20;
begin
//todo: find a proper way to determine prefered window size
// by default Carbon returns a height too large
Result.x:=MinWinSize;
Result.y:=MinWinSize;
end;
{------------------------------------------------------------------------------
Method: TCarbonWindow.AddToWidget
Params: AParent - Parent widget