sorting of list controls More...
#include <window.h>


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 |
sorting of list controls
Definition at line 950 of file window.h.
| ListSort::ListSort | ( | HWND | hwndListview, |
| PFNLVCOMPARE | compare_fct | ||
| ) |
Definition at line 1269 of file window.cpp.
References _direction, and _sort_crit.
: WindowHandle(hwndListview), _compare_fct(compare_fct) { _sort_crit = 0; _direction = false; }
| static int CALLBACK ListSort::CompareFunc | ( | LPARAM | lparam1, |
| LPARAM | lparam2, | ||
| LPARAM | lparamSort | ||
| ) | [static, protected] |
| void ListSort::sort | ( | ) |
Definition at line 1287 of file window.cpp.
References _compare_fct, WindowHandle::_hwnd, ListView_FindItemPara(), and ListView_GetItemData().
Referenced by FindProgramDlg::Notify().
{
int idx = ListView_GetSelectionMark(_hwnd);
LPARAM param = ListView_GetItemData(_hwnd, idx);
ListView_SortItems(_hwnd, _compare_fct, (LPARAM)this);
if (idx >= 0) {
idx = ListView_FindItemPara(_hwnd, param);
ListView_EnsureVisible(_hwnd, idx, FALSE);
}
}


| void ListSort::toggle_sort | ( | int | idx ) |
Definition at line 1277 of file window.cpp.
References _direction, and _sort_crit.
Referenced by FindProgramDlg::Notify().
{
if (_sort_crit == idx)
_direction = !_direction;
else {
_sort_crit = idx;
_direction = false;
}
}

PFNLVCOMPARE ListSort::_compare_fct [protected] |
| bool ListSort::_direction |
Definition at line 958 of file window.h.
Referenced by FindProgramDlg::CompareFunc(), ListSort(), and toggle_sort().
Definition at line 957 of file window.h.
Referenced by FindProgramDlg::CompareFunc(), ListSort(), and toggle_sort().
|
ROS Explorer Source Code Documentation
generated on 02.01.2013 by
|