diff --git a/lcl/interfaces/gtk2/gtk2wscomctrls.pp b/lcl/interfaces/gtk2/gtk2wscomctrls.pp index e48d88f4f4..1c48969128 100644 --- a/lcl/interfaces/gtk2/gtk2wscomctrls.pp +++ b/lcl/interfaces/gtk2/gtk2wscomctrls.pp @@ -153,6 +153,9 @@ type class procedure ColumnSetMinWidth(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AMinWidth: integer); override; class procedure ColumnSetWidth(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AWidth: Integer); override; class procedure ColumnSetVisible(const ALV: TCustomListView; const AIndex: Integer; const {%H-}AColumn: TListColumn; const AVisible: Boolean); override; + class procedure ColumnSetSortIndicator(const ALV: TCustomListView; const AIndex: Integer; + const AColumn: TListColumn; const ASortIndicator: TSortIndicator); + override; // items class procedure ItemDelete(const ALV: TCustomListView; const AIndex: Integer); override; diff --git a/lcl/interfaces/gtk2/gtk2wscontrols.pp b/lcl/interfaces/gtk2/gtk2wscontrols.pp index 483361daeb..2108123967 100644 --- a/lcl/interfaces/gtk2/gtk2wscontrols.pp +++ b/lcl/interfaces/gtk2/gtk2wscontrols.pp @@ -506,12 +506,12 @@ var pFixed: PGTKWidget; begin AParent := TWinControl(AControl).Parent; - // DebugLn('LM_AddChild: ',dbgsName(AControl),' ',dbgs(AParent<>nil)); + DebugLn('LM_AddChild: ',dbgsName(AControl),' ',dbgs(AParent<>nil)); if not Assigned(AParent) then Assert(true, Format('Trace: [TGtkWSWinControl.AddControl] %s --> Parent is not assigned', [AControl.ClassName])) else begin - // DebugLn(Format('Trace: [TGtkWSWinControl.AddControl] %s --> Calling Add Child: %s', [AParent.ClassName, AControl.ClassName])); + DebugLn(Format('Trace: [TGtkWSWinControl.AddControl] %s --> Calling Add Child: %s', [AParent.ClassName, AControl.ClassName])); ParentWidget := {%H-}PGtkwidget(AParent.Handle); pFixed := GetFixedWidget(ParentWidget); diff --git a/lcl/interfaces/gtk2/gtk2wscustomlistview.inc b/lcl/interfaces/gtk2/gtk2wscustomlistview.inc index c30cadc920..4cd9bfa637 100644 --- a/lcl/interfaces/gtk2/gtk2wscustomlistview.inc +++ b/lcl/interfaces/gtk2/gtk2wscustomlistview.inc @@ -1083,6 +1083,36 @@ begin end; end; +class procedure TGtk2WSCustomListView.ColumnSetSortIndicator( + const ALV: TCustomListView; const AIndex: Integer; + const AColumn: TListColumn; const ASortIndicator: TSortIndicator); +const + GtkOrder : array [ TSortIndicator] of TGtkSortType = (0, GTK_SORT_ASCENDING, GTK_SORT_DESCENDING); +var + Widgets: PTVWidgets; + GtkColumn: PGtkTreeViewColumn; +begin + if not WSCheckHandleAllocated(ALV, 'ColumnSetCaption') + then Exit; + + GetCommonTreeViewWidgets({%H-}PGtkWidget(ALV.Handle), Widgets); + + if not GTK_IS_TREE_VIEW(Widgets^.MainView) then + Exit; + + GtkColumn := gtk_tree_view_get_column(PGtkTreeView(Widgets^.MainView), AIndex); + if GtkColumn <> nil then + begin + if ASortIndicator = siNone then + gtk_tree_view_column_set_sort_indicator(GtkColumn, false) + else + begin + gtk_tree_view_column_set_sort_indicator(GtkColumn, true); + gtk_tree_view_column_set_sort_order(GtkColumn, GtkOrder[ASortIndicator]); + end; + end; +end; + class procedure TGtk2WSCustomListView.ItemDelete(const ALV: TCustomListView; const AIndex: Integer); var