Generic wxDataViewCtrl: resize autosized columns at idle time.

This is much more efficient than doing it immediately when adding large
number of items into a control with lots of them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68964 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2011-08-31 09:04:41 +00:00
parent 685a9fa61d
commit bed74e488f
2 changed files with 41 additions and 16 deletions

View File

@@ -220,17 +220,23 @@ public: // utility functions not part of the API
// return the column displayed at the given position in the control
wxDataViewColumn *GetColumnAt(unsigned int pos) const;
virtual void OnInternalIdle();
private:
virtual wxDataViewItem DoGetCurrentItem() const;
virtual void DoSetCurrentItem(const wxDataViewItem& item);
void UpdateColBestWidths();
void UpdateColBestWidth(int idx);
void InvalidateColBestWidths();
void InvalidateColBestWidth(int idx);
void UpdateColWidths();
wxDataViewColumnList m_cols;
// cached column best widths or 0 if not computed, values are for
// respective columns from m_cols and the arrays have same size
wxVector<int> m_colsBestWidths;
// m_colsBestWidths partially invalid, needs recomputing
bool m_colsDirty;
wxDataViewModelNotifier *m_notifier;
wxDataViewMainWindow *m_clientArea;
wxDataViewHeaderWindow *m_headerArea;