ReactOS 0.4.15-dev-7907-g95bf896
ListSort Struct Reference

sorting of list controls More...

#include <window.h>

Inheritance diagram for ListSort:
Collaboration diagram for ListSort:

Public Member Functions

 ListSort (HWND hwndListview, PFNLVCOMPARE compare_fct)
 
void toggle_sort (int idx)
 
void sort ()
 

Public Attributes

int _sort_crit
 
bool _direction
 

Static Protected Member Functions

static int CALLBACK CompareFunc (LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort)
 

Protected Attributes

PFNLVCOMPARE _compare_fct
 

Detailed Description

sorting of list controls

Definition at line 951 of file window.h.

Constructor & Destructor Documentation

◆ ListSort()

ListSort::ListSort ( HWND  hwndListview,
PFNLVCOMPARE  compare_fct 
)

Definition at line 1274 of file window.cpp.

1275 : WindowHandle(hwndListview),
1276 _compare_fct(compare_fct)
1277{
1278 _sort_crit = 0;
1279 _direction = false;
1280}
bool _direction
Definition: window.h:959
PFNLVCOMPARE _compare_fct
Definition: window.h:962
int _sort_crit
Definition: window.h:958

Member Function Documentation

◆ CompareFunc()

static int CALLBACK ListSort::CompareFunc ( LPARAM  lparam1,
LPARAM  lparam2,
LPARAM  lparamSort 
)
staticprotected

◆ sort()

void ListSort::sort ( )

Definition at line 1292 of file window.cpp.

1293{
1294 int idx = ListView_GetSelectionMark(_hwnd);
1296
1297 ListView_SortItems(_hwnd, _compare_fct, (LPARAM)this);
1298
1299 if (idx >= 0) {
1302 }
1303}
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
GLfloat param
Definition: glext.h:5796
int ListView_FindItemPara(HWND list_ctrl, LPARAM param)
Definition: window.h:928
int ListView_GetItemData(HWND list_ctrl, int idx)
Definition: window.h:915
#define ListView_SortItems(hwndLV, _pfnCompare, _lPrm)
Definition: commctrl.h:2703
#define ListView_GetSelectionMark(hwnd)
Definition: commctrl.h:2789
#define ListView_EnsureVisible(hwndLV, i, fPartialOK)
Definition: commctrl.h:2519
LONG_PTR LPARAM
Definition: windef.h:208

Referenced by FindProgramDlg::Notify().

◆ toggle_sort()

void ListSort::toggle_sort ( int  idx)

Definition at line 1282 of file window.cpp.

1283{
1284 if (_sort_crit == idx)
1286 else {
1287 _sort_crit = idx;
1288 _direction = false;
1289 }
1290}

Referenced by FindProgramDlg::Notify().

Member Data Documentation

◆ _compare_fct

PFNLVCOMPARE ListSort::_compare_fct
protected

Definition at line 962 of file window.h.

Referenced by sort().

◆ _direction

bool ListSort::_direction

Definition at line 959 of file window.h.

Referenced by ListSort(), and toggle_sort().

◆ _sort_crit

int ListSort::_sort_crit

Definition at line 958 of file window.h.

Referenced by ListSort(), and toggle_sort().


The documentation for this struct was generated from the following files: