}
}
-ControlRef wxMacFindSubControl( wxTopLevelWindowMac* toplevelWindow, const Point& location , ControlRef superControl , ControlPartCode *outPart )
-{
- if ( superControl )
- {
- UInt16 childrenCount = 0 ;
- ControlHandle sibling ;
- Rect r ;
- OSStatus err = CountSubControls( superControl , &childrenCount ) ;
- if ( err == errControlIsNotEmbedder )
- return NULL ;
-
- wxASSERT_MSG( err == noErr , wxT("Unexpected error when accessing subcontrols") ) ;
-
- for ( UInt16 i = childrenCount ; i >=1 ; --i )
- {
- err = GetIndexedSubControl( superControl , i , & sibling ) ;
- if ( err == errControlIsNotEmbedder )
- return NULL ;
-
- wxASSERT_MSG( err == noErr , wxT("Unexpected error when accessing subcontrols") ) ;
- if ( IsControlVisible( sibling ) )
- {
- UMAGetControlBoundsInWindowCoords( sibling , &r ) ;
- if ( MacPtInRect( location , &r ) )
- {
- ControlHandle child = wxMacFindSubControl( toplevelWindow , location , sibling , outPart ) ;
- if ( child )
- {
- return child ;
- }
- else
- {
- Point testLocation = location ;
-
- if ( toplevelWindow )
- {
- testLocation.h -= r.left ;
- testLocation.v -= r.top ;
- }
-
- *outPart = TestControl( sibling , testLocation ) ;
-
- return sibling ;
- }
- }
- }
- }
- }
-
- return NULL ;
-}
-
-
#define NEW_CAPTURE_HANDLING 1
pascal OSStatus
if (currentMouseWindow->CanAcceptFocus() && wxWindow::FindFocus()!=currentMouseWindow)
currentMouseWindow->SetFocus();
}
-
- // if built-in find control is finding the wrong control (ie static box instead of overlaid
- // button, we cannot let the standard handler do its job, but must handle manually
-
- if ( cEvent.GetKind() == kEventMouseDown )
- {
- if ( currentMouseWindow->MacIsReallyEnabled() )
- {
- EventModifiers modifiers = cEvent.GetParameter<EventModifiers>(kEventParamKeyModifiers, typeUInt32) ;
- Point clickLocation = windowMouseLocation ;
-
- currentMouseWindow->MacRootWindowToWindow( &clickLocation.h , &clickLocation.v ) ;
-
- HandleControlClick( (ControlRef) currentMouseWindow->GetHandle() , clickLocation ,
- modifiers , (ControlActionUPP ) -1 ) ;
-
- if ((currentMouseWindowParent != NULL) &&
- (currentMouseWindowParent->GetChildren().Find(currentMouseWindow) == NULL))
- {
- currentMouseWindow = NULL;
- }
- }
-
- result = noErr ;
- }
}
if ( cEvent.GetKind() == kEventMouseUp && wxApp::s_captureWindow )
wxMacDeferredWindowDeleter::~wxMacDeferredWindowDeleter()
{
- UMADisposeWindow( (WindowRef) m_macWindow ) ;
+ DisposeWindow( (WindowRef) m_macWindow ) ;
}
bool wxTopLevelWindowMac::Create(wxWindow *parent,
DoMacCreateRealWindow( parent, title, pos , size , style , name ) ;
- SetBackgroundColour(wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive)));
+ SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ));
if (GetExtraStyle() & wxFRAME_EX_METAL)
MacSetMetalAppearance(true);
if ( !wxTopLevelWindowBase::SetBackgroundColour(col) && m_hasBgCol )
return false ;
- if ( col == wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) )
+ if ( col == wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) || col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDocumentWindowBackground)) )
+ {
SetThemeWindowBackground( (WindowRef) m_macWindow, kThemeBrushDocumentWindowBackground, false ) ;
- else if ( col == wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) )
+ SetBackgroundStyle(wxBG_STYLE_CUSTOM);
+ }
+ else if ( col == wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) || col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive)) )
+ {
SetThemeWindowBackground( (WindowRef) m_macWindow, kThemeBrushDialogBackgroundActive, false ) ;
- // TODO BETTER THEME SUPPORT
+ SetBackgroundStyle(wxBG_STYLE_CUSTOM);
+ }
return true;
}
SetWindowBounds( (WindowRef) m_macWindow , kWindowStructureRgn , &theBoundsRect ) ;
wxAssociateWinWithMacWindow( (WindowRef) m_macWindow , this ) ;
- UMASetWTitle( (WindowRef) m_macWindow , title , m_font.GetEncoding() ) ;
+ SetWindowTitleWithCFString( (WindowRef) m_macWindow , wxMacCFStringHolder( title , m_font.GetEncoding() ) );
m_peer = new wxMacControl(this , true /*isRootControl*/) ;
// There is a bug in 10.2.X for ::GetRootControl returning the window view instead of
void wxTopLevelWindowMac::SetTitle(const wxString& title)
{
wxWindow::SetLabel( title ) ;
- UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
+ SetWindowTitleWithCFString( (WindowRef) m_macWindow , wxMacCFStringHolder( title , m_font.GetEncoding() ) ) ;
}
wxString wxTopLevelWindowMac::GetTitle() const