added wxHeaderCtrl::OnColumnCountChanging()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57255 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-11 17:15:43 +00:00
parent f915d44b3f
commit 4635abaca6
3 changed files with 25 additions and 1 deletions

View File

@@ -70,7 +70,7 @@ public:
// set the number of columns in the control
//
// this also calls UpdateColumn() for all columns
void SetColumnCount(unsigned int count) { DoSetCount(count); }
void SetColumnCount(unsigned int count);
// return the number of columns in the control as set by SetColumnCount()
unsigned int GetColumnCount() const { return DoGetCount(); }
@@ -124,6 +124,11 @@ protected:
return false;
}
// this method can be overridden in the derived classes to do something
// (e.g. update/resize some internal data structures) before the number of
// columns in the control changes
virtual void OnColumnCountChanging(unsigned int WXUNUSED(count)) { }
private:
// methods implementing our public API and defined in platform-specific
// implementations

View File

@@ -337,6 +337,18 @@ protected:
meaning that the control didn't reach to the separator double click.
*/
virtual bool UpdateColumnWidthToFit(unsigned int idx, int widthTitle);
/**
Can be overridden in the derived class to update internal data
structures when the number of the columns in the control changes.
This method is called by SetColumnCount() before effectively changing
the number of columns.
The base class version does nothing but it is good practice to still
call it from the overridden version in the derived class.
*/
virtual void OnColumnCountChanging(unsigned int count);
};

View File

@@ -64,6 +64,13 @@ void wxHeaderCtrlBase::ScrollWindow(int dx,
DoScrollHorz(dx);
}
void wxHeaderCtrlBase::SetColumnCount(unsigned int count)
{
OnColumnCountChanging(count);
DoSetCount(count);
}
// ----------------------------------------------------------------------------
// wxHeaderCtrlBase event handling
// ----------------------------------------------------------------------------