mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 09:39:31 +02:00
gtk2: sortindicator implementation
git-svn-id: branches/listviewsortindicator@62519 -
This commit is contained in:
parent
2e704b21cb
commit
b5e9be41f2
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user