wxControl* wx = (wxControl*) GetControlReference( control ) ;
if ( wx )
{
- wx->MacHandleControlClick( control , partCode ) ;
+ wx->MacHandleControlClick( control , partCode , true /* stillDown */ ) ;
}
}
}
m_macVerticalBorder = 0 ;
m_backgroundColour = *wxWHITE;
m_foregroundColour = *wxBLACK;
-#if WXWIN_COMPATIBILITY
- m_callback = 0;
-#endif // WXWIN_COMPATIBILITY
if ( wxMacLiveScrollbarActionUPP == NULL )
{
{
m_label = wxStripMenuCodes(title) ;
- if ( (ControlHandle) m_macControl )
+ if ( m_macControl )
{
- Str255 maclabel ;
- wxString label ;
-
- if( wxApp::s_macDefaultEncodingIsPC )
- label = wxMacMakeMacStringFromPC( m_label ) ;
- else
- label = m_label ;
-
-#if TARGET_CARBON
- c2pstrcpy( (StringPtr) maclabel , label ) ;
-#else
- strcpy( (char *) maclabel , label ) ;
- c2pstr( (char *) maclabel ) ;
-#endif
- ::SetControlTitle( (ControlHandle) m_macControl , maclabel ) ;
+ UMASetControlTitle( (ControlHandle) m_macControl , m_label ) ;
}
Refresh() ;
}
bool wxControl::ProcessCommand (wxCommandEvent & event)
{
- // Tries:
- // 1) A callback function (to become obsolete)
- // 2) OnCommand, starting at this window and working up parent hierarchy
- // 3) OnCommand then calls ProcessEvent to search the event tables.
-#if WXWIN_COMPATIBILITY
- if ( m_callback )
- {
- (void)(*m_callback)(this, event);
-
- return TRUE;
- }
- else
-#endif // WXWIN_COMPATIBILITY
- {
- return GetEventHandler()->ProcessEvent(event);
- }
+ // Tries:
+ // 1) OnCommand, starting at this window and working up parent hierarchy
+ // 2) OnCommand then calls ProcessEvent to search the event tables.
+ return GetEventHandler()->ProcessEvent(event);
}
// ------------------------
{
// adding NULL WindowRef is (first) surely a result of an error and
// (secondly) breaks menu command processing
- wxCHECK_RET( inControl != (ControlHandle) NULL, "attempt to add a NULL WindowRef to window list" );
+ wxCHECK_RET( inControl != (ControlHandle) NULL, wxT("attempt to add a NULL WindowRef to window list") );
if ( !wxWinMacControlList->Find((long)inControl) )
wxWinMacControlList->Append((long)inControl, control);
const wxString& name , WXRECTPTR outBounds , unsigned char* maclabel )
{
m_label = label ;
- SetName(name);
- if ( &validator )
- SetValidator(validator);
-
- m_windowStyle = style;
- parent->AddChild(this);
-
- m_backgroundColour = parent->GetBackgroundColour() ;
- m_foregroundColour = parent->GetForegroundColour() ;
-
- if (id == -1)
- m_windowId = NewControlId();
- else
- m_windowId = id;
-
- // These sizes will be adjusted in MacPostControlCreate
+ // These sizes will be adjusted in MacPostControlCreate
m_width = size.x ;
m_height = size.y ;
m_x = pos.x ;
void wxControl::MacPostControlCreate()
{
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
if ( IsKindOf( CLASSINFO( wxScrollBar ) ) )
{
{
ControlFontStyleRec controlstyle ;
controlstyle.flags = kControlUseFontMask ;
- controlstyle.font = kControlFontSmallSystemFont ;
+
+ if (IsKindOf( CLASSINFO( wxButton ) ) )
+ controlstyle.font = kControlFontSmallSystemFont ; // eventually kControlFontBigSystemFont ;
+ else
+ controlstyle.font = kControlFontSmallSystemFont ;
::SetControlFontStyle( (ControlHandle) m_macControl , &controlstyle ) ;
}
SetSize(pos.x, pos.y, new_size.x, new_size.y);
+#if wxUSE_UNICODE
+ UMASetControlTitle( (ControlHandle) m_macControl , wxStripMenuCodes(m_label) ) ;
+#endif
+
UMAShowControl( (ControlHandle) m_macControl ) ;
SetCursor( *wxSTANDARD_CURSOR ) ;
{
controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
wxTheApp->s_lastMouseDown = 0 ;
- if ( control && controlpart != kControlNoPart &&
- ! IsKindOf( CLASSINFO( wxScrollBar ) )
- ) // otherwise we will get the event twice for scrollbar
+ if ( control && controlpart != kControlNoPart )
{
- MacHandleControlClick( control , controlpart ) ;
+ MacHandleControlClick( control , controlpart , false /* mouse not down anymore */ ) ;
}
}
}
return false ;
}
-void wxControl::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
+void wxControl::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) )
{
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
}