X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/de923e4f508d751267da1b730e7b8c4fc1f4793c..407f0db0504c39e022c063d64c03e2ff2117d5b3:/src/mac/control.cpp?ds=sidebyside diff --git a/src/mac/control.cpp b/src/mac/control.cpp index 31e38de31a..ae57f23ab0 100644 --- a/src/mac/control.cpp +++ b/src/mac/control.cpp @@ -207,13 +207,16 @@ void wxControl::SetLabel(const wxString& title) if ( m_macControl ) { - UMASetControlTitle( (ControlHandle) m_macControl , m_label ) ; + UMASetControlTitle( (ControlHandle) m_macControl , m_label , m_font.GetEncoding() ) ; } Refresh() ; } wxSize wxControl::DoGetBestSize() const { + if ( (ControlHandle) m_macControl == NULL ) + return wxWindow::DoGetBestSize() ; + Rect bestsize = { 0 , 0 , 0 , 0 } ; short baselineoffset ; int bestWidth, bestHeight ; @@ -235,18 +238,7 @@ wxSize wxControl::DoGetBestSize() const } } - if ( IsKindOf( CLASSINFO( wxButton ) ) ) - { - bestWidth = m_label.Length() * 8 + 12 ; - if ( bestWidth < 70 ) - bestWidth = 70 ; - } - else if ( IsKindOf( CLASSINFO( wxStaticText ) ) ) - { - bestWidth = m_label.Length() * 8 ; - } - else - bestWidth = bestsize.right - bestsize.left ; + bestWidth = bestsize.right - bestsize.left ; bestWidth += 2 * m_macHorizontalBorder ; @@ -338,7 +330,7 @@ void wxControl::MacPostControlCreate() controlstyle.flags = kControlUseFontMask ; if (IsKindOf( CLASSINFO( wxButton ) ) ) - controlstyle.font = kControlFontSmallSystemFont ; // eventually kControlFontBigSystemFont ; + controlstyle.font = kControlFontBigSystemFont ; // eventually kControlFontBigSystemFont ; else controlstyle.font = kControlFontSmallSystemFont ; @@ -400,7 +392,7 @@ void wxControl::MacPostControlCreate() SetSize(pos.x, pos.y, new_size.x, new_size.y); #if wxUSE_UNICODE - UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) ) ; + UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) , m_font.GetEncoding() ) ; #endif if ( m_macControlIsShown ) @@ -441,7 +433,7 @@ void wxControl::MacAdjustControlRect() { if ( IsKindOf( CLASSINFO( wxButton ) ) ) { - m_width = m_label.Length() * 8 + 12 ; + m_width = m_label.Length() * 10 + 12 ; if ( m_width < 70 ) m_width = 70 ; } @@ -462,8 +454,7 @@ void wxControl::MacAdjustControlRect() m_height += 2 * m_macVerticalBorder + MacGetTopBorderSize() + MacGetBottomBorderSize() ; } - MacUpdateDimensions() ; -// UMASizeControl( (ControlHandle) m_macControl , m_width - 2 * m_macHorizontalBorder, m_height - 2 * m_macVerticalBorder ) ; + MacUpdateDimensions() ; } }