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 ;
}
}
- 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 ;
void wxRemoveMacControlAssociation(wxControl *control)
{
- wxWinMacControlList->DeleteObject(control);
+ if ( wxWinMacControlList )
+ wxWinMacControlList->DeleteObject(control);
}
void wxControl::MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label ,
controlstyle.flags = kControlUseFontMask ;
if (IsKindOf( CLASSINFO( wxButton ) ) )
- controlstyle.font = kControlFontSmallSystemFont ; // eventually kControlFontBigSystemFont ;
+ controlstyle.font = kControlFontBigSystemFont ; // eventually kControlFontBigSystemFont ;
else
controlstyle.font = kControlFontSmallSystemFont ;
ControlHandle container = (ControlHandle) GetParent()->MacGetContainerForEmbedding() ;
wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ;
::EmbedControl( (ControlHandle) m_macControl , container ) ;
- m_macControlIsShown = true ;
+ m_macControlIsShown = MacIsReallyShown() ;
wxAssociateControlWithMacControl( (ControlHandle) m_macControl , this ) ;
if ( wxMacSetupControlBackgroundUPP == NULL )
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
- UMAShowControl( (ControlHandle) m_macControl ) ;
+ if ( m_macControlIsShown )
+ UMAShowControl( (ControlHandle) m_macControl ) ;
SetCursor( *wxSTANDARD_CURSOR ) ;
m_height += 2 * m_macVerticalBorder + MacGetTopBorderSize() + MacGetBottomBorderSize() ;
}
- MacUpdateDimensions() ;
-// UMASizeControl( (ControlHandle) m_macControl , m_width - 2 * m_macHorizontalBorder, m_height - 2 * m_macVerticalBorder ) ;
+ MacUpdateDimensions() ;
}
}