X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e215c9959cfae9db319cbca376553301dfa17cf1..3a492e5c91045ec3a66a6cea73d1fc51ffc3a699:/src/common/datavcmn.cpp diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 5b7205f3d7..47400107e1 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -832,55 +832,13 @@ void wxDataViewEditorCtrlEvtHandler::OnKillFocus( wxFocusEvent &event ) // 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! -#ifndef wxHAS_GENERIC_DATAVIEWCTRL - wxUnusedVar(title); - wxUnusedVar(width); - wxUnusedVar(align); - wxUnusedVar(flags); -#endif // !wxHAS_GENERIC_DATAVIEWCTRL -} - -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; m_owner = NULL; m_renderer->SetOwner( (wxDataViewColumn*) this ); - -#ifndef wxHAS_GENERIC_DATAVIEWCTRL - wxUnusedVar(width); - wxUnusedVar(align); - wxUnusedVar(flags); -#endif // !wxHAS_GENERIC_DATAVIEWCTRL } wxDataViewColumnBase::~wxDataViewColumnBase() @@ -1317,7 +1275,7 @@ bool wxDataViewSpinRenderer::GetValue( wxVariant &value ) const // wxDataViewChoiceRenderer // ------------------------------------- -#ifndef __WXGTK20__ +#if defined(wxHAS_GENERIC_DATAVIEWCTRL) || defined(wxMAC) wxDataViewChoiceRenderer::wxDataViewChoiceRenderer( const wxArrayString& choices, wxDataViewCellMode mode, int alignment ) : wxDataViewCustomRenderer(wxT("string"), mode, alignment ) @@ -1929,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 ); }