X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7185918d695b5a3bb662ac4c71dd943dca9a2afc..e538985edcc645878a1bbeb3dc3e898e9d29ad11:/src/osx/window_osx.cpp diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 1bd647c363..4f99e89bc1 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -195,7 +195,9 @@ wxWindowMac::~wxWindowMac() WXWidget wxWindowMac::GetHandle() const { - return (WXWidget) m_peer->GetWXWidget() ; + if ( m_peer ) + return (WXWidget) m_peer->GetWXWidget() ; + return NULL; } // @@ -335,33 +337,26 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant ) m_peer->SetData(kControlEntireControl, kControlSizeTag, &size ) ; #endif -#if wxOSX_USE_COCOA_OR_CARBON wxFont font ; -#if wxOSX_USE_ATSU_TEXT - ThemeFontID themeFont = kThemeSystemFont ; - - // we will get that from the settings later - // and make this NORMAL later, but first - // we have a few calculations that we must fix + wxOSXSystemFont systemFont = wxOSX_SYSTEM_FONT_NORMAL ; switch ( variant ) { case wxWINDOW_VARIANT_NORMAL : - themeFont = kThemeSystemFont ; + systemFont = wxOSX_SYSTEM_FONT_NORMAL ; break ; case wxWINDOW_VARIANT_SMALL : - themeFont = kThemeSmallSystemFont ; + systemFont = wxOSX_SYSTEM_FONT_SMALL ; break ; case wxWINDOW_VARIANT_MINI : - // not always defined in the headers - themeFont = 109 ; + systemFont = wxOSX_SYSTEM_FONT_MINI ; break ; case wxWINDOW_VARIANT_LARGE : - themeFont = kThemeSystemFont ; + systemFont = wxOSX_SYSTEM_FONT_NORMAL ; break ; default: @@ -369,36 +364,9 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant ) break ; } - font.MacCreateFromThemeFont( themeFont ) ; -#else - CTFontUIFontType themeFont = kCTFontSystemFontType ; - switch ( variant ) - { - case wxWINDOW_VARIANT_NORMAL : - themeFont = kCTFontSystemFontType; - break ; - - case wxWINDOW_VARIANT_SMALL : - themeFont = kCTFontSmallSystemFontType; - break ; - - case wxWINDOW_VARIANT_MINI : - themeFont = kCTFontMiniSystemFontType; - break ; - - case wxWINDOW_VARIANT_LARGE : - themeFont = kCTFontSystemFontType; - break ; - - default: - wxFAIL_MSG(_T("unexpected window variant")); - break ; - } - font.MacCreateFromUIFont( themeFont ) ; -#endif + font.CreateSystemFont( systemFont ) ; SetFont( font ) ; -#endif } void wxWindowMac::MacUpdateControlFont() @@ -782,16 +750,14 @@ void wxWindowMac::MacInvalidateBorders() return ; int outerBorder = MacGetLeftBorderSize() ; -#if wxOSX_USE_CARBON - if ( m_peer->NeedsFocusRect() /* && m_peer->HasFocus() */ ) + + if ( m_peer->NeedsFocusRect() ) outerBorder += 4 ; -#endif if ( outerBorder == 0 ) return ; // now we know that we have something to do at all - int tx,ty,tw,th; @@ -1044,7 +1010,7 @@ void wxWindowMac::SetLabel(const wxString& title) { m_label = title ; - if ( m_peer && m_peer->IsOk() ) + if ( m_peer && m_peer->IsOk() && !(IsKindOf( CLASSINFO(wxButton) ) && GetId() == wxID_HELP) ) m_peer->SetLabel( wxStripMenuCodes(m_label, wxStrip_Mnemonics), GetFont().GetEncoding() ) ; // do not trigger refreshes upon invisible and possible partly created objects @@ -2192,7 +2158,7 @@ Rect wxMacGetBoundsForControl( wxWindowMac* window , const wxPoint& pos , const return bounds ; } -bool wxWindowMac::OSXHandleClicked( double timestampsec ) +bool wxWindowMac::OSXHandleClicked( double WXUNUSED(timestampsec) ) { return false; }