mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 14:29:07 +02:00
lcl: gtk2: simplified unit dependencies
This commit is contained in:
parent
6f8815b3bb
commit
0fcf3dcd1e
@ -16,27 +16,4 @@ class procedure TGtkPrivateList.SetCallbacks(const AGtkWidget: PGtkWidget; const
|
|||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Gtk2WS_ListBoxChange({%H-}Selection: PGtkTreeSelection; WidgetInfo: PWidgetInfo); cdecl;
|
|
||||||
var
|
|
||||||
Mess: TLMessage;
|
|
||||||
begin
|
|
||||||
{$IFDEF EventTrace}
|
|
||||||
EventTrace('Gtk2WS_ListBoxChange', WidgetInfo^.LCLObject);
|
|
||||||
{$ENDIF}
|
|
||||||
FillChar(Mess{%H-}, SizeOf(Mess), 0);
|
|
||||||
Mess.msg := LM_SELCHANGE;
|
|
||||||
DeliverMessage(WidgetInfo^.LCLObject, Mess);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TGtk2PrivateList }
|
|
||||||
|
|
||||||
class procedure TGtk2PrivateList.SetCallbacks(const AGtkWidget: PGtkWidget; const AWidgetInfo: PWidgetInfo);
|
|
||||||
var
|
|
||||||
Selection: PGtkTreeSelection;
|
|
||||||
begin
|
|
||||||
TGtk2WSBaseScrollingWinControl.SetCallbacks(AGtkWidget, AWidgetInfo);
|
|
||||||
|
|
||||||
Selection := gtk_tree_view_get_selection(PGtkTreeView(AWidgetInfo^.CoreWidget));
|
|
||||||
SignalConnect(PGtkWidget(Selection), 'changed', @Gtk2WS_ListBoxChange, AWidgetInfo);
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
@ -132,6 +132,16 @@ type
|
|||||||
VScroll: PGTKWidget;
|
VScroll: PGTKWidget;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TGtk2ListBoxPrivateList }
|
||||||
|
{ Private class for gtklists }
|
||||||
|
|
||||||
|
TGtk2ListBoxPrivateList = class(TGtkPrivateList)
|
||||||
|
private
|
||||||
|
protected
|
||||||
|
public
|
||||||
|
class procedure SetCallbacks(const AGtkWidget: PGtkWidget; const AWidgetInfo: PWidgetInfo); override;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TGtk2WSBaseScrollingWinControl }
|
{ TGtk2WSBaseScrollingWinControl }
|
||||||
|
|
||||||
TGtk2WSBaseScrollingWinControl = class(TWSWinControl)
|
TGtk2WSBaseScrollingWinControl = class(TWSWinControl)
|
||||||
@ -1099,6 +1109,30 @@ begin
|
|||||||
gtk_widget_queue_draw({%H-}PGtkWidget(AWinControl.Handle));
|
gtk_widget_queue_draw({%H-}PGtkWidget(AWinControl.Handle));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure Gtk2WS_ListBoxChange({%H-}Selection: PGtkTreeSelection; WidgetInfo: PWidgetInfo); cdecl;
|
||||||
|
var
|
||||||
|
Mess: TLMessage;
|
||||||
|
begin
|
||||||
|
{$IFDEF EventTrace}
|
||||||
|
EventTrace('Gtk2WS_ListBoxChange', WidgetInfo^.LCLObject);
|
||||||
|
{$ENDIF}
|
||||||
|
FillChar(Mess{%H-}, SizeOf(Mess), 0);
|
||||||
|
Mess.msg := LM_SELCHANGE;
|
||||||
|
DeliverMessage(WidgetInfo^.LCLObject, Mess);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TGtk2ListBoxPrivateList }
|
||||||
|
|
||||||
|
class procedure TGtk2ListBoxPrivateList.SetCallbacks(const AGtkWidget: PGtkWidget; const AWidgetInfo: PWidgetInfo);
|
||||||
|
var
|
||||||
|
Selection: PGtkTreeSelection;
|
||||||
|
begin
|
||||||
|
TGtk2WSBaseScrollingWinControl.SetCallbacks(AGtkWidget, AWidgetInfo);
|
||||||
|
|
||||||
|
Selection := gtk_tree_view_get_selection(PGtkTreeView(AWidgetInfo^.CoreWidget));
|
||||||
|
SignalConnect(PGtkWidget(Selection), 'changed', @Gtk2WS_ListBoxChange, AWidgetInfo);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TGtk2WSBaseScrollingWinControl }
|
{ TGtk2WSBaseScrollingWinControl }
|
||||||
|
|
||||||
function Gtk2WSBaseScrollingWinControl_HValueChanged(AAdjustment: PGTKAdjustment; AInfo: PWidgetInfo): GBoolean; cdecl;
|
function Gtk2WSBaseScrollingWinControl_HValueChanged(AAdjustment: PGTKAdjustment; AInfo: PWidgetInfo): GBoolean; cdecl;
|
||||||
|
@ -313,7 +313,7 @@ end;
|
|||||||
|
|
||||||
function RegisterCustomListBox: Boolean; alias : 'WSRegisterCustomListBox';
|
function RegisterCustomListBox: Boolean; alias : 'WSRegisterCustomListBox';
|
||||||
begin
|
begin
|
||||||
RegisterWSComponent(TCustomListBox, TGtk2WSCustomListBox, TGtk2PrivateList);
|
RegisterWSComponent(TCustomListBox, TGtk2WSCustomListBox, TGtk2ListBoxPrivateList);
|
||||||
// RegisterWSComponent(TListBox, TGtk2WSListBox);
|
// RegisterWSComponent(TListBox, TGtk2WSListBox);
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
@ -222,16 +222,6 @@ type
|
|||||||
class procedure UpdateCursor(AInfo: PWidgetInfo); override;
|
class procedure UpdateCursor(AInfo: PWidgetInfo); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TGtk2PrivateList }
|
|
||||||
{ Private class for gtklists }
|
|
||||||
|
|
||||||
TGtk2PrivateList = class(TGtkPrivateList)
|
|
||||||
private
|
|
||||||
protected
|
|
||||||
public
|
|
||||||
class procedure SetCallbacks(const AGtkWidget: PGtkWidget; const AWidgetInfo: PWidgetInfo); override;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TGtk2PrivateMemo }
|
{ TGtk2PrivateMemo }
|
||||||
{ Private class for gtkmemos }
|
{ Private class for gtkmemos }
|
||||||
|
|
||||||
@ -270,8 +260,6 @@ procedure SetGlobalCursor(Cursor: HCURSOR);
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses Gtk2WSControls;
|
|
||||||
|
|
||||||
{$I Gtk2PrivateWidget.inc}
|
{$I Gtk2PrivateWidget.inc}
|
||||||
{$I Gtk2PrivateList.inc}
|
{$I Gtk2PrivateList.inc}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user