gtk2: gtk2 doesnot support position setting before window become visible (default position) under windows

git-svn-id: trunk@12208 -
This commit is contained in:
paul 2007-09-28 06:20:55 +00:00
parent b864b14f3d
commit 24cb502ff6

View File

@ -923,10 +923,10 @@ procedure TGtkWidgetSet.SendCachedLCLMessages;
else begin else begin
// resize form // resize form
{$IFDEF VerboseFormPositioning} {$IFDEF VerboseFormPositioning}
DebugLn('VFP SendCachedLCLMessages1 ',GetControlWindow(Widget)<>nil); DebugLn('VFP SendCachedLCLMessages1 ', dbgs(GetControlWindow(Widget)<>nil));
if (LCLControl is TCustomForm) then if (LCLControl is TCustomForm) then
DebugLn('VFP SendCachedLCLMessages2 ',LCLControl.ClassName,' ', DebugLn('VFP SendCachedLCLMessages2 ',LCLControl.ClassName,' ',
LCLControl.Left,',',LCLControl.Top,',',LCLControl.Width,',',LCLControl.Height); dbgs(LCLControl.Left),',',dbgs(LCLControl.Top),',',dbgs(LCLControl.Width),',',dbgs(LCLControl.Height));
{$ENDIF} {$ENDIF}
SetWindowSizeAndPosition(PgtkWindow(Widget),TWinControl(LCLControl)); SetWindowSizeAndPosition(PgtkWindow(Widget),TWinControl(LCLControl));
end; end;
@ -5304,28 +5304,38 @@ begin
end; end;
// before making the widget visible, set the position and size // before making the widget visible, set the position and size
if FWidgetsWithResizeRequest.Contains(SenderWidget) then begin // this is not possible for windows - for windows position will be setted
if (ACustomForm<>nil) and (ACustomForm.Parent=nil) then begin // after widget become visible
if FWidgetsWithResizeRequest.Contains(SenderWidget) then
begin
if (ACustomForm<>nil) and (ACustomForm.Parent=nil) then
begin
// top level control (a form without parent) // top level control (a form without parent)
{$IFDEF VerboseFormPositioning} {$IFDEF VerboseFormPositioning}
DebugLn('VFP [TGtkWidgetSet.ShowHide] A set bounds ', DebugLn('VFP [TGtkWidgetSet.ShowHide] A set bounds ',
LCLControl.Name,':',LCLControl.ClassName, LCLControl.Name,':',LCLControl.ClassName,
' Window=',GetControlWindow(SenderWidget)<>nil, ' Window=',dbgs(GetControlWindow(SenderWidget)<>nil),
' ',LCLControl.Left,',',LCLControl.Top, ' ',dbgs(LCLControl.Left),',',dbgs(LCLControl.Top),
',',LCLControl.Width,',',LCLControl.Height); ',',dbgs(LCLControl.Width),',',dbgs(LCLControl.Height));
{$ENDIF} {$ENDIF}
SetWindowSizeAndPosition(PgtkWindow(SenderWidget),LCLControl); SetWindowSizeAndPosition(PgtkWindow(SenderWidget),LCLControl);
end else if (LCLControl.Parent<>nil) then begin end
else
if (LCLControl.Parent<>nil) then
begin
// resize widget // resize widget
{$IFDEF VerboseSizeMsg} {$IFDEF VerboseSizeMsg}
DebugLn(['TGtkWidgetSet.ShowHide ',DbgSName(LCLControl)]); DebugLn(['TGtkWidgetSet.ShowHide ',DbgSName(LCLControl)]);
{$ENDIF} {$ENDIF}
SetWidgetSizeAndPosition(LCLControl); SetWidgetSizeAndPosition(LCLControl);
end; end;
{$ifndef windows}
UnsetResizeRequest(SenderWidget); UnsetResizeRequest(SenderWidget);
{$endif}
end; end;
if (ACustomForm<>nil) and (ACustomForm.Parent=nil) then begin if (ACustomForm<>nil) and (ACustomForm.Parent=nil) then
begin
If (ACustomForm.BorderStyle <> bsSizeable) or If (ACustomForm.BorderStyle <> bsSizeable) or
((ACustomForm.FormStyle in fsAllStayOnTop) ((ACustomForm.FormStyle in fsAllStayOnTop)
and (not (csDesigning in ACustomForm.ComponentState))) and (not (csDesigning in ACustomForm.ComponentState)))