Fix column reordering in wxHeaderCtrlSimple and related problems

Override required functions in wxHeaderCtrlSimple to avoid asserts if
its columns are reordered.

Also bring the code behaviour in agreement with the documentation by
calling UpdateColumn() after calling UpdateColumnVisibility().

Finally, only call UpdateColumnsOrder() if the corresponding event was
not processed as the application should use one xor the other mechanism
for reacting to columns reordering, but not both.

Closes #24108.

Closes #24172.
This commit is contained in:
Martin Corino 2023-12-29 10:59:39 +01:00 committed by Vadim Zeitlin
parent 927590fbcd
commit 6ee9056c16
5 changed files with 52 additions and 8 deletions

View file

@ -447,13 +447,15 @@ protected:
/**
Method called when the columns order is changed in the customization
dialog.
dialog @em or when the EVT_HEADER_END_REORDER event is not handled after
dragging a single column.
This method is only called from ShowCustomizeDialog() when the user
changes the order of columns. In particular it is @em not called if a
single column changes place because the user dragged it to the new
location, the EVT_HEADER_END_REORDER event handler should be used to
react to this.
This method is always called from ShowCustomizeDialog() when the user
changes the order of columns. In case a single column changes place
because the user dragged it to a new location, the EVT_HEADER_END_REORDER
event handler can be used to react to this. If this event
handler is not defined though UpdateColumnsOrder() will be called
instead.
A typical implementation in a derived class will update the display
order of the columns in the associated control, if any. Notice that