From 659fb68d746cbbfa69626fd408592757c420da02 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 13 Jan 2008 14:09:47 +0000 Subject: [PATCH 1/1] Improved wxDataViewSpinCtrlRenderer under OS X git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/datavcmn.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index a74d7ae71d..196a0ea5d9 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -1172,8 +1172,21 @@ wxDataViewSpinRenderer::wxDataViewSpinRenderer( int min, int max, wxDataViewCell 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 ) -- 2.45.2