mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-29 10:47:12 +01:00
MG: setwindowpos + bugfixes
git-svn-id: trunk@240 -
This commit is contained in:
parent
9dba2d8387
commit
0b8e9b01d6
@ -88,6 +88,9 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
procedure AddCompletion(AToken, AValue, AComment: string);
|
procedure AddCompletion(AToken, AValue, AComment: string);
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
procedure DeleteCompletion(Index: integer);
|
||||||
|
{$ENDIF}
|
||||||
function AddEditor(AEditor: TCustomSynEdit): boolean;
|
function AddEditor(AEditor: TCustomSynEdit): boolean;
|
||||||
procedure Execute(AEditor: TCustomSynEdit); virtual;
|
procedure Execute(AEditor: TCustomSynEdit); virtual;
|
||||||
procedure ExecuteCompletion(AToken: string; AEditor: TCustomSynEdit);
|
procedure ExecuteCompletion(AToken: string; AEditor: TCustomSynEdit);
|
||||||
@ -175,6 +178,15 @@ begin
|
|||||||
fEOTokenChars := '()[]{}.';
|
fEOTokenChars := '()[]{}.';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
procedure TCustomSynAutoComplete.DeleteCompletion(Index: integer);
|
||||||
|
begin
|
||||||
|
fCompletions.Delete(Index);
|
||||||
|
fCompletionComments.Delete(Index);
|
||||||
|
fCompletionValues.Delete(Index);
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
destructor TCustomSynAutoComplete.Destroy;
|
destructor TCustomSynAutoComplete.Destroy;
|
||||||
begin
|
begin
|
||||||
fEditors.Free;
|
fEditors.Free;
|
||||||
|
|||||||
@ -664,6 +664,7 @@ TCMDialogKey = TLMKEY;
|
|||||||
procedure DetachSignals; virtual;
|
procedure DetachSignals; virtual;
|
||||||
procedure DestroyWnd; virtual;
|
procedure DestroyWnd; virtual;
|
||||||
procedure UpdateShowing; virtual;
|
procedure UpdateShowing; virtual;
|
||||||
|
Procedure SetZOrder(Topmost: Boolean); override;
|
||||||
procedure ShowControl(AControl: TControl); virtual;
|
procedure ShowControl(AControl: TControl); virtual;
|
||||||
procedure WndProc(var Message : TLMessage); override;
|
procedure WndProc(var Message : TLMessage); override;
|
||||||
function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; dynamic;
|
function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; dynamic;
|
||||||
@ -1129,6 +1130,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.17 2001/03/26 14:58:31 lazarus
|
||||||
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.16 2001/03/19 14:00:50 lazarus
|
Revision 1.16 2001/03/19 14:00:50 lazarus
|
||||||
MG: fixed many unreleased DC and GDIObj bugs
|
MG: fixed many unreleased DC and GDIObj bugs
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,8 @@ type
|
|||||||
Procedure SetDesigner(Value : TIDesigner);
|
Procedure SetDesigner(Value : TIDesigner);
|
||||||
Procedure SetMenu(value : TMainMenu);
|
Procedure SetMenu(value : TMainMenu);
|
||||||
Procedure SetFormStyle(Value : TFormStyle);
|
Procedure SetFormStyle(Value : TFormStyle);
|
||||||
Procedure SetPosition(value : TPosition);
|
Procedure SetPosition(Value : TPosition);
|
||||||
|
Procedure SetVisible(Value: boolean);
|
||||||
Procedure SetWindowState(Value : TWIndowState);
|
Procedure SetWindowState(Value : TWIndowState);
|
||||||
Function GetCanvas: TControlCanvas;
|
Function GetCanvas: TControlCanvas;
|
||||||
Function IsForm : Boolean;
|
Function IsForm : Boolean;
|
||||||
@ -163,6 +164,7 @@ type
|
|||||||
property KeyPreview: Boolean read FKeyPreview write FKeyPreview;
|
property KeyPreview: Boolean read FKeyPreview write FKeyPreview;
|
||||||
property Menu : TMainMenu read FMenu write SetMenu;
|
property Menu : TMainMenu read FMenu write SetMenu;
|
||||||
property ModalResult : TModalResult read FModalResult write FModalResult;
|
property ModalResult : TModalResult read FModalResult write FModalResult;
|
||||||
|
property Visible write SetVisible default False;
|
||||||
property WindowState: TWindowState read FWindowState write SetWIndowState default wsNormal;
|
property WindowState: TWindowState read FWindowState write SetWIndowState default wsNormal;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -407,6 +409,7 @@ initialization
|
|||||||
Focusmessages := True;
|
Focusmessages := True;
|
||||||
|
|
||||||
finalization
|
finalization
|
||||||
|
writeln('forms.pp - finalization section');
|
||||||
Application.Free;
|
Application.Free;
|
||||||
Application:= nil;
|
Application:= nil;
|
||||||
Screen.Free;
|
Screen.Free;
|
||||||
|
|||||||
@ -113,7 +113,6 @@ Begin
|
|||||||
if FDesigner <> nil then FDesigner.Notification(AComponent,Operation);
|
if FDesigner <> nil then FDesigner.Notification(AComponent,Operation);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TCustomForm.SetFocus
|
Method: TCustomForm.SetFocus
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
@ -122,7 +121,23 @@ Begin
|
|||||||
Assert(False, 'Trace:SETFOCUS');
|
Assert(False, 'Trace:SETFOCUS');
|
||||||
//if not(Visible and Enabled) then Exit;
|
//if not(Visible and Enabled) then Exit;
|
||||||
Assert(False, 'Trace:SETFOCUS2');
|
Assert(False, 'Trace:SETFOCUS2');
|
||||||
CNSendMessage(LM_SETFOCUS,Self,nil);
|
CNSendMessage(LM_SETFOCUS,Self,nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ TCustomForm SetVisible }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
Procedure TCustomForm.SetVisible(Value : boolean);
|
||||||
|
Begin
|
||||||
|
if fsCreating in FFormState then
|
||||||
|
if Value then
|
||||||
|
Include(FFormState, fsVisible)
|
||||||
|
else
|
||||||
|
Exclude(FFormState, fsVisible)
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
inherited Visible := Value;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -859,8 +874,8 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.16 2001/03/20 16:59:15 lazarus
|
Revision 1.17 2001/03/26 14:58:31 lazarus
|
||||||
MG: fixed many bugs (mem leaks, canvas)
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.15 2001/03/19 14:41:56 lazarus
|
Revision 1.15 2001/03/19 14:41:56 lazarus
|
||||||
MG: fixed many unreleased DC and GDIObj bugs
|
MG: fixed many unreleased DC and GDIObj bugs
|
||||||
|
|||||||
@ -396,6 +396,12 @@ Begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TInterfaceBase.SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
|
||||||
|
X, Y, cx, cy: Integer; uFlags: UINT): Boolean;
|
||||||
|
begin
|
||||||
|
Result:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
function TInterfaceBase.ShowCaret(hWnd: HWND): Boolean;
|
function TInterfaceBase.ShowCaret(hWnd: HWND): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
@ -432,6 +438,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.13 2001/03/26 14:58:31 lazarus
|
||||||
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.12 2001/03/12 12:17:01 lazarus
|
Revision 1.12 2001/03/12 12:17:01 lazarus
|
||||||
MG: fixed random function results
|
MG: fixed random function results
|
||||||
|
|
||||||
|
|||||||
@ -396,6 +396,12 @@ begin
|
|||||||
Result := InterfaceObject.SetWindowOrgEx(dc,NewX,NewY,lpPoint);
|
Result := InterfaceObject.SetWindowOrgEx(dc,NewX,NewY,lpPoint);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
|
||||||
|
X, Y, cx, cy: Integer; uFlags: UINT): Boolean;
|
||||||
|
begin
|
||||||
|
Result:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
function ShowCaret(hWnd: HWND): Boolean;
|
function ShowCaret(hWnd: HWND): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := InterfaceObject.ShowCaret(hWnd)
|
Result := InterfaceObject.ShowCaret(hWnd)
|
||||||
@ -965,6 +971,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.12 2001/03/26 14:58:31 lazarus
|
||||||
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.11 2001/02/16 19:13:30 lazarus
|
Revision 1.11 2001/02/16 19:13:30 lazarus
|
||||||
Added some functions
|
Added some functions
|
||||||
Shane
|
Shane
|
||||||
|
|||||||
@ -125,6 +125,8 @@ Function SetTextCharacterExtra(_hdc : hdc; nCharExtra : Integer):Integer; {$IFDE
|
|||||||
function SetTextColor(DC: HDC; Color: TColorRef): TColorRef; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function SetTextColor(DC: HDC; Color: TColorRef): TColorRef; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function SetWindowLong(Handle: HWND; Idx: Integer; NewLong : Longint): Longint;{$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function SetWindowLong(Handle: HWND; Idx: Integer; NewLong : Longint): Longint;{$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; Var Point : TPoint): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; Var Point : TPoint): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
|
function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
|
||||||
|
X, Y, cx, cy: Integer; uFlags: UINT): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function ShowCaret(hWnd: HWND): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function ShowCaret(hWnd: HWND): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Rop: Cardinal): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Rop: Cardinal): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
@ -221,6 +223,9 @@ function UnionRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): Boolean
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.9 2001/03/26 14:58:31 lazarus
|
||||||
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.8 2001/02/16 19:13:31 lazarus
|
Revision 1.8 2001/02/16 19:13:31 lazarus
|
||||||
Added some functions
|
Added some functions
|
||||||
Shane
|
Shane
|
||||||
|
|||||||
@ -116,11 +116,13 @@ var
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if (Control.Left <> Left2) or (Control.Top <> Top2) or (Control.Width <> Width2) or (Control.Height <> Height2) then begin
|
if (Control.Left <> Left2) or (Control.Top <> Top2)
|
||||||
|
or (Control.Width <> Width2) or (Control.Height <> Height2) then begin
|
||||||
Control.SetBounds(Left2, Top2, Width2, Height2);
|
Control.SetBounds(Left2, Top2, Width2, Height2);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{Sometimes the control doesn't resize. This will verifiy that it is the size it is assigned to be}
|
{Sometimes the control doesn't resize. This will verifiy that it is the
|
||||||
|
size it is assigned to be}
|
||||||
if (Control.Width <> Width2) or (Control.Height <> Height2) then
|
if (Control.Width <> Width2) or (Control.Height <> Height2) then
|
||||||
with Rect do
|
with Rect do
|
||||||
case AAlign of
|
case AAlign of
|
||||||
@ -355,8 +357,26 @@ end;
|
|||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
Procedure TWinControl.SetBorderWidth(value : TBorderWidth);
|
Procedure TWinControl.SetBorderWidth(value : TBorderWidth);
|
||||||
Begin
|
Begin
|
||||||
//TODO: SETBORDERWIDTH - Not sure if anything more is needed here
|
//TODO: SETBORDERWIDTH - Not sure if anything more is needed here
|
||||||
FBorderWidth := Value;
|
FBorderWidth := Value;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure TWinControl.SetZOrder(Topmost: Boolean);
|
||||||
|
const
|
||||||
|
WindowPos: array[Boolean] of Word = (HWND_BOTTOM, HWND_TOP);
|
||||||
|
var i: integer;
|
||||||
|
begin
|
||||||
|
if FParent <> nil then
|
||||||
|
begin
|
||||||
|
if TopMost then i := FParent.FWinControls.Count - 1
|
||||||
|
else i := 0;
|
||||||
|
if FParent.FControls <> nil then inc(i, FParent.FControls.Count);
|
||||||
|
SetZOrderPosition(i);
|
||||||
|
end
|
||||||
|
else if FHandle <> 0 then begin
|
||||||
|
InterfaceObject.SetWindowPos(FHandle, WindowPos[TopMost], 0, 0, 0, 0,
|
||||||
|
SWP_NOMOVE + SWP_NOSIZE);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
@ -1802,7 +1822,8 @@ procedure TWinControl.SetBounds(aLeft, aTop, aWidth, aHeight : integer);
|
|||||||
var
|
var
|
||||||
R : TRect;
|
R : TRect;
|
||||||
begin
|
begin
|
||||||
if (ALeft = Left) and (ATop = Top) and (AWidth = Width) and (AHeight = Height) then Exit;
|
if (ALeft = Left) and (ATop = Top) and (AWidth = Width) and (AHeight = Height)
|
||||||
|
then Exit;
|
||||||
FLeft := aLeft;
|
FLeft := aLeft;
|
||||||
FTop := aTop;
|
FTop := aTop;
|
||||||
FWidth := aWidth;
|
FWidth := aWidth;
|
||||||
@ -1811,6 +1832,7 @@ begin
|
|||||||
if HandleAllocated
|
if HandleAllocated
|
||||||
then begin
|
then begin
|
||||||
R:= Rect(ALeft, ATop, AWidth, AHeight);
|
R:= Rect(ALeft, ATop, AWidth, AHeight);
|
||||||
|
//writeln('[TWinControl.SetBounds] ',name,':',Classname,' ',Height);
|
||||||
CNSendMessage(LM_SetSize, Self, @R);
|
CNSendMessage(LM_SetSize, Self, @R);
|
||||||
end
|
end
|
||||||
else inherited SetBounds(aLeft, aTop, aWidth, aHeight);
|
else inherited SetBounds(aLeft, aTop, aWidth, aHeight);
|
||||||
@ -1917,7 +1939,7 @@ end;
|
|||||||
procedure TWinControl.CMShowingChanged(var Message: TLMessage);
|
procedure TWinControl.CMShowingChanged(var Message: TLMessage);
|
||||||
begin
|
begin
|
||||||
{ if (TWinControl(Self).HandleAllocated) or (Self is TCustomForm) then}
|
{ if (TWinControl(Self).HandleAllocated) or (Self is TCustomForm) then}
|
||||||
CNSendMessage(LM_ShowHide, Self, nil);
|
CNSendMessage(LM_ShowHide, Self, nil);
|
||||||
|
|
||||||
// SetWindowPos(FHandle, 0, 0, 0, 0, 0, ShowFlags[FShowing]);
|
// SetWindowPos(FHandle, 0, 0, 0, 0, 0, ShowFlags[FShowing]);
|
||||||
end;
|
end;
|
||||||
@ -1941,8 +1963,8 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.25 2001/03/20 16:59:15 lazarus
|
Revision 1.26 2001/03/26 14:58:31 lazarus
|
||||||
MG: fixed many bugs (mem leaks, canvas)
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.24 2001/03/19 14:38:39 lazarus
|
Revision 1.24 2001/03/19 14:38:39 lazarus
|
||||||
MG: fixed many unreleased DC and GDIObj bugs
|
MG: fixed many unreleased DC and GDIObj bugs
|
||||||
|
|||||||
@ -588,7 +588,8 @@ begin
|
|||||||
// ,TControl(Data).Left,',',TControl(Data).Top,' ',Size^.X,',',Size^.Y);
|
// ,TControl(Data).Left,',',TControl(Data).Top,' ',Size^.X,',',Size^.Y);
|
||||||
Dummy.X:=TControl(Data).Left;
|
Dummy.X:=TControl(Data).Left;
|
||||||
Dummy.Y:=TControl(Data).Top;
|
Dummy.Y:=TControl(Data).Top;
|
||||||
gdk_window_get_root_origin(widget^.window, @Dummy.X, @Dummy.Y);
|
if widget^.window<>nil then
|
||||||
|
gdk_window_get_root_origin(widget^.window, @Dummy.X, @Dummy.Y);
|
||||||
Size^.X:=Dummy.X;
|
Size^.X:=Dummy.X;
|
||||||
Size^.Y:=Dummy.Y;
|
Size^.Y:=Dummy.Y;
|
||||||
end;
|
end;
|
||||||
@ -1104,8 +1105,8 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.27 2001/03/21 23:48:29 lazarus
|
Revision 1.28 2001/03/26 14:58:31 lazarus
|
||||||
MG: fixed window positions
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.26 2001/03/19 14:44:22 lazarus
|
Revision 1.26 2001/03/19 14:44:22 lazarus
|
||||||
MG: fixed many unreleased DC and GDIObj bugs
|
MG: fixed many unreleased DC and GDIObj bugs
|
||||||
|
|||||||
@ -254,7 +254,8 @@ Begin
|
|||||||
//could we just call IntSendMessage??
|
//could we just call IntSendMessage??
|
||||||
|
|
||||||
//destroy old widget
|
//destroy old widget
|
||||||
gtk_widget_destroy(PgtkWidget(TWinControl(sender).HANDLE));
|
if TWinControl(sender).HANDLE<>0 then
|
||||||
|
gtk_widget_destroy(PgtkWidget(TWinControl(sender).HANDLE));
|
||||||
|
|
||||||
aParent := TWinControl(sender).Parent;
|
aParent := TWinControl(sender).Parent;
|
||||||
aParent.RemoveControl(TControl(sender));
|
aParent.RemoveControl(TControl(sender));
|
||||||
@ -364,6 +365,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
Assert(False, 'Trace:TODO:bringtofront');
|
Assert(False, 'Trace:TODO:bringtofront');
|
||||||
//For now just hide and show again.
|
//For now just hide and show again.
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
LM_BTNDEFAULT_CHANGED :
|
LM_BTNDEFAULT_CHANGED :
|
||||||
@ -375,15 +377,16 @@ begin
|
|||||||
|
|
||||||
LM_DESTROY :
|
LM_DESTROY :
|
||||||
begin
|
begin
|
||||||
if (Sender is TTimer) then
|
if (Sender is TTimer) then begin
|
||||||
begin
|
Assert(False, 'Trace:removing timer!!!');
|
||||||
Assert(False, 'Trace:removing timer!!!');
|
gtk_timeout_remove((Sender as TTimer).TimerID);
|
||||||
gtk_timeout_remove((Sender as TTimer).TimerID);
|
end
|
||||||
|
else if (Sender is TWinControl) or (Sender is TCommonDialog) then begin
|
||||||
|
if Handle<>0 then
|
||||||
|
gtk_widget_destroy(PGtkWidget(Handle));
|
||||||
end
|
end
|
||||||
else if (Sender is TWinControl) or (Sender is TCommonDialog)
|
|
||||||
then gtk_widget_destroy( PGtkWidget(Handle))
|
|
||||||
else
|
else
|
||||||
Assert (False, Format ('Trace:Dont know how to destroy component %s', [sender.classname]));
|
Assert (False, Format ('Trace:Dont know how to destroy component %s', [sender.classname]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
LM_DRAGINFOCHANGED :
|
LM_DRAGINFOCHANGED :
|
||||||
@ -557,6 +560,8 @@ activate_time : the time at which the activation event occurred.
|
|||||||
LM_SetSize :
|
LM_SetSize :
|
||||||
begin
|
begin
|
||||||
Assert(False, Format('Trace: [TgtkObject.IntSendMessage3] %s --> LM_SetSize(%d, %d, %d, %d)', [Sender.ClassNAme, PRect(Data)^.Left,PRect(Data)^.Top,PRect(Data)^.Right,PRect(Data)^.Bottom]));
|
Assert(False, Format('Trace: [TgtkObject.IntSendMessage3] %s --> LM_SetSize(%d, %d, %d, %d)', [Sender.ClassNAme, PRect(Data)^.Left,PRect(Data)^.Top,PRect(Data)^.Right,PRect(Data)^.Bottom]));
|
||||||
|
//writeln('[IntSendMessage3.lm_setsize] ',PRect(Data)^.Left,',',PRect(Data)^.Top,',',
|
||||||
|
// PRect(Data)^.Right,',',PRect(Data)^.Bottom);
|
||||||
ResizeChild(Sender,PRect(Data)^.Left,PRect(Data)^.Top,
|
ResizeChild(Sender,PRect(Data)^.Left,PRect(Data)^.Top,
|
||||||
PRect(Data)^.Right,PRect(Data)^.Bottom);
|
PRect(Data)^.Right,PRect(Data)^.Bottom);
|
||||||
end;
|
end;
|
||||||
@ -998,22 +1003,25 @@ begin
|
|||||||
|
|
||||||
if not (Sender is TSpeedButton) then
|
if not (Sender is TSpeedButton) then
|
||||||
begin
|
begin
|
||||||
pWidget := pgtkWidget(TWinControl(Sender).Handle);
|
pWidget := pgtkWidget(TWinControl(Sender).Handle);
|
||||||
gtk_widget_set_usize(pWidget, Width, Height);
|
//writeln('[TgtkObject.ResizeChild] ',Sender.ClassName,' ',Width,',',Height);
|
||||||
|
if Sender is TCustomForm then
|
||||||
|
//gdk_window_resize(pWidget^.Window, Width,Height);
|
||||||
|
gtk_widget_set_usize(pWidget, -1, -1);
|
||||||
|
gtk_widget_set_usize(pWidget, Width, Height);
|
||||||
|
|
||||||
if not ((Parent = nil) or (Sender is TCustomForm)) then
|
if not ((Parent = nil) or (Sender is TCustomForm)) then
|
||||||
begin
|
begin
|
||||||
pFixed := GetFixedWidget(PGtkWidget(Parent.Handle));
|
pFixed := GetFixedWidget(PGtkWidget(Parent.Handle));
|
||||||
if pFixed <> nil
|
if pFixed <> nil then begin
|
||||||
then begin
|
gtk_fixed_move(pFixed, pWidget, Left, Top);
|
||||||
gtk_fixed_move(pFixed, pWidget, Left, Top);
|
end
|
||||||
end
|
else Assert(False, 'Trace:ERROR!!!! - no Fixed Widget found to use when resizing....');
|
||||||
else Assert(False, 'Trace:ERROR!!!! - no Fixed Widget found to use when resizing....');
|
end
|
||||||
end
|
else begin
|
||||||
else begin
|
gtk_widget_set_uposition(pWidget, Left, Top);
|
||||||
gtk_widget_set_uposition(pWidget, Left, Top);
|
|
||||||
end;
|
end;
|
||||||
end
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -1317,8 +1325,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
LM_CHANGED :
|
LM_CHANGED :
|
||||||
if sender is TTrackBar
|
if sender is TTrackBar then begin
|
||||||
then ConnectSignal(gtk_Object(gtk_range_get_adjustment(GTK_RANGE(gObject))) , 'value_changed', @gtkvaluechanged)
|
ConnectSignal(gtk_Object(gtk_range_get_adjustment(
|
||||||
|
GTK_RANGE(gObject))) , 'value_changed', @gtkvaluechanged);
|
||||||
|
end
|
||||||
else if sender is TNotebook
|
else if sender is TNotebook
|
||||||
then ConnectSignal(gObject, 'switch-page', @gtkswitchpage)
|
then ConnectSignal(gObject, 'switch-page', @gtkswitchpage)
|
||||||
else if sender is TCustomCombobox
|
else if sender is TCustomCombobox
|
||||||
@ -1942,14 +1952,12 @@ begin
|
|||||||
begin
|
begin
|
||||||
if (TScrollBar(sender).kind = sbHorizontal) then
|
if (TScrollBar(sender).kind = sbHorizontal) then
|
||||||
begin
|
begin
|
||||||
Writeln('[Creating TScrollbar] Horiz');
|
|
||||||
P := gtk_hscrollbar_new(PgtkAdjustment(gtk_adjustment_new(1,TScrollBar(sender).min, TScrollBar(sender).max,
|
P := gtk_hscrollbar_new(PgtkAdjustment(gtk_adjustment_new(1,TScrollBar(sender).min, TScrollBar(sender).max,
|
||||||
TScrollBar(sender).SmallChange, TScrollBar(sender).LargeChange,
|
TScrollBar(sender).SmallChange, TScrollBar(sender).LargeChange,
|
||||||
TScrollBar(sender).Pagesize)));
|
TScrollBar(sender).Pagesize)));
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Begin
|
Begin
|
||||||
Writeln('[Creating TScrollbar] Vertical');
|
|
||||||
P := gtk_vscrollbar_new(PgtkAdjustment(gtk_adjustment_new(1,TScrollBar(sender).min, TScrollBar(sender).max,
|
P := gtk_vscrollbar_new(PgtkAdjustment(gtk_adjustment_new(1,TScrollBar(sender).min, TScrollBar(sender).max,
|
||||||
TScrollBar(sender).SmallChange, TScrollBar(sender).LargeChange,
|
TScrollBar(sender).SmallChange, TScrollBar(sender).LargeChange,
|
||||||
TScrollBar(sender).Pagesize)));
|
TScrollBar(sender).Pagesize)));
|
||||||
@ -2299,8 +2307,12 @@ begin
|
|||||||
Assert (Handle = nil, 'WARNING: [TgtkObject.GetValue] --> got nil pointer (no gtkobject)');
|
Assert (Handle = nil, 'WARNING: [TgtkObject.GetValue] --> got nil pointer (no gtkobject)');
|
||||||
|
|
||||||
case TControl(Sender).fCompStyle of
|
case TControl(Sender).fCompStyle of
|
||||||
csTrackbar : if handle <> nil then integer(data^) := round(gtk_range_get_adjustment (GTK_RANGE (handle))^.value) else
|
csTrackbar :
|
||||||
integer(data^) := 0;
|
if (handle <> nil) then begin
|
||||||
|
integer(data^) := round(gtk_range_get_adjustment(
|
||||||
|
GTK_RANGE (handle))^.value);
|
||||||
|
end else
|
||||||
|
integer(data^) := 0;
|
||||||
|
|
||||||
|
|
||||||
csRadiobutton,
|
csRadiobutton,
|
||||||
@ -2344,7 +2356,9 @@ begin
|
|||||||
csTrackbar : begin
|
csTrackbar : begin
|
||||||
if Handle = nil then Exit;
|
if Handle = nil then Exit;
|
||||||
gtk_range_get_adjustment (GTK_RANGE (handle))^.value := integer (data^);
|
gtk_range_get_adjustment (GTK_RANGE (handle))^.value := integer (data^);
|
||||||
gtk_signal_emit_by_name (PGtkObject (gtk_range_get_adjustment (GTK_RANGE (handle))), 'value_changed');
|
gtk_signal_emit_by_name (PGtkObject
|
||||||
|
(gtk_range_get_adjustment (
|
||||||
|
GTK_RANGE (handle))), 'value_changed');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
csRadiobutton,
|
csRadiobutton,
|
||||||
@ -2758,8 +2772,8 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.39 2001/03/21 23:48:29 lazarus
|
Revision 1.40 2001/03/26 14:58:31 lazarus
|
||||||
MG: fixed window positions
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.36 2001/03/19 18:51:57 lazarus
|
Revision 1.36 2001/03/19 18:51:57 lazarus
|
||||||
MG: added dynhasharray and renamed tsynautocompletion
|
MG: added dynhasharray and renamed tsynautocompletion
|
||||||
|
|||||||
@ -337,6 +337,7 @@ begin
|
|||||||
|
|
||||||
//write('CreateBrushIndirect->');
|
//write('CreateBrushIndirect->');
|
||||||
GObject := NewGDIObject(gdiBrush);
|
GObject := NewGDIObject(gdiBrush);
|
||||||
|
//writeln('[TgtkObject.CreateBrushIndirect] ',HexStr(Cardinal(GObject),8));
|
||||||
|
|
||||||
with LogBrush do
|
with LogBrush do
|
||||||
begin
|
begin
|
||||||
@ -3040,7 +3041,9 @@ begin
|
|||||||
Adjustment := PgtkvScrollBar(handle)^.Scrollbar.Range.Adjustment;
|
Adjustment := PgtkvScrollBar(handle)^.Scrollbar.Range.Adjustment;
|
||||||
SB_CTL:
|
SB_CTL:
|
||||||
if gtk_type_is_a(gtk_object_type(PGTKObject(Handle)), gtk_range_get_type)
|
if gtk_type_is_a(gtk_object_type(PGTKObject(Handle)), gtk_range_get_type)
|
||||||
then Adjustment := gtk_range_get_adjustment(PGTKRange(Handle));
|
then begin
|
||||||
|
Adjustment := gtk_range_get_adjustment(PGTKRange(Handle));
|
||||||
|
end;
|
||||||
else
|
else
|
||||||
Adjustment := nil;
|
Adjustment := nil;
|
||||||
end;
|
end;
|
||||||
@ -3225,12 +3228,30 @@ end;
|
|||||||
Function TgtkObject.SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; Var lpPoint : TPoint) : Boolean;
|
Function TgtkObject.SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; Var lpPoint : TPoint) : Boolean;
|
||||||
begin
|
begin
|
||||||
//writeln('[TgtkObject.SetWindowOrgEx] ',NewX,' ',NewY);
|
//writeln('[TgtkObject.SetWindowOrgEx] ',NewX,' ',NewY);
|
||||||
// gdk_window_move(pgtkwidget(PdeviceContext(dc)^.hwnd)^.window,Newx,Newy);
|
// ToDo: move origin
|
||||||
|
|
||||||
lpPoint.X := NewX;
|
lpPoint.X := NewX;
|
||||||
lpPoint.Y := NewY;
|
lpPoint.Y := NewY;
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TgtkObject.SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
|
||||||
|
X, Y, cx, cy: Integer; uFlags: UINT): Boolean;
|
||||||
|
//var Widget: PGTKWidget;
|
||||||
|
begin
|
||||||
|
//writeln('[TgtkObject.SetWindowPos] Top=',hWndInsertAfter=HWND_TOP);
|
||||||
|
{ Widget := GetFixedWidget(pgtkwidget(hWnd));
|
||||||
|
if Widget = nil then Widget := pgtkwidget(hWnd);
|
||||||
|
case hWndInsertAfter of
|
||||||
|
HWND_BOTTOM: ; {gdk_window_lower(Widget^.Window);}
|
||||||
|
HWND_TOP: gtk_window_set_position(PGtkWindow(hWnd),GTK_WIN_POS_CENTER);
|
||||||
|
{gdk_window_raise(Widget^.Window);}
|
||||||
|
end;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: ShowCaret
|
Function: ShowCaret
|
||||||
Params: none
|
Params: none
|
||||||
@ -3425,8 +3446,8 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.30 2001/03/21 23:48:29 lazarus
|
Revision 1.31 2001/03/26 14:58:31 lazarus
|
||||||
MG: fixed window positions
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.26 2001/03/19 18:51:57 lazarus
|
Revision 1.26 2001/03/19 18:51:57 lazarus
|
||||||
MG: added dynhasharray and renamed tsynautocompletion
|
MG: added dynhasharray and renamed tsynautocompletion
|
||||||
|
|||||||
@ -92,6 +92,8 @@ Function SetTextCharacterExtra(_hdc : hdc; nCharExtra : Integer):Integer; overri
|
|||||||
function SetTextColor(DC: HDC; Color: TColorRef): TColorRef; override;
|
function SetTextColor(DC: HDC; Color: TColorRef): TColorRef; override;
|
||||||
function SetWindowLong(Handle: HWND; Idx: Integer; NewLong : Longint): LongInt;
|
function SetWindowLong(Handle: HWND; Idx: Integer; NewLong : Longint): LongInt;
|
||||||
function SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; Var lpPoint : TPoint) : Boolean; override;
|
function SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; Var lpPoint : TPoint) : Boolean; override;
|
||||||
|
function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
|
||||||
|
X, Y, cx, cy: Integer; uFlags: UINT): Boolean; override;
|
||||||
function ShowCaret(hWnd: HWND): Boolean; override;
|
function ShowCaret(hWnd: HWND): Boolean; override;
|
||||||
function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; override;
|
function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; override;
|
||||||
function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Rop: Cardinal): Boolean; override;
|
function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Rop: Cardinal): Boolean; override;
|
||||||
@ -106,6 +108,9 @@ Function WindowFromPoint(Point : TPoint) : HWND; override;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.13 2001/03/26 14:58:32 lazarus
|
||||||
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.12 2001/03/13 15:02:14 lazarus
|
Revision 1.12 2001/03/13 15:02:14 lazarus
|
||||||
MG: activated GetWindowOrgEx
|
MG: activated GetWindowOrgEx
|
||||||
|
|
||||||
|
|||||||
@ -296,7 +296,7 @@ begin
|
|||||||
Timer := 0;
|
Timer := 0;
|
||||||
end;
|
end;
|
||||||
IsDrawn := False;
|
IsDrawn := False;
|
||||||
if BackPixmap <> nil
|
if (BackPixmap <> nil) and (Widget^.theStyle<>nil)
|
||||||
then gdk_draw_pixmap(
|
then gdk_draw_pixmap(
|
||||||
Widget^.Window,
|
Widget^.Window,
|
||||||
PGTKStyle(Widget^.theStyle)^.bg_gc[GTK_STATE_NORMAL],
|
PGTKStyle(Widget^.theStyle)^.bg_gc[GTK_STATE_NORMAL],
|
||||||
@ -545,6 +545,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.5 2001/03/26 14:58:32 lazarus
|
||||||
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.4 2001/03/13 15:02:14 lazarus
|
Revision 1.4 2001/03/13 15:02:14 lazarus
|
||||||
MG: activated GetWindowOrgEx
|
MG: activated GetWindowOrgEx
|
||||||
|
|
||||||
|
|||||||
@ -552,6 +552,13 @@ Region_Error = Error;
|
|||||||
WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE or WS_EX_CLIENTEDGE);
|
WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE or WS_EX_CLIENTEDGE);
|
||||||
WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE or WS_EX_TOOLWINDOW or WS_EX_TOPMOST);
|
WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE or WS_EX_TOOLWINDOW or WS_EX_TOPMOST);
|
||||||
|
|
||||||
|
const
|
||||||
|
{ SetWindowPos Flags }
|
||||||
|
HWND_TOP = 0;
|
||||||
|
HWND_BOTTOM = 1;
|
||||||
|
HWND_TOPMOST = HWND(-1);
|
||||||
|
HWND_NOTOPMOST = HWND(-2);
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
|
||||||
@ -1371,6 +1378,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.6 2001/03/26 14:58:31 lazarus
|
||||||
|
MG: setwindowpos + bugfixes
|
||||||
|
|
||||||
Revision 1.5 2001/02/01 16:45:19 lazarus
|
Revision 1.5 2001/02/01 16:45:19 lazarus
|
||||||
Started the code completion.
|
Started the code completion.
|
||||||
Shane
|
Shane
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user