mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 16:59:20 +02:00
lcl: adding sortIndicator to the listview
git-svn-id: branches/listviewsortindicator@62516 -
This commit is contained in:
parent
2ce8ea42d4
commit
5c82bc971e
@ -1187,6 +1187,8 @@ type
|
|||||||
|
|
||||||
TWidth = 0..MaxInt;
|
TWidth = 0..MaxInt;
|
||||||
|
|
||||||
|
TSortIndicator = (siNone, siAscending, siDescending);
|
||||||
|
|
||||||
TListColumn = class(TCollectionItem)
|
TListColumn = class(TCollectionItem)
|
||||||
private
|
private
|
||||||
FAlignment: TAlignment;
|
FAlignment: TAlignment;
|
||||||
@ -1198,6 +1200,7 @@ type
|
|||||||
FWidth: TWidth;
|
FWidth: TWidth;
|
||||||
FImageIndex: TImageIndex;
|
FImageIndex: TImageIndex;
|
||||||
FTag: PtrInt;
|
FTag: PtrInt;
|
||||||
|
FSortIndicator: TSortIndicator;
|
||||||
function GetWidth: TWidth;
|
function GetWidth: TWidth;
|
||||||
procedure WSCreateColumn;
|
procedure WSCreateColumn;
|
||||||
procedure WSDestroyColumn;
|
procedure WSDestroyColumn;
|
||||||
@ -1211,6 +1214,7 @@ type
|
|||||||
procedure SetCaption(const AValue: TTranslateString);
|
procedure SetCaption(const AValue: TTranslateString);
|
||||||
procedure SetAlignment(const AValue: TAlignment);
|
procedure SetAlignment(const AValue: TAlignment);
|
||||||
procedure SetImageIndex(const AValue: TImageIndex);
|
procedure SetImageIndex(const AValue: TImageIndex);
|
||||||
|
procedure SetSortIndicator(AValue: TSortIndicator);
|
||||||
protected
|
protected
|
||||||
procedure SetIndex(AValue: Integer); override;
|
procedure SetIndex(AValue: Integer); override;
|
||||||
function GetDisplayName: string; override;
|
function GetDisplayName: string; override;
|
||||||
@ -1230,6 +1234,7 @@ type
|
|||||||
property Tag: PtrInt read FTag write FTag default 0;
|
property Tag: PtrInt read FTag write FTag default 0;
|
||||||
property Visible: Boolean read FVisible write SetVisible default true;
|
property Visible: Boolean read FVisible write SetVisible default true;
|
||||||
property Width: TWidth read GetWidth write SetWidth default 50;
|
property Width: TWidth read GetWidth write SetWidth default 50;
|
||||||
|
property SortIndicator: TSortIndicator read FSortIndicator write SetSortIndicator default siNone;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,6 +95,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
WSC.ColumnSetImage(LV, Index, Self, FImageIndex);
|
WSC.ColumnSetImage(LV, Index, Self, FImageIndex);
|
||||||
WSC.ColumnSetVisible(LV, Index, Self, FVisible);
|
WSC.ColumnSetVisible(LV, Index, Self, FVisible);
|
||||||
|
if FSortIndicator<>siNone then
|
||||||
|
WSC.ColumnSetSortIndicator(LV, Index, Self, FSortIndicator);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TListColumn.WSDestroyColumn;
|
procedure TListColumn.WSDestroyColumn;
|
||||||
@ -139,6 +141,19 @@ begin
|
|||||||
Result := FWidth;
|
Result := FWidth;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TListColumn.SetSortIndicator(AValue: TSortIndicator);
|
||||||
|
var
|
||||||
|
LV: TCustomListView;
|
||||||
|
begin
|
||||||
|
if FSortIndicator = AValue then Exit;
|
||||||
|
FSortIndicator := AValue;
|
||||||
|
Changed(False);
|
||||||
|
if not WSUpdateAllowed then Exit;
|
||||||
|
|
||||||
|
LV := TListColumns(Collection).FOwner;
|
||||||
|
TWSCustomListViewClass(LV.WidgetSetClass).ColumnSetSortIndicator(LV, Index, Self, FSortIndicator);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TListColumn.SetAlignment(const AValue: TAlignment);
|
procedure TListColumn.SetAlignment(const AValue: TAlignment);
|
||||||
var
|
var
|
||||||
LV: TCustomListView;
|
LV: TCustomListView;
|
||||||
|
@ -120,6 +120,7 @@ type
|
|||||||
class procedure ColumnSetMinWidth(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AMinWidth: integer); virtual;
|
class procedure ColumnSetMinWidth(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AMinWidth: integer); virtual;
|
||||||
class procedure ColumnSetWidth(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AWidth: Integer); virtual;
|
class procedure ColumnSetWidth(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AWidth: Integer); virtual;
|
||||||
class procedure ColumnSetVisible(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AVisible: Boolean); virtual;
|
class procedure ColumnSetVisible(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AVisible: Boolean); virtual;
|
||||||
|
class procedure ColumnSetSortIndicator(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const ASortIndicator: TSortIndicator); virtual;
|
||||||
|
|
||||||
// Item
|
// Item
|
||||||
class procedure ItemDelete(const ALV: TCustomListView; const AIndex: Integer); virtual;
|
class procedure ItemDelete(const ALV: TCustomListView; const AIndex: Integer); virtual;
|
||||||
@ -539,6 +540,13 @@ class procedure TWSCustomListView.ColumnSetVisible(const ALV: TCustomListView;
|
|||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class procedure TWSCustomListView.ColumnSetSortIndicator(
|
||||||
|
const ALV: TCustomListView; const AIndex: Integer;
|
||||||
|
const AColumn: TListColumn; const ASortIndicator: TSortIndicator);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
class procedure TWSCustomListView.ItemDelete(const ALV: TCustomListView;
|
class procedure TWSCustomListView.ItemDelete(const ALV: TCustomListView;
|
||||||
const AIndex: Integer);
|
const AIndex: Integer);
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user