// wxDataViewColumnBase
// ---------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumnBase, wxObject)
-
-wxDataViewColumnBase::wxDataViewColumnBase(const wxString& title,
- wxDataViewRenderer *renderer,
- unsigned int model_column,
- int width,
- wxAlignment align,
- int flags)
-#ifdef wxHAS_GENERIC_DATAVIEWCTRL
- : wxHeaderColumn(title, width, align, flags)
-#endif
-{
- m_renderer = renderer;
- m_model_column = model_column;
- m_owner = NULL;
- m_renderer->SetOwner( (wxDataViewColumn*) this );
-
- // NOTE: the wxDataViewColumn's ctor must store the width, align, flags
- // parameters inside the native control!
-}
-
-wxDataViewColumnBase::wxDataViewColumnBase(const wxBitmap& bitmap,
- wxDataViewRenderer *renderer,
- unsigned int model_column,
- int width,
- wxAlignment align,
- int flags)
-#ifdef wxHAS_GENERIC_DATAVIEWCTRL
- : wxHeaderColumn(bitmap, width, align, flags)
-#else
- : m_bitmap(bitmap)
-#endif
+void wxDataViewColumnBase::Init(wxDataViewRenderer *renderer,
+ unsigned int model_column)
{
m_renderer = renderer;
m_model_column = model_column;
void wxDataViewTreeCtrl::OnSize( wxSizeEvent &event )
{
#if defined(wxUSE_GENERICDATAVIEWCTRL)
- wxSize size = GetClientSize();
- wxDataViewColumn *col = GetColumn( 0 );
- if (col)
- col->SetWidth( size.x );
+ // automatically resize our only column to take the entire control width
+ if ( GetColumnCount() )
+ {
+ wxSize size = GetClientSize();
+ GetColumn(0)->SetWidth(size.x);
+ }
#endif
event.Skip( true );
}