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;
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 gtklclintfh.inc}

View File

@ -3748,6 +3748,29 @@ begin
LastRight:=EmptyLastMouseClick;
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;
CheckIfDestroying: boolean);
var

View File

@ -75,9 +75,6 @@ type
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 gtk2lclintfh.inc}
end;

View File

@ -567,30 +567,6 @@ begin
{$endif}
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}
{$UNDEF ASSERT_IS_ON}
{$C-}