// globals
// ----------------------------------------------------------------------------
-// list of all frames and modeless dialogs
-wxWindowList wxModelessWindows;
-
static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param);
// ============================================================================
if (GetExtraStyle() & wxFRAME_EX_METAL)
MacSetMetalAppearance(true);
- wxTopLevelWindows.Append(this);
-
if ( parent )
parent->AddChild(this);
wxRemoveMacWindowAssociation( this ) ;
- if ( wxModelessWindows.Find(this) )
- wxModelessWindows.DeleteObject(this);
-
// avoid dangling refs
if ( s_macDeactivateWindow == this )
s_macDeactivateWindow = NULL;
else if ( col == wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) )
col = wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive));
- if ( !wxWindowBase::SetBackgroundColour(col) && m_hasBgCol )
+ if ( !wxWindow::SetBackgroundColour(col) && m_hasBgCol )
return false ;
if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDocumentWindowBackground)) )
SetThemeWindowBackground( (WindowRef) m_macWindow, kThemeBrushDialogBackgroundActive, false ) ;
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
}
+ else
+ {
+ SetBackgroundStyle(wxBG_STYLE_COLOUR);
+ }
return true;
}
{
// set back to 0 if problems arise
#if 1
- ControlPartCode currentControlPart = cEvent.GetParameter<ControlPartCode>(kEventParamControlPart , typeControlPartCode );
- // synthesize the event focus changed event
- EventRef evRef = NULL ;
-
- OSStatus err = MacCreateEvent(
- NULL , kEventClassControl , kEventControlFocusPartChanged , TicksToEventTime( TickCount() ) ,
- kEventAttributeUserEvent , &evRef );
- verify_noerr( err );
-
- wxMacCarbonEvent iEvent( evRef ) ;
- iEvent.SetParameter<ControlRef>( kEventParamDirectObject , controlRef );
- iEvent.SetParameter<EventTargetRef>( kEventParamPostTarget, typeEventTargetRef, GetControlEventTarget( controlRef ) );
- iEvent.SetParameter<ControlPartCode>( kEventParamControlPreviousPart, typeControlPartCode, previousControlPart );
- iEvent.SetParameter<ControlPartCode>( kEventParamControlCurrentPart, typeControlPartCode, currentControlPart );
-
+ if ( result == noErr )
+ {
+ ControlPartCode currentControlPart = cEvent.GetParameter<ControlPartCode>(kEventParamControlPart , typeControlPartCode );
+ // synthesize the event focus changed event
+ EventRef evRef = NULL ;
+
+ OSStatus err = MacCreateEvent(
+ NULL , kEventClassControl , kEventControlFocusPartChanged , TicksToEventTime( TickCount() ) ,
+ kEventAttributeUserEvent , &evRef );
+ verify_noerr( err );
+
+ wxMacCarbonEvent iEvent( evRef ) ;
+ iEvent.SetParameter<ControlRef>( kEventParamDirectObject , controlRef );
+ iEvent.SetParameter<EventTargetRef>( kEventParamPostTarget, typeEventTargetRef, GetControlEventTarget( controlRef ) );
+ iEvent.SetParameter<ControlPartCode>( kEventParamControlPreviousPart, typeControlPartCode, previousControlPart );
+ iEvent.SetParameter<ControlPartCode>( kEventParamControlCurrentPart, typeControlPartCode, currentControlPart );
+
#if 1
- // TODO test this first, avoid double posts etc...
- PostEventToQueue( GetMainEventQueue(), evRef , kEventPriorityHigh );
+ // TODO test this first, avoid double posts etc...
+ PostEventToQueue( GetMainEventQueue(), evRef , kEventPriorityHigh );
#else
- wxMacWindowControlEventHandler( NULL , evRef , data ) ;
+ wxMacWindowControlEventHandler( NULL , evRef , data ) ;
#endif
- ReleaseEvent( evRef ) ;
+ ReleaseEvent( evRef ) ;
+ }
#else
// old implementation, to be removed if the new one works
if ( controlPart == kControlFocusNoPart )
// as we cannot rely on the control features to find out whether we are in full keyboard mode,
// we can only leave in case of an error
- wxLogTrace(_T("Focus"), _T("before wxWindow::SetFocus(%p)"), wx_static_cast(void*, this));
+ wxLogTrace(_T("Focus"), _T("before wxWindow::SetFocus(%p) %d"), wx_static_cast(void*, this), GetName().c_str());
OSStatus err = m_peer->SetFocus( kControlFocusNextPart ) ;
if ( err == errCouldntSetFocus )
+ {
+ wxLogTrace(_T("Focus"), _T("in wxWindow::SetFocus(%p) errCouldntSetFocus"), wx_static_cast(void*, this));
return ;
+ }
wxLogTrace(_T("Focus"), _T("after wxWindow::SetFocus(%p)"), wx_static_cast(void*, this));
SetUserFocusWindow( (WindowRef)MacGetTopLevelWindowRef() );