wxControl* wxDataViewSpinRenderer::CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value )
{
long l = value;
- return new wxSpinCtrl( parent, wxID_ANY, wxEmptyString,
- labelRect.GetTopLeft(), labelRect.GetSize(), wxSP_ARROW_KEYS, m_min, m_max, l );
+ wxSize size = labelRect.GetSize();
+#ifdef __WXMAC__
+ size = wxSize( wxMax(70,labelRect.width ), -1 );
+#endif
+ wxString str;
+ str.Printf( wxT("%d\n"), (int) l );
+ wxSpinCtrl *sc = new wxSpinCtrl( parent, wxID_ANY, str,
+ labelRect.GetTopLeft(), size, wxSP_ARROW_KEYS, m_min, m_max, l );
+#ifdef __WXMAC__
+ size = sc->GetSize();
+ wxPoint pt = sc->GetPosition();
+ sc->SetSize( pt.x - 4, pt.y - 4, size.x, size.y );
+#endif
+
+ return sc;
}
bool wxDataViewSpinRenderer::GetValueFromEditorCtrl( wxControl* editor, wxVariant &value )
AssociateModel( store );
store->DecRef();
-#if !defined(__WXGTK20__) || defined(wxUSE_GENERICDATAVIEWCTRL)
- wxDataViewColumn *col = AppendIconTextColumn(wxString(),0,wxDATAVIEW_CELL_INERT,40);
-
- wxSize cient_size = GetClientSize();
- col->SetWidth( size.x );
-#else
- AppendIconTextColumn(wxString(),0,wxDATAVIEW_CELL_INERT,40);
-#endif
+ AppendIconTextColumn(wxString(),0,wxDATAVIEW_CELL_INERT,-1);
}
wxDataViewTreeCtrl::~wxDataViewTreeCtrl()
void wxDataViewTreeCtrl::OnSize( wxSizeEvent &event )
{
-#if !defined(__WXGTK20__) || defined(wxUSE_GENERICDATAVIEWCTRL)
+#if defined(wxUSE_GENERICDATAVIEWCTRL)
wxSize size = GetClientSize();
wxDataViewColumn *col = GetColumn( 0 );
- if (col) col->SetWidth( size.x );
+ if (col)
+ col->SetWidth( size.x );
#endif
event.Skip( true );
}