mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 16:19:28 +02:00
fixed sending follow up move/size messages from gtk
git-svn-id: trunk@4419 -
This commit is contained in:
parent
91d44097f1
commit
13e7a02878
@ -91,7 +91,7 @@ var
|
|||||||
NewBottom: Integer;
|
NewBottom: Integer;
|
||||||
begin
|
begin
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
||||||
with Control do
|
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]);
|
writeln('[TWinControl.AlignControls.DoPosition] A Control=',Name,':',ClassName,' ',Left,',',Top,',',Width,',',Height,' recalculate the anchors=',(Control.Anchors <> AnchorAlign[AAlign]),' Align=',AlignNames[AAlign]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -141,7 +141,7 @@ var
|
|||||||
|
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
//if csDesigning in ComponentState then
|
//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 ',
|
writeln('[TWinControl.AlignControls.DoPosition] Before Anchoring ',
|
||||||
' ',Name,':',ClassName,
|
' ',Name,':',ClassName,
|
||||||
' CurBaseBounds=',CurBaseBounds.Left,',',CurBaseBounds.Top,',',CurBaseBounds.Right-CurBaseBounds.Left,',',CurBaseBounds.Bottom-CurBaseBounds.Top,
|
' CurBaseBounds=',CurBaseBounds.Left,',',CurBaseBounds.Top,',',CurBaseBounds.Right-CurBaseBounds.Left,',',CurBaseBounds.Bottom-CurBaseBounds.Top,
|
||||||
@ -216,7 +216,7 @@ var
|
|||||||
end;
|
end;
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
//if csDesigning in ComponentState then
|
//if csDesigning in ComponentState then
|
||||||
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
||||||
with Control do
|
with Control do
|
||||||
writeln('[TWinControl.AlignControls.DoPosition] After Anchoring',
|
writeln('[TWinControl.AlignControls.DoPosition] After Anchoring',
|
||||||
' ',Name,':',ClassName,
|
' ',Name,':',ClassName,
|
||||||
@ -274,7 +274,7 @@ var
|
|||||||
NewHeight:=Max(0,NewBottom-NewTop);
|
NewHeight:=Max(0,NewBottom-NewTop);
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
//if csDesigning in Control.ComponentState then
|
//if csDesigning in Control.ComponentState then
|
||||||
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
||||||
with Control do
|
with Control do
|
||||||
writeln('[TWinControl.AlignControls.DoPosition] After Aligning',
|
writeln('[TWinControl.AlignControls.DoPosition] After Aligning',
|
||||||
' ',Name,':',ClassName,
|
' ',Name,':',ClassName,
|
||||||
@ -291,8 +291,8 @@ var
|
|||||||
if (Control.Left <> NewLeft) or (Control.Top <> NewTop)
|
if (Control.Left <> NewLeft) or (Control.Top <> NewTop)
|
||||||
or (Control.Width <> NewWidth) or (Control.Height <> NewHeight) then begin
|
or (Control.Width <> NewWidth) or (Control.Height <> NewHeight) then begin
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
|
||||||
//if csDesigning in Control.ComponentState then
|
//if csDesigning in Control.ComponentState then
|
||||||
|
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
||||||
with Control do
|
with Control do
|
||||||
writeln('[TWinControl.AlignControls.DoPosition] NEW BOUNDS Control=',Name,':',ClassName,' NewBounds=',NewLeft,',',NewTop,',',NewWidth,',',NewHeight,' Align=',AlignNames[AAlign]);
|
writeln('[TWinControl.AlignControls.DoPosition] NEW BOUNDS Control=',Name,':',ClassName,' NewBounds=',NewLeft,',',NewTop,',',NewWidth,',',NewHeight,' Align=',AlignNames[AAlign]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -310,7 +310,7 @@ var
|
|||||||
end;
|
end;
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
//if csDesigning in Control.ComponentState then
|
//if csDesigning in Control.ComponentState then
|
||||||
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
||||||
with Control do
|
with Control do
|
||||||
writeln('[TWinControl.AlignControls.DoPosition] AFTER SETBOUND Control=',Name,':',ClassName,' Bounds=',Left,',',Top,',',Width,',',Height);
|
writeln('[TWinControl.AlignControls.DoPosition] AFTER SETBOUND Control=',Name,':',ClassName,' Bounds=',Left,',',Top,',',Width,',',Height);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -339,7 +339,7 @@ var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
//if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
||||||
with Control do
|
with Control do
|
||||||
writeln('[TWinControl.AlignControls.DoPosition] END Control=',
|
writeln('[TWinControl.AlignControls.DoPosition] END Control=',
|
||||||
Name,':',ClassName,
|
Name,':',ClassName,
|
||||||
@ -896,6 +896,7 @@ begin
|
|||||||
Width:= FWidth;
|
Width:= FWidth;
|
||||||
Height:= FHeight;
|
Height:= FHeight;
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
|
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
||||||
writeln(' [TControl.SendMoveSizeMessages] ',Name,':',ClassName,' SizeMsg Width=',Width,' Height=',Height);
|
writeln(' [TControl.SendMoveSizeMessages] ',Name,':',ClassName,' SizeMsg Width=',Width,' Height=',Height);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
@ -909,6 +910,7 @@ begin
|
|||||||
XPos:= FLeft;
|
XPos:= FLeft;
|
||||||
YPos:= FTop;
|
YPos:= FTop;
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
|
if AnsiCompareText(ClassName,'TSynBaseCompletionForm')=0 then
|
||||||
writeln(' [TControl.SendMoveSizeMessages] ',Name,':',ClassName,' MoveMsg XPos=',XPos,' YPos=',YPos);
|
writeln(' [TControl.SendMoveSizeMessages] ',Name,':',ClassName,' MoveMsg XPos=',XPos,' YPos=',YPos);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
@ -2774,7 +2776,7 @@ var
|
|||||||
begin
|
begin
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
//if csDesigning in ComponentState then
|
//if csDesigning in ComponentState then
|
||||||
//if AnsiCompareText(ClassName,'TScrollBar')=0 then
|
if AnsiCompareText(ClassName,'TScrollBar')=0 then
|
||||||
writeln('[TWinControl.SetBounds] START ',Name,':',ClassName,
|
writeln('[TWinControl.SetBounds] START ',Name,':',ClassName,
|
||||||
' Old=',Left,',',Top,',',Width,',',Height,
|
' Old=',Left,',',Top,',',Width,',',Height,
|
||||||
' -> New=',ALeft,',',ATop,',',AWidth,',',AHeight,
|
' -> New=',ALeft,',',ATop,',',AWidth,',',AHeight,
|
||||||
@ -2793,7 +2795,7 @@ begin
|
|||||||
try
|
try
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
//if csDesigning in ComponentState then
|
//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,
|
writeln('[TWinControl.SetBounds] Set LCL Bounds ',Name,':',ClassName,
|
||||||
' OldBounds=',Left,',',Top,',',Left+Width,',',Top+Height,
|
' OldBounds=',Left,',',Top,',',Left+Width,',',Top+Height,
|
||||||
' -> New=',ALeft,',',ATop,',',ALeft+AWidth,',',ATop+AHeight);
|
' -> New=',ALeft,',',ATop,',',ALeft+AWidth,',',ATop+AHeight);
|
||||||
@ -2881,7 +2883,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
// the new bounds were not yet sent to the InterfaceObject -> send them
|
// the new bounds were not yet sent to the InterfaceObject -> send them
|
||||||
{$IFDEF CHECK_POSITION}
|
{$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,
|
writeln('[TWinControl.RealizeBounds] A ',Name,':',ClassName,
|
||||||
' OldRelBounds=',FBoundsRealized.Left,',',FBoundsRealized.Top,',',FBoundsRealized.Right,',',FBoundsRealized.Bottom,
|
' OldRelBounds=',FBoundsRealized.Left,',',FBoundsRealized.Top,',',FBoundsRealized.Right,',',FBoundsRealized.Bottom,
|
||||||
' -> NewBounds=',NewBounds.Left,',',NewBounds.Top,',',NewBounds.Right,',',NewBounds.Bottom);
|
' -> NewBounds=',NewBounds.Left,',',NewBounds.Top,',',NewBounds.Right,',',NewBounds.Bottom);
|
||||||
@ -2922,6 +2925,7 @@ begin
|
|||||||
if Parent <> nil then Parent.ShowControl(Self);
|
if Parent <> nil then Parent.ShowControl(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ $UNDEF CHECK_POSITION}
|
||||||
|
|
||||||
{$IFDEF ASSERT_IS_ON}
|
{$IFDEF ASSERT_IS_ON}
|
||||||
{$UNDEF ASSERT_IS_ON}
|
{$UNDEF ASSERT_IS_ON}
|
||||||
@ -2930,6 +2934,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 1.154 2003/07/24 06:54:32 mattias
|
||||||
fixed anti circle mechnism for aligned controls
|
fixed anti circle mechnism for aligned controls
|
||||||
|
|
||||||
|
@ -637,6 +637,7 @@ procedure TgtkObject.SendCachedLCLMessages;
|
|||||||
RaiseWidgetWithoutControl;
|
RaiseWidgetWithoutControl;
|
||||||
end;
|
end;
|
||||||
{$IFDEF VerboseSizeMsg}
|
{$IFDEF VerboseSizeMsg}
|
||||||
|
if AnsiCompareText(LCLControl.ClassName,'TScrollBar')=0 then
|
||||||
writeln('SendCachedLCLMessages ',LCLControl.Name,':',LCLControl.ClassName,
|
writeln('SendCachedLCLMessages ',LCLControl.Name,':',LCLControl.ClassName,
|
||||||
' ',LCLControl.Left,',',LCLControl.Top,',',LCLControl.Width,',',LCLControl.Height);
|
' ',LCLControl.Left,',',LCLControl.Top,',',LCLControl.Width,',',LCLControl.Height);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -749,8 +750,7 @@ procedure TGtkObject.SendCachedGtkMessages;
|
|||||||
GtkHeight:=MainWidget^.Allocation.Height;
|
GtkHeight:=MainWidget^.Allocation.Height;
|
||||||
if GtkHeight<0 then GtkHeight:=0;
|
if GtkHeight<0 then GtkHeight:=0;
|
||||||
|
|
||||||
IsTopLevelWidget:=(LCLControl is TCustomForm)
|
IsTopLevelWidget:=(LCLControl is TCustomForm) and (LCLControl.Parent=nil);
|
||||||
and (LCLControl.Parent=nil);
|
|
||||||
if IsTopLevelWidget then begin
|
if IsTopLevelWidget then begin
|
||||||
if not GTK_WIDGET_VISIBLE(MainWidget) then begin
|
if not GTK_WIDGET_VISIBLE(MainWidget) then begin
|
||||||
// size/move messages of invisible windows are not reliable
|
// size/move messages of invisible windows are not reliable
|
||||||
@ -795,7 +795,8 @@ procedure TGtkObject.SendCachedGtkMessages;
|
|||||||
finally
|
finally
|
||||||
Dispose(PosMsg.WindowPos);
|
Dispose(PosMsg.WindowPos);
|
||||||
end;
|
end;
|
||||||
if not MessageDelivered then exit;
|
if (not MessageDelivered) then exit;
|
||||||
|
if FWidgetsWithResizeRequest.Contains(MainWidget) then exit;
|
||||||
UpdateLCLRect;
|
UpdateLCLRect;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -814,6 +815,7 @@ procedure TGtkObject.SendCachedGtkMessages;
|
|||||||
end;
|
end;
|
||||||
MessageDelivered := (DeliverMessage(LCLControl, SizeMsg) = 0);
|
MessageDelivered := (DeliverMessage(LCLControl, SizeMsg) = 0);
|
||||||
if not MessageDelivered then exit;
|
if not MessageDelivered then exit;
|
||||||
|
if FWidgetsWithResizeRequest.Contains(MainWidget) then exit;
|
||||||
UpdateLCLRect;
|
UpdateLCLRect;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -966,6 +968,7 @@ begin
|
|||||||
end else begin
|
end else begin
|
||||||
NewWidth:=Requisition.width;
|
NewWidth:=Requisition.width;
|
||||||
end;
|
end;
|
||||||
|
//writeln('TgtkObject.RealizeWidgetSize A ',Newwidth,',',Newheight);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
gtk_widget_set_usize(Widget, NewWidth, NewHeight);
|
gtk_widget_set_usize(Widget, NewWidth, NewHeight);
|
||||||
@ -3287,16 +3290,14 @@ begin
|
|||||||
if TWinControl(Sender).HandleAllocated then begin
|
if TWinControl(Sender).HandleAllocated then begin
|
||||||
Widget := pgtkWidget(TWinControl(Sender).Handle);
|
Widget := pgtkWidget(TWinControl(Sender).Handle);
|
||||||
SetResizeRequest(Widget);
|
SetResizeRequest(Widget);
|
||||||
{$IFDEF VerboseClientRectBugFix}
|
//if (Sender is TCustomForm) then
|
||||||
if (Sender is TCustomForm) then
|
//if AnsiCompareText(Sender.ClassName,'TScrollBar')=0 then
|
||||||
writeln(' FFF ResizeChild ',Sender.ClassName,' ',Left,',',Top);
|
// writeln(' FFF ResizeChild ',Sender.ClassName,' ',Left,',',Top,',',Width,',',Height);
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
//writeln('[TgtkObject.ResizeChild] END ',Sender.Classname,' Left=',Left,' Top=',Top,' Width=',Width,' Height=',Height);
|
//writeln('[TgtkObject.ResizeChild] END ',Sender.Classname,' Left=',Left,' Top=',Top,' Width=',Width,' Height=',Height);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TGtkObject.AddChild
|
Method: TGtkObject.AddChild
|
||||||
Params: parent -
|
Params: parent -
|
||||||
@ -5796,6 +5797,8 @@ begin
|
|||||||
SetWindowSizeAndPosition(PgtkWindow(SenderWidget),TWinControl(Sender));
|
SetWindowSizeAndPosition(PgtkWindow(SenderWidget),TWinControl(Sender));
|
||||||
end else if (LCLControl.Parent<>nil) then begin
|
end else if (LCLControl.Parent<>nil) then begin
|
||||||
// resize widget
|
// 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);
|
RealizeWidgetSize(SenderWidget,LCLControl.Width,LCLControl.Height);
|
||||||
// move widget on the fixed widget of parent control
|
// move widget on the fixed widget of parent control
|
||||||
ParentWidget:=pgtkWidget(LCLControl.Parent.Handle);
|
ParentWidget:=pgtkWidget(LCLControl.Parent.Handle);
|
||||||
@ -7946,6 +7949,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 1.394 2003/07/23 10:23:56 mattias
|
||||||
started README about remote debugging
|
started README about remote debugging
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user