- remove obsoleted code
- fix mem leak in TGtkWSCustomControl.CreateHandle

git-svn-id: trunk@13494 -
This commit is contained in:
paul 2007-12-28 04:18:53 +00:00
parent e62b25127e
commit 6c90924c4c
3 changed files with 8 additions and 12 deletions

View File

@ -3741,11 +3741,8 @@ begin
WidgetInfo := GetWidgetInfo(Widget, True);
WidgetInfo^.LCLObject := AnObject;
//TODO: remove old compatebility
gtk_object_set_data(Widget, 'Class', Pointer(AnObject));
end;
//TODO: cleanup when WidgetInfo is fully implemented
function GetLCLObject(const Widget: Pointer): TObject;
var
WidgetInfo: PWinWidgetInfo;
@ -3757,10 +3754,6 @@ begin
if WidgetInfo <> nil
then Result := WidgetInfo^.LCLObject
else Result := nil;
// Fallback;
if Result = nil
then Result := TObject(gtk_object_get_data(Widget, 'Class'));
end;
{-------------------------------------------------------------------------------

View File

@ -4064,9 +4064,9 @@ var
WinWidgetInfo: PWinWidgetInfo;
begin
Result := GTKAPIWidget_New;
WinWidgetInfo:=GetWidgetInfo(Result,true);
WinWidgetInfo^.CoreWidget:=PGTKAPIWidget(Result)^.Client;
SetLCLObject(WinWidgetInfo^.CoreWidget,AWinControl);
WinWidgetInfo := GetWidgetInfo(Result, True);
WinWidgetInfo^.CoreWidget := PGTKAPIWidget(Result)^.Client;
WinWidgetInfo^.LCLObject := AWinControl;
gtk_scrolled_window_set_policy(PGTKScrolledWindow(Result),
GTK_POLICY_NEVER, GTK_POLICY_NEVER);

View File

@ -108,7 +108,7 @@ type
protected
class procedure SetCallbacks(const AWidget: PGtkWidget; const AWidgetInfo: PWidgetInfo); virtual;
public
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
end;
{ TGtkWSImageList }
@ -909,7 +909,10 @@ begin
Result := THandle(PtrUInt(Widget));
if Result = 0 then Exit;
WidgetInfo := CreateWidgetInfo(Widget, AWinControl, AParams);
WidgetInfo := GetWidgetInfo(Widget); // Widget info already created in CreateAPIWidget
WidgetInfo^.Style := AParams.Style;
WidgetInfo^.ExStyle := AParams.ExStyle;
WidgetInfo^.WndProc := PtrUInt(AParams.WindowClass.lpfnWndProc);
// set allocation
Allocation.X := AParams.X;