mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-11 21:00:38 +01:00
gtk intf: moved FinishCreateHandle to gtk1 - it is usable for gtk1+2
git-svn-id: trunk@13642 -
This commit is contained in:
parent
ace1f24e16
commit
14fe68ea0b
@ -276,6 +276,9 @@ type
|
|||||||
function DestroyTimer(TimerHandle: THandle) : boolean; override;
|
function DestroyTimer(TimerHandle: THandle) : boolean; override;
|
||||||
procedure DestroyLCLComponent(Sender: TObject);virtual;
|
procedure DestroyLCLComponent(Sender: TObject);virtual;
|
||||||
|
|
||||||
|
// for gtk controls not part of the LCL:
|
||||||
|
procedure FinishCreateHandle(const AWinControl: TWinControl; Widget: PGtkWidget; const AParams: TCreateParams);
|
||||||
|
|
||||||
{$I gtkwinapih.inc}
|
{$I gtkwinapih.inc}
|
||||||
{$I gtklclintfh.inc}
|
{$I gtklclintfh.inc}
|
||||||
|
|
||||||
|
|||||||
@ -3748,6 +3748,29 @@ begin
|
|||||||
LastRight:=EmptyLastMouseClick;
|
LastRight:=EmptyLastMouseClick;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGTKWidgetSet.FinishCreateHandle(const AWinControl: TWinControl;
|
||||||
|
Widget: PGtkWidget; const AParams: TCreateParams);
|
||||||
|
var
|
||||||
|
WidgetInfo: PWidgetInfo;
|
||||||
|
Allocation: TGTKAllocation;
|
||||||
|
begin
|
||||||
|
WidgetInfo := GetWidgetInfo(Widget,true); // Widget info already created in CreateAPIWidget
|
||||||
|
WidgetInfo^.LCLObject := AWinControl;
|
||||||
|
WidgetInfo^.Style := AParams.Style;
|
||||||
|
WidgetInfo^.ExStyle := AParams.ExStyle;
|
||||||
|
WidgetInfo^.WndProc := PtrUInt(AParams.WindowClass.lpfnWndProc);
|
||||||
|
|
||||||
|
// set allocation
|
||||||
|
Allocation.X := AParams.X;
|
||||||
|
Allocation.Y := AParams.Y;
|
||||||
|
Allocation.Width := AParams.Width;
|
||||||
|
Allocation.Height := AParams.Height;
|
||||||
|
gtk_widget_size_allocate(Widget, @Allocation);
|
||||||
|
|
||||||
|
Set_RC_Name(AWinControl, Widget);
|
||||||
|
TGtkWSWinControl.SetCallbacks(PGtkObject(Widget), AWinControl);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TGtkWidgetSet.DestroyConnectedWidget(Widget: PGtkWidget;
|
procedure TGtkWidgetSet.DestroyConnectedWidget(Widget: PGtkWidget;
|
||||||
CheckIfDestroying: boolean);
|
CheckIfDestroying: boolean);
|
||||||
var
|
var
|
||||||
|
|||||||
@ -75,9 +75,6 @@ type
|
|||||||
|
|
||||||
function AppHandle: Thandle; override;
|
function AppHandle: Thandle; override;
|
||||||
|
|
||||||
// for gtk controls not part of the LCL:
|
|
||||||
procedure FinishCreateHandle(const AWinControl: TWinControl; Widget: PGtkWidget; const AParams: TCreateParams);
|
|
||||||
|
|
||||||
{$I gtk2winapih.inc}
|
{$I gtk2winapih.inc}
|
||||||
{$I gtk2lclintfh.inc}
|
{$I gtk2lclintfh.inc}
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -567,30 +567,6 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGtk2WidgetSet.FinishCreateHandle(
|
|
||||||
const AWinControl: TWinControl; Widget: PGtkWidget;
|
|
||||||
const AParams: TCreateParams);
|
|
||||||
var
|
|
||||||
WidgetInfo: PWidgetInfo;
|
|
||||||
Allocation: TGTKAllocation;
|
|
||||||
begin
|
|
||||||
WidgetInfo := GetWidgetInfo(Widget,true); // Widget info already created in CreateAPIWidget
|
|
||||||
WidgetInfo^.LCLObject := AWinControl;
|
|
||||||
WidgetInfo^.Style := AParams.Style;
|
|
||||||
WidgetInfo^.ExStyle := AParams.ExStyle;
|
|
||||||
WidgetInfo^.WndProc := PtrUInt(AParams.WindowClass.lpfnWndProc);
|
|
||||||
|
|
||||||
// set allocation
|
|
||||||
Allocation.X := AParams.X;
|
|
||||||
Allocation.Y := AParams.Y;
|
|
||||||
Allocation.Width := AParams.Width;
|
|
||||||
Allocation.Height := AParams.Height;
|
|
||||||
gtk_widget_size_allocate(Widget, @Allocation);
|
|
||||||
|
|
||||||
Set_RC_Name(AWinControl, Widget);
|
|
||||||
TGtkWSWinControl.SetCallbacks(PGtkObject(Widget), AWinControl);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{$IFDEF ASSERT_IS_ON}
|
{$IFDEF ASSERT_IS_ON}
|
||||||
{$UNDEF ASSERT_IS_ON}
|
{$UNDEF ASSERT_IS_ON}
|
||||||
{$C-}
|
{$C-}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user