gtk intf: moved FinishCreateHandle to gtk1 - it is usable for gtk1+2

git-svn-id: trunk@13642 -
This commit is contained in:
mattias 2008-01-05 22:51:53 +00:00
parent ace1f24e16
commit 14fe68ea0b
4 changed files with 26 additions and 27 deletions

View File

@ -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}

View File

@ -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

View File

@ -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;

View File

@ -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-}