diff options
author | David Emerson <demerson3x@angelbase.com> | 2011-01-19 10:04:48 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-01-19 10:04:48 +0200 |
commit | 7797c955e4f2a2474fca65bcfd59e7e80ba68b94 (patch) | |
tree | 82b21b9befa1310f64174fb92764992cb2c735cc /src | |
parent | 5f593bd29a4c43a14f35e2adfc63c788bf3a80d4 (diff) | |
download | fpGUI-7797c955e4f2a2474fca65bcfd59e7e80ba68b94.tar.xz |
A little tweak to allow sorting of ListView
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/fpg_listview.pas | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/fpg_listview.pas b/src/gui/fpg_listview.pas index dc9378b1..c7bdba66 100644 --- a/src/gui/fpg_listview.pas +++ b/src/gui/fpg_listview.pas @@ -149,14 +149,13 @@ type procedure InsertItem(AItem: TfpgLVItem; AIndex: Integer); procedure BeginUpdate; procedure EndUpdate; + procedure Sort(Compare: TListSortCompare); property Capacity: Integer read GetCapacity write SetCapacity; property Columns: TfpgLVColumns read FColumns; property Item[AIndex: Integer]: TfpgLVItem read GetItem write SetItem; end; - { TfpgLVItem } - TfpgLVItem = class(TObject) private FCaption: String; @@ -181,7 +180,6 @@ type property Selected[ListView: TfpgListView]: Boolean read GetSelected write SetSelected; end; - { TfpgListViewSubitems } TfpgListViewSubItems = class(TStrings) private @@ -204,7 +202,6 @@ type procedure Insert(Index: Integer; const S: string); override; property ImageIndex[ASubIndex: Integer]: Integer read GetImageIndex write SetImageIndex; property OnChange: TNotifyEvent read FOnChange write FOnChange; - end; @@ -554,6 +551,13 @@ begin DoEndUpdate; end; +procedure TfpgLVItems.Sort(Compare: TListSortCompare); +begin + BeginUpdate; + FItems.Sort(Compare); + EndUpdate; +end; + { TfpgLVItem } procedure TfpgLVItem.SetCaption(const AValue: String); |