LCL-CustomDrawn: Fixes the issue with alAlign and starts improving TPageControl. TCDPageControl already works almost 100% ok.

git-svn-id: trunk@38371 -
This commit is contained in:
sekelsenmat 2012-08-25 11:27:55 +00:00
parent f9f3d34cb8
commit d80920b427
4 changed files with 15 additions and 1 deletions

View File

@ -2461,7 +2461,11 @@ begin
end
else
begin
ARect := TCDWinControl(lObject).WinControl.BoundsRect;
// If we return WinControl.BoundsRect then the controls get a x2 factor
// when Align=alClient, strange. Region.GetBoundingRect() works fine.
// ARect := TCDWinControl(lObject).WinControl.BoundsRect; <<-- don't do this
ARect := TCDWinControl(lObject).Region.GetBoundingRect();
end;
{$ifdef VerboseCDWinAPI}
DebugLn(Format(':<[WinAPI GetClientBounds] ARect.Left=%d ARect.Top=%d'

View File

@ -536,6 +536,8 @@ begin
end
else
Result:=False;
//WriteLn(Format('[TCDWidgetSet.BackendGetClientBounds handle=%d x=%d y=%d w=%d h=%d',
// [Handle, ARect.Left, ARect.Top, ARect.Right-ARect.Left, ARect.Bottom-ARect.Top]));
end;
(*function TCocoaWidgetSet.GetClientRect(handle : HWND; var ARect : TRect) : Boolean;

View File

@ -76,6 +76,8 @@ type
//class procedure AddControl(const AControl: TControl); override;
class function GetText(const AWinControl: TWinControl; var AText: String): Boolean; override;
class procedure SetBounds(const AWinControl: TWinControl; const ALeft, ATop, AWidth, AHeight: Integer); override;
class procedure SetBorderStyle(const AWinControl: TWinControl; const ABorderStyle: TBorderStyle); override;
class procedure SetChildZPosition(const AWinControl, AChild: TWinControl;
@ -301,6 +303,8 @@ end;
class procedure TCDWSWinControl.SetBounds(const AWinControl: TWinControl;
const ALeft, ATop, AWidth, AHeight: Integer);
begin
//WriteLn(Format('[TCDWSWinControl.SetBounds Control=%s:%s x=%d y=%d w=%d h=%d',
// [AWinControl.Name, AWinControl.ClassName, ALeft, ATop, AWidth, AHeight]));
Invalidate(AWinControl);
end;

View File

@ -160,6 +160,8 @@ begin
Result:=AWinControl.Handle<>0;
if not Result then Exit;
ARect:= TCocoaWindow(AWinControl.Handle).CocoaForm.lclClientFrame;
//WriteLn(Format('[TCDWSCustomForm.GetClientBounds x=%d y=%d w=%d h=%d',
// [ARect.Left, ARect.Top, ARect.Right-ARect.Left, ARect.Bottom-ARect.Top]));
end;
class function TCDWSCustomForm.GetClientRect(const AWinControl: TWinControl; var ARect: TRect): Boolean;
@ -172,5 +174,7 @@ begin
x:=0;y:=0;
TCocoaWindow(AWinControl.Handle).CocoaForm.lclLocalToScreen(x,y);
MoveRect(ARect, x,y);
//WriteLn(Format('[TCDWSCustomForm.GetClientRect x=%d y=%d w=%d h=%d',
// [ARect.Left, ARect.Top, ARect.Right-ARect.Left, ARect.Bottom-ARect.Top]));
end;