BEGIN_EVENT_TABLE(wxControl, wxWindow)
EVT_MOUSE_EVENTS( wxControl::OnMouseEvent )
- EVT_CHAR( wxControl::OnKeyDown )
+// EVT_CHAR( wxControl::OnKeyDown )
EVT_PAINT( wxControl::OnPaint )
END_EVENT_TABLE()
#endif
}
}
+ControlColorUPP wxMacSetupControlBackgroundUPP = NULL ;
+
+pascal OSStatus wxMacSetupControlBackground( ControlRef iControl , SInt16 iMessage , SInt16 iDepth , Boolean iIsColor )
+{
+ OSStatus status = noErr ;
+ switch( iMessage )
+ {
+ case kControlMsgSetUpBackground :
+ {
+ wxControl* wx = (wxControl*) GetControlReference( iControl ) ;
+ if ( wx != NULL && wx->IsKindOf( CLASSINFO( wxControl ) ) )
+ {
+ wxDC::MacSetupBackgroundForCurrentPort( wx->MacGetBackgroundBrush() ) ;
+ // SetThemeBackground( iDepth , iIsColor ) ;
+ }
+ else
+ {
+ status = paramErr ;
+ }
+ }
+ break ;
+ default :
+ status = paramErr ;
+ break ;
+ }
+ return status ;
+}
+
wxControl::wxControl()
{
m_macControl = NULL ;
void wxControl::SetLabel(const wxString& title)
{
- m_label = title ;
+ m_label = wxStripMenuCodes(title) ;
if ( (ControlHandle) m_macControl )
{
wxString label ;
if( wxApp::s_macDefaultEncodingIsPC )
- label = wxMacMakeMacStringFromPC( title ) ;
+ label = wxMacMakeMacStringFromPC( m_label ) ;
else
- label = title ;
+ label = m_label ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) maclabel , label ) ;
{
// no font
}
- else if ( IsKindOf( CLASSINFO( wxStaticBox ) ) || IsKindOf( CLASSINFO( wxRadioBox ) ) || IsKindOf( CLASSINFO( wxButton ) ) )
+ else if ( !UMAHasAquaLayout() && (IsKindOf( CLASSINFO( wxStaticBox ) ) || IsKindOf( CLASSINFO( wxRadioBox ) ) || IsKindOf( CLASSINFO( wxButton ) ) ) )
{
ControlFontStyleRec controlstyle ;
controlstyle.flags = kControlUseFontMask ;
wxAssociateControlWithMacControl( (ControlHandle) m_macControl , this ) ;
+ if ( wxMacSetupControlBackgroundUPP == NULL )
+ {
+ wxMacSetupControlBackgroundUPP = NewControlColorUPP( wxMacSetupControlBackground ) ;
+ }
+ SetControlColorProc( (ControlHandle) m_macControl , wxMacSetupControlBackgroundUPP ) ;
// Adjust the controls size and position
wxPoint pos(m_x, m_y);