Let wxListCtrl::ShowSortIndicator() implicitly enable indicators
It doesn't seem right for ShowSortIndicator() to silently do nothing if EnableSortIndicator() hadn't been called before, so make it enable the sort indicators if they hadn't been enabled yet. The alternative would be to assert in this function, but this seems less useful. Also add some comments to wxMSW version.
This commit is contained in:
@@ -426,6 +426,11 @@ protected:
|
||||
int m_colCount; // Windows doesn't have GetColumnCount so must
|
||||
// keep track of inserted/deleted columns
|
||||
|
||||
// m_sortCol and m_sortAsc are used only if m_enableSortCol is true.
|
||||
//
|
||||
// Note that m_sortCol may be set to -1, but this is not the same as
|
||||
// setting m_enableSortCol to false, as the control updates the sort
|
||||
// indicator on column click in the former case, but not in the latter.
|
||||
bool m_enableSortCol;
|
||||
bool m_sortAsc;
|
||||
int m_sortCol;
|
||||
@@ -457,7 +462,8 @@ private:
|
||||
// in-place editor control.
|
||||
void OnCharHook(wxKeyEvent& event);
|
||||
|
||||
// Draw the sort arrow arror in the header.
|
||||
// Draw the sort arrow in the header. Should only be called when sort
|
||||
// indicators are enabled.
|
||||
void DrawSortArrow();
|
||||
|
||||
// Object using for header custom drawing if necessary, may be NULL.
|
||||
|
||||
Reference in New Issue
Block a user