mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 16:39:26 +02:00
MG: reduced size+move messages between lcl and interface
git-svn-id: trunk@1522 -
This commit is contained in:
parent
cda51ae148
commit
f118ad2dcb
@ -319,6 +319,7 @@ writeln('[TCodeCompletionCodeTool.CompleteProperty] no type : found -> ignore pr
|
||||
if WordIsPropertySpecifier.DoItUpperCase(UpperSrc,CurPos.StartPos,
|
||||
CurPos.EndPos-CurPos.StartPos) then
|
||||
RaiseException('default parameter expected, but '+GetAtom+' found');
|
||||
ReadConstant(true,false,[]);
|
||||
Parts[ppDefault].StartPos:=CurPos.StartPos;
|
||||
if not ReadConstant(true,false,[]) then exit;
|
||||
Parts[ppDefault].EndPos:=LastAtoms.GetValueAt(0).EndPos;
|
||||
|
@ -38,7 +38,8 @@ uses classes, controls, vclglobals, sysutils, GraphType, Graphics, Menus,
|
||||
LCLLinux, LCLType, LMessages;
|
||||
|
||||
type
|
||||
TPosition = (poDesigned, poDefault, poDefaultPosOnly, poDefaultSizeOnly, poScreenCenter, poDesktopCenter, poMainFormCenter, poOwnerFormCenter);
|
||||
TPosition = (poDesigned, poDefault, poDefaultPosOnly, poDefaultSizeOnly,
|
||||
poScreenCenter, poDesktopCenter, poMainFormCenter, poOwnerFormCenter);
|
||||
|
||||
TWindowState = (wsNormal, wsMinimized, wsMaximized);
|
||||
TCloseAction = (caNone, caHide, caFree, caMinimize);
|
||||
|
@ -167,10 +167,10 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
Procedure TCustomForm.SetFocus;
|
||||
Begin
|
||||
writeln('[TCustomForm.SetFocus] A ',Classname);
|
||||
//writeln('[TCustomForm.SetFocus] A ',Classname);
|
||||
//if not(Visible and Enabled) then Exit;
|
||||
CNSendMessage(LM_SETFOCUS,Self,nil);
|
||||
writeln('[TCustomForm.SetFocus] END ',Classname);
|
||||
//writeln('[TCustomForm.SetFocus] END ',Classname);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
@ -300,7 +300,9 @@ End;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCustomForm.DoCreate;
|
||||
begin
|
||||
BeginUpdateBounds;
|
||||
if Assigned(FOnCreate) then FOnCreate(Self);
|
||||
EndUpdateBounds;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -971,6 +973,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.36 2002/03/16 21:40:55 lazarus
|
||||
MG: reduced size+move messages between lcl and interface
|
||||
|
||||
Revision 1.35 2002/03/13 22:48:16 lazarus
|
||||
Constraints implementation (first cut) and sizig - moving system rework to
|
||||
better match Delphi/Kylix way of doing things (the existing implementation
|
||||
|
@ -826,6 +826,8 @@ var
|
||||
Dummy: TPoint;
|
||||
OldLeft, OldTop, OldWidth, OldHeight: integer;
|
||||
TopLeftChanged, WidthHeightChanged: boolean;
|
||||
|
||||
DummyW, DummyH, DummyD: integer;
|
||||
begin
|
||||
EventTrace('size-allocate', data);
|
||||
|
||||
@ -856,14 +858,33 @@ begin
|
||||
if TObject(data) is TWinControl then begin
|
||||
hWnd := TWinControl(data).Handle;
|
||||
if TObject(data) is TCustomForm then begin
|
||||
//writeln('[gtksize_allocateCB] CUSTOMFORM ************'
|
||||
// ,TControl(Data).Left,',',TControl(Data).Top,' ',Size^.X,',',Size^.Y);
|
||||
{ writeln('[gtksize_allocateCB] CUSTOMFORM AAA1 ************ ',
|
||||
TCustomForm(Data).Name,' Widget=',HexStr(Cardinal(Widget),8),
|
||||
' ',TControl(Data).Left,',',TControl(Data).Top,' ',Size^.X,',',Size^.Y);}
|
||||
Dummy.X:=TControl(Data).Left;
|
||||
Dummy.Y:=TControl(Data).Top;
|
||||
if widget^.window<>nil then
|
||||
gdk_window_get_root_origin(widget^.window, @Dummy.X, @Dummy.Y);
|
||||
try
|
||||
gdk_window_get_root_origin(widget^.window, @Dummy.X, @Dummy.Y);
|
||||
except
|
||||
on E: Exception do writeln('This was gdk_window_get_root_origin: ',E.Message);
|
||||
end;
|
||||
Size^.X:=Dummy.X;
|
||||
Size^.Y:=Dummy.Y;
|
||||
{ writeln('[gtksize_allocateCB] CUSTOMFORM AAA2 ************ ',
|
||||
TCustomForm(Data).Name,' Widget=',HexStr(Cardinal(Widget),8),
|
||||
' ',TControl(Data).Left,',',TControl(Data).Top,' ',Size^.X,',',Size^.Y);}
|
||||
{if widget^.window<>nil then begin
|
||||
gdk_window_get_Position(widget^.window, @Dummy.X, @Dummy.Y);
|
||||
writeln(' Position=',Dummy.X,',',Dummy.Y);
|
||||
gdk_window_get_geometry(widget^.window, @Dummy.X, @Dummy.Y, @DummyW, @DummyH, @DummyD);
|
||||
writeln(' Geometry=',Dummy.X,',',Dummy.Y,',',DummyW,',',DummyH,',',DummyD);
|
||||
gdk_window_get_origin(widget^.window, @Dummy.X, @Dummy.Y);
|
||||
writeln(' Origin=',Dummy.X,',',Dummy.Y);
|
||||
gdk_window_get_deskrelative_origin(widget^.window, @Dummy.X, @Dummy.Y);
|
||||
writeln(' deskrelative_Origin=',Dummy.X,',',Dummy.Y);
|
||||
end;}
|
||||
|
||||
end;
|
||||
end else
|
||||
hWnd := 0;
|
||||
@ -888,14 +909,13 @@ begin
|
||||
{ If the message is not handled. A LM_SIZE and LM_MOVE should be sent
|
||||
}
|
||||
|
||||
|
||||
if (PosMsg.Result = 0) then
|
||||
begin
|
||||
if WidthHeightChanged then begin
|
||||
with SizeMsg do
|
||||
begin
|
||||
Msg := LM_SIZE;
|
||||
SizeType := 6; // force ReAlign
|
||||
SizeType := Size_SourceIsInterface;
|
||||
Width := Size^.Width;
|
||||
Height := Size^.Height;
|
||||
end;
|
||||
@ -907,7 +927,7 @@ begin
|
||||
with MoveMsg do
|
||||
begin
|
||||
Msg := LM_MOVE;
|
||||
MoveType := 1; // force RequestAlign
|
||||
MoveType := Move_SourceIsInterface;
|
||||
XPos := Size^.X;
|
||||
YPos := Size^.Y;
|
||||
end;
|
||||
@ -1571,6 +1591,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.62 2002/03/16 21:40:55 lazarus
|
||||
MG: reduced size+move messages between lcl and interface
|
||||
|
||||
Revision 1.61 2002/03/14 18:12:46 lazarus
|
||||
Mouse events fixes.
|
||||
|
||||
|
@ -48,9 +48,10 @@ initialization
|
||||
InterfaceObject := TgtkObject.Create;
|
||||
|
||||
finalization
|
||||
|
||||
FreeandNil(Application);
|
||||
Application.Free;
|
||||
Application:=nil;
|
||||
FreeAllClipBoards;
|
||||
FreeAndNil(InterfaceObject);
|
||||
InterfaceObject.Free;
|
||||
InterfaceObject:=nil;
|
||||
|
||||
end.
|
||||
|
@ -436,7 +436,8 @@ TLMMouseMove = TLMMOuse;
|
||||
|
||||
TLMMove = record
|
||||
Msg: Cardinal;
|
||||
MoveType: Integer; // 0 = update, 1 = force RequestAlign
|
||||
MoveType: Integer; // 0 = update, 1 = force RequestAlign,
|
||||
// 128 = Source is Interface (Widget has moved)
|
||||
case Integer of
|
||||
0: (
|
||||
XPos: Smallint;
|
||||
@ -655,7 +656,7 @@ end;
|
||||
|
||||
TLMSize = packed record
|
||||
Msg: Cardinal;
|
||||
SizeType: LongInt; // 0 = update, 1 = force realign
|
||||
SizeType: LongInt; // see LCLType.pp (e.g. Size_Restored)
|
||||
Width : Word;
|
||||
Height : Word;
|
||||
Result : LongInt;
|
||||
@ -799,6 +800,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.22 2002/03/16 21:40:54 lazarus
|
||||
MG: reduced size+move messages between lcl and interface
|
||||
|
||||
Revision 1.21 2002/03/13 22:48:16 lazarus
|
||||
Constraints implementation (first cut) and sizig - moving system rework to
|
||||
better match Delphi/Kylix way of doing things (the existing implementation
|
||||
|
Loading…
Reference in New Issue
Block a user