]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datavcmn.cpp
rename wxHeaderCtrl DRAG events into RESIZE ones as we're also going to have column...
[wxWidgets.git] / src / common / datavcmn.cpp
index c0850cbf163c28450a63bf34dfe1197640556394..34e2123b6c3ac89411baf6c2c50c3b341d0ddaa2 100644 (file)
@@ -832,64 +832,18 @@ void wxDataViewEditorCtrlEvtHandler::OnKillFocus( wxFocusEvent &event )
 // wxDataViewColumnBase
 // ---------------------------------------------------------
 
-IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumnBase, wxObject)
-
-wxDataViewColumnBase::wxDataViewColumnBase(const wxString& WXUNUSED(title),
-                                           wxDataViewRenderer *renderer,
-                                           unsigned int model_column,
-                                           int WXUNUSED(width),
-                                           wxAlignment WXUNUSED(align),
-                                           int WXUNUSED(flags))
-{
-    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 WXUNUSED(width),
-                                           wxAlignment WXUNUSED(align),
-                                           int WXUNUSED(flags) )
+void wxDataViewColumnBase::Init(wxDataViewRenderer *renderer,
+                                unsigned int model_column)
 {
     m_renderer = renderer;
     m_model_column = model_column;
-    m_bitmap = bitmap;
     m_owner = NULL;
     m_renderer->SetOwner( (wxDataViewColumn*) this );
 }
 
 wxDataViewColumnBase::~wxDataViewColumnBase()
 {
-    if (m_renderer)
-        delete m_renderer;
-}
-
-int wxDataViewColumnBase::GetFlags() const
-{
-    int ret = 0;
-
-    if (IsSortable())
-        ret |= wxDATAVIEW_COL_SORTABLE;
-    if (IsResizeable())
-        ret |= wxDATAVIEW_COL_RESIZABLE;
-    if (IsHidden())
-        ret |= wxDATAVIEW_COL_HIDDEN;
-
-    return ret;
-}
-
-void wxDataViewColumnBase::SetFlags(int flags)
-{
-    SetSortable((flags & wxDATAVIEW_COL_SORTABLE) != 0);
-    SetResizeable((flags & wxDATAVIEW_COL_RESIZABLE) != 0);
-    SetHidden((flags & wxDATAVIEW_COL_HIDDEN) != 0);
-    SetReorderable((flags & wxDATAVIEW_COL_REORDERABLE) != 0);
+    delete m_renderer;
 }
 
 // ---------------------------------------------------------
@@ -1933,10 +1887,12 @@ void wxDataViewTreeCtrl::OnCollapsed( wxDataViewEvent &event )
 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 );
 }