Public Member Functions | Public Attributes | Static Protected Member Functions | Protected Attributes

ListSort Struct Reference

sorting of list controls More...

#include <window.h>

Inheritance diagram for ListSort:
Inheritance graph
[legend]
Collaboration diagram for ListSort:
Collaboration graph
[legend]

List of all members.

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 950 of file window.h.


Constructor & Destructor Documentation

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;
}

Member Function Documentation

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);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

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;
    }
}

Here is the caller graph for this function:


Member Data Documentation

PFNLVCOMPARE ListSort::_compare_fct [protected]

Definition at line 961 of file window.h.

Referenced by sort().

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().


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

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage