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:
Vadim Zeitlin
2021-12-13 14:31:49 +00:00
parent c287840faa
commit 30ce892ed5
4 changed files with 34 additions and 7 deletions

View File

@@ -1428,6 +1428,9 @@ public:
indicator in ascending order, or toggle it in the opposite order. To
sort the list, call SortItems() in EVT_LIST_COL_CLICK.
Note that calling ShowSortIndicator() implicitly enables sort
indicators.
@note In wxMSW, this will disable the header icon of the column.
@param enable
@@ -1448,7 +1451,9 @@ public:
/**
Show the sort indicator of a specific column in a specific direction.
Sort indicators have to be enabled using EnableSortIndicator().
This function also enables showing sort indicators if
EnableSortIndicator() hadn't been called.
@note This does not actually sort the list, use SortItems() for this.