mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 05:59:28 +02:00
win32: implementation of sortindicator
git-svn-id: branches/listviewsortindicator@62517 -
This commit is contained in:
parent
5c82bc971e
commit
78b457b59d
@ -137,6 +137,7 @@ type
|
||||
class procedure ColumnSetMinWidth(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AMinWidth: integer); override;
|
||||
class procedure ColumnSetWidth(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AWidth: Integer); override;
|
||||
class procedure ColumnSetVisible(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AVisible: Boolean); override;
|
||||
class procedure ColumnSetSortIndicator(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AAndicator: TSortIndicator); override;
|
||||
|
||||
// items
|
||||
class procedure ItemDelete(const ALV: TCustomListView; const AIndex: Integer); override;
|
||||
|
@ -484,6 +484,28 @@ begin
|
||||
else ListView_SetColumnWidth(ALV.Handle, AIndex, 0);
|
||||
end;
|
||||
|
||||
class procedure TWin32WSCustomListView.ColumnSetSortIndicator(
|
||||
const ALV: TCustomListView; const AIndex: Integer;
|
||||
const AColumn: TListColumn; const AAndicator: TSortIndicator);
|
||||
var
|
||||
Hdr: HWND;
|
||||
Itm: THDITEM;
|
||||
begin
|
||||
if not WSCheckHandleAllocated(ALV, 'ColumnSetSortIndicator')
|
||||
then Exit;
|
||||
|
||||
Hdr := ListView_GetHeader(ALV.Handle);
|
||||
FillChar(itm, sizeof(itm),0);
|
||||
itm.mask := HDI_FORMAT;
|
||||
Header_GetItem(Hdr, AIndex, Itm);
|
||||
case AAndicator of
|
||||
siNone: itm.fmt := itm.fmt and (not (HDF_SORTDOWN or HDF_SORTUP));
|
||||
siAscending: itm.fmt := (itm.fmt or HDF_SORTUP) and (not HDF_SORTDOWN);
|
||||
siDescending: itm.fmt := (itm.fmt or HDF_SORTDOWN) and (not HDF_SORTUP);
|
||||
end;
|
||||
Header_SetItem(Hdr, AIndex, Itm);
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Item code
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user