From c9b2c77ce167d6b068dfecf2569f2320bf8654dd Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Wed, 16 Apr 2008 00:49:36 +0000 Subject: [PATCH] Fixes TListBox gtk2 events. git-svn-id: trunk@14844 - --- lcl/interfaces/gtk2/gtk2wsstdctrls.pp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lcl/interfaces/gtk2/gtk2wsstdctrls.pp b/lcl/interfaces/gtk2/gtk2wsstdctrls.pp index 575a2af2b6..c1c6792ec7 100644 --- a/lcl/interfaces/gtk2/gtk2wsstdctrls.pp +++ b/lcl/interfaces/gtk2/gtk2wsstdctrls.pp @@ -151,7 +151,9 @@ type TGtk2WSCustomListBox = class(TGtkWSCustomListBox) private protected + class procedure SetCallbacks(const AGtkWidget: PGtkWidget; const AWidgetInfo: PWidgetInfo); virtual; public + class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override; class function GetIndexAtY(const ACustomListBox: TCustomListBox; y: integer): integer; override; class function GetItemIndex(const ACustomListBox: TCustomListBox): integer; override; class function GetItemRect(const ACustomListBox: TCustomListBox; Index: integer; var ARect: TRect): boolean; override; @@ -168,7 +170,6 @@ type class procedure SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean); override; class procedure SetTopIndex(const ACustomListBox: TCustomListBox; const NewTopIndex: integer); override; class procedure SetFont(const AWinControl: TWinControl; const AFont : TFont); override; - class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override; end; { TGtk2WSListBox } @@ -618,7 +619,14 @@ begin WidgetInfo := GetWidgetInfo(p, False); - TGtkPrivateListClass(WSPrivate).SetCallbacks(p, WidgetInfo); + // Sets the callbacks + SetCallbacks(TVWidget, WidgetInfo); +end; + +class procedure TGtk2WSCustomListBox.SetCallbacks(const AGtkWidget: PGtkWidget; + const AWidgetInfo: PWidgetInfo); +begin + TGtkWSWinControl.SetCallbacks(PGtkObject(AGtkWidget), TComponent(AWidgetInfo^.LCLObject)); end; class function TGtk2WSCustomListBox.GetIndexAtY(