fixed sending follow up move/size messages from gtk

git-svn-id: trunk@4419 -
This commit is contained in:
mattias 2003-07-25 08:00:36 +00:00
parent 91d44097f1
commit 13e7a02878
2 changed files with 31 additions and 18 deletions

View File

@ -91,7 +91,7 @@ var
NewBottom: Integer;
begin
{$IFDEF CHECK_POSITION}
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
with Control do
writeln('[TWinControl.AlignControls.DoPosition] A Control=',Name,':',ClassName,' ',Left,',',Top,',',Width,',',Height,' recalculate the anchors=',(Control.Anchors <> AnchorAlign[AAlign]),' Align=',AlignNames[AAlign]);
{$ENDIF}
@ -141,7 +141,7 @@ var
{$IFDEF CHECK_POSITION}
//if csDesigning in ComponentState then
//if AnsiCompareText(Self.ClassName,'TSynBaseCompletionForm')=0 then
if AnsiCompareText(Self.ClassName,'TSynBaseCompletionForm')=0 then
writeln('[TWinControl.AlignControls.DoPosition] Before Anchoring ',
' ',Name,':',ClassName,
' CurBaseBounds=',CurBaseBounds.Left,',',CurBaseBounds.Top,',',CurBaseBounds.Right-CurBaseBounds.Left,',',CurBaseBounds.Bottom-CurBaseBounds.Top,
@ -216,7 +216,7 @@ var
end;
{$IFDEF CHECK_POSITION}
//if csDesigning in ComponentState then
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
with Control do
writeln('[TWinControl.AlignControls.DoPosition] After Anchoring',
' ',Name,':',ClassName,
@ -274,7 +274,7 @@ var
NewHeight:=Max(0,NewBottom-NewTop);
{$IFDEF CHECK_POSITION}
//if csDesigning in Control.ComponentState then
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
with Control do
writeln('[TWinControl.AlignControls.DoPosition] After Aligning',
' ',Name,':',ClassName,
@ -291,8 +291,8 @@ var
if (Control.Left <> NewLeft) or (Control.Top <> NewTop)
or (Control.Width <> NewWidth) or (Control.Height <> NewHeight) then begin
{$IFDEF CHECK_POSITION}
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
//if csDesigning in Control.ComponentState then
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
with Control do
writeln('[TWinControl.AlignControls.DoPosition] NEW BOUNDS Control=',Name,':',ClassName,' NewBounds=',NewLeft,',',NewTop,',',NewWidth,',',NewHeight,' Align=',AlignNames[AAlign]);
{$ENDIF}
@ -310,7 +310,7 @@ var
end;
{$IFDEF CHECK_POSITION}
//if csDesigning in Control.ComponentState then
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
with Control do
writeln('[TWinControl.AlignControls.DoPosition] AFTER SETBOUND Control=',Name,':',ClassName,' Bounds=',Left,',',Top,',',Width,',',Height);
{$ENDIF}
@ -339,7 +339,7 @@ var
end;
{$IFDEF CHECK_POSITION}
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
with Control do
writeln('[TWinControl.AlignControls.DoPosition] END Control=',
Name,':',ClassName,
@ -896,6 +896,7 @@ begin
Width:= FWidth;
Height:= FHeight;
{$IFDEF CHECK_POSITION}
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
writeln(' [TControl.SendMoveSizeMessages] ',Name,':',ClassName,' SizeMsg Width=',Width,' Height=',Height);
{$ENDIF}
end;
@ -909,6 +910,7 @@ begin
XPos:= FLeft;
YPos:= FTop;
{$IFDEF CHECK_POSITION}
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
writeln(' [TControl.SendMoveSizeMessages] ',Name,':',ClassName,' MoveMsg XPos=',XPos,' YPos=',YPos);
{$ENDIF}
end;
@ -2774,7 +2776,7 @@ var
begin
{$IFDEF CHECK_POSITION}
//if csDesigning in ComponentState then
//if AnsiCompareText(ClassName,'TScrollBar')=0 then
if AnsiCompareText(ClassName,'TScrollBar')=0 then
writeln('[TWinControl.SetBounds] START ',Name,':',ClassName,
' Old=',Left,',',Top,',',Width,',',Height,
' -> New=',ALeft,',',ATop,',',AWidth,',',AHeight,
@ -2793,7 +2795,7 @@ begin
try
{$IFDEF CHECK_POSITION}
//if csDesigning in ComponentState then
//if AnsiCompareText(ClassName,'TScrollBar')=0 then
if AnsiCompareText(ClassName,'TScrollBar')=0 then
writeln('[TWinControl.SetBounds] Set LCL Bounds ',Name,':',ClassName,
' OldBounds=',Left,',',Top,',',Left+Width,',',Top+Height,
' -> New=',ALeft,',',ATop,',',ALeft+AWidth,',',ATop+AHeight);
@ -2881,7 +2883,8 @@ begin
begin
// the new bounds were not yet sent to the InterfaceObject -> send them
{$IFDEF CHECK_POSITION}
if csDesigning in ComponentState then
//if csDesigning in ComponentState then
if AnsiCompareText(ClassName,'TScrollBar')=0 then
writeln('[TWinControl.RealizeBounds] A ',Name,':',ClassName,
' OldRelBounds=',FBoundsRealized.Left,',',FBoundsRealized.Top,',',FBoundsRealized.Right,',',FBoundsRealized.Bottom,
' -> NewBounds=',NewBounds.Left,',',NewBounds.Top,',',NewBounds.Right,',',NewBounds.Bottom);
@ -2922,6 +2925,7 @@ begin
if Parent <> nil then Parent.ShowControl(Self);
end;
{ $UNDEF CHECK_POSITION}
{$IFDEF ASSERT_IS_ON}
{$UNDEF ASSERT_IS_ON}
@ -2930,6 +2934,9 @@ end;
{ =============================================================================
$Log$
Revision 1.155 2003/07/25 08:00:36 mattias
fixed sending follow up move/size messages from gtk
Revision 1.154 2003/07/24 06:54:32 mattias
fixed anti circle mechnism for aligned controls

View File

@ -637,6 +637,7 @@ procedure TgtkObject.SendCachedLCLMessages;
RaiseWidgetWithoutControl;
end;
{$IFDEF VerboseSizeMsg}
if AnsiCompareText(LCLControl.ClassName,'TScrollBar')=0 then
writeln('SendCachedLCLMessages ',LCLControl.Name,':',LCLControl.ClassName,
' ',LCLControl.Left,',',LCLControl.Top,',',LCLControl.Width,',',LCLControl.Height);
{$ENDIF}
@ -749,8 +750,7 @@ procedure TGtkObject.SendCachedGtkMessages;
GtkHeight:=MainWidget^.Allocation.Height;
if GtkHeight<0 then GtkHeight:=0;
IsTopLevelWidget:=(LCLControl is TCustomForm)
and (LCLControl.Parent=nil);
IsTopLevelWidget:=(LCLControl is TCustomForm) and (LCLControl.Parent=nil);
if IsTopLevelWidget then begin
if not GTK_WIDGET_VISIBLE(MainWidget) then begin
// size/move messages of invisible windows are not reliable
@ -795,7 +795,8 @@ procedure TGtkObject.SendCachedGtkMessages;
finally
Dispose(PosMsg.WindowPos);
end;
if not MessageDelivered then exit;
if (not MessageDelivered) then exit;
if FWidgetsWithResizeRequest.Contains(MainWidget) then exit;
UpdateLCLRect;
end;
@ -814,6 +815,7 @@ procedure TGtkObject.SendCachedGtkMessages;
end;
MessageDelivered := (DeliverMessage(LCLControl, SizeMsg) = 0);
if not MessageDelivered then exit;
if FWidgetsWithResizeRequest.Contains(MainWidget) then exit;
UpdateLCLRect;
end;
@ -966,6 +968,7 @@ begin
end else begin
NewWidth:=Requisition.width;
end;
//writeln('TgtkObject.RealizeWidgetSize A ',Newwidth,',',Newheight);
end;
gtk_widget_set_usize(Widget, NewWidth, NewHeight);
@ -3287,16 +3290,14 @@ begin
if TWinControl(Sender).HandleAllocated then begin
Widget := pgtkWidget(TWinControl(Sender).Handle);
SetResizeRequest(Widget);
{$IFDEF VerboseClientRectBugFix}
if (Sender is TCustomForm) then
writeln(' FFF ResizeChild ',Sender.ClassName,' ',Left,',',Top);
{$ENDIF}
//if (Sender is TCustomForm) then
//if AnsiCompareText(Sender.ClassName,'TScrollBar')=0 then
// writeln(' FFF ResizeChild ',Sender.ClassName,' ',Left,',',Top,',',Width,',',Height);
end;
end;
//writeln('[TgtkObject.ResizeChild] END ',Sender.Classname,' Left=',Left,' Top=',Top,' Width=',Width,' Height=',Height);
end;
{------------------------------------------------------------------------------
Method: TGtkObject.AddChild
Params: parent -
@ -5796,6 +5797,8 @@ begin
SetWindowSizeAndPosition(PgtkWindow(SenderWidget),TWinControl(Sender));
end else if (LCLControl.Parent<>nil) then begin
// resize widget
//if AnsiCompareText(Sender.ClassName,'TScrollBar')=0 then
// writeln('TgtkObject.ShowHide Size ',LCLControl.Left,',',LCLControl.Top,',',LCLControl.Width,',',LCLControl.Height);
RealizeWidgetSize(SenderWidget,LCLControl.Width,LCLControl.Height);
// move widget on the fixed widget of parent control
ParentWidget:=pgtkWidget(LCLControl.Parent.Handle);
@ -7946,6 +7949,9 @@ end;
{ =============================================================================
$Log$
Revision 1.395 2003/07/25 08:00:36 mattias
fixed sending follow up move/size messages from gtk
Revision 1.394 2003/07/23 10:23:56 mattias
started README about remote debugging