Don't update wxDataViewColumn after it was resized interactively

Previously, the column was updated, i.e. wxHeaderCtrl::UpdateColumn()
was called, after the column width was changed interactively by the
user. This was unnecessary and actually harmful as it resulted in
recursion and display corruption.

Stop doing this by adding yet another width-related function to the
generic wxDataViewColumn called WXOnResize(), which just updates the
main window display, but doesn't update the header at all, and calling
it instead of SetWidth(), which does both, when the column is resized.

Closes #18245.
This commit is contained in:
Vadim Zeitlin
2020-01-19 03:28:13 +01:00
parent 655e29ff1a
commit b02fbafb96
2 changed files with 23 additions and 2 deletions

View File

@@ -150,6 +150,10 @@ public:
UpdateWidth();
}
// This method is also internal and called when the column is resized by
// user interactively.
void WXOnResize(int width);
int WXGetManuallySetWidth() const { return m_manuallySetWidth; }
private:
@@ -331,7 +335,11 @@ public: // utility functions not part of the API
// update the display after a change to an individual column
void OnColumnChange(unsigned int idx);
// update after the column width changes, also calls OnColumnChange()
// update after the column width changes due to interactive resizing
void OnColumnResized();
// update after the column width changes because of e.g. title or bitmap
// change, invalidates the column best width and calls OnColumnChange()
void OnColumnWidthChange(unsigned int idx);
// update after a change to the number of columns