wxRibbonAUIArtProvider::wxRibbonAUIArtProvider() : wxRibbonMSWArtProvider(false) { #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON wxColor base_colour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground)); #else wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); #endif SetColourScheme(base_colour, wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT), wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT)); m_tab_active_label_font = m_tab_label_font; m_tab_active_label_font.SetWeight(wxFONTWEIGHT_BOLD); m_page_border_left = 1; m_page_border_right = 1; m_page_border_top = 1; m_page_border_bottom = 2; m_tab_separation_size = 0; m_gallery_bitmap_padding_left_size = 3; m_gallery_bitmap_padding_right_size = 3; m_gallery_bitmap_padding_top_size = 3; m_gallery_bitmap_padding_bottom_size = 3; }
bool wxDrawerWindow::Create(wxWindow *parent, wxWindowID id, const wxString& WXUNUSED(title), wxSize size, wxDirection edge, const wxString& name) { wxASSERT_MSG(NULL != parent, wxT("wxDrawerWindows must be attached to a parent window.")); // Constrain the drawer size to the parent window. const wxSize parentSize(parent->GetClientSize()); if (wxLEFT == edge || wxRIGHT == edge) { if (size.GetHeight() > parentSize.GetHeight()) size.SetHeight(parentSize.GetHeight() - (kLeadingOffset + kTrailingOffset)); } else { if (size.GetWidth() > parentSize.GetWidth()) size.SetWidth(parentSize.GetWidth() - (kLeadingOffset + kTrailingOffset)); } // Create the drawer window. const wxPoint pos(0, 0); const wxSize dummySize(0,0); const long style = wxFRAME_DRAWER; bool success = wxNonOwnedWindow::Create(parent, id, pos, size, style, name); if (success) { // this->MacCreateRealWindow(pos, size, style, name); success = (GetWXWindow() != NULL); } if (success) { // Use drawer brush. SetBackgroundColour( wxColour( wxMacCreateCGColorFromHITheme( kThemeBrushDrawerBackground ) ) ); ::SetThemeWindowBackground((WindowRef)GetWXWindow(), kThemeBrushDrawerBackground, false); // Leading and trailing offset are gaps from parent window edges // to where the drawer starts. ::SetDrawerOffsets((WindowRef)GetWXWindow() , kLeadingOffset, kTrailingOffset); // Set the drawers parent. // Is there a better way to get the parent's WindowRef? wxTopLevelWindow* tlwParent = wxDynamicCast(parent, wxTopLevelWindow); if (NULL != tlwParent) { OSStatus status = ::SetDrawerParent((WindowRef) GetWXWindow(), (WindowRef)tlwParent->GetWXWindow()); success = (noErr == status); } else success = false; } return success && SetPreferredEdge(edge); }
wxAuiGenericTabArt::wxAuiGenericTabArt() { m_normalFont = *wxNORMAL_FONT; m_selectedFont = *wxNORMAL_FONT; m_selectedFont.SetWeight(wxFONTWEIGHT_BOLD); m_measuringFont = m_selectedFont; m_fixedTabWidth = 100; m_tabCtrlHeight = 0; #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON wxColor baseColour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground)); #else wxColor baseColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); #endif // the baseColour is too pale to use as our base colour, // so darken it a bit -- if ((255-baseColour.Red()) + (255-baseColour.Green()) + (255-baseColour.Blue()) < 60) { baseColour = baseColour.ChangeLightness(92); } m_activeColour = baseColour; m_baseColour = baseColour; wxColor borderColour = baseColour.ChangeLightness(75); m_borderPen = wxPen(borderColour); m_baseColourPen = wxPen(m_baseColour); m_baseColourBrush = wxBrush(m_baseColour); m_activeCloseBmp = wxAuiBitmapFromBits(close_bits, 16, 16, *wxBLACK); m_disabledCloseBmp = wxAuiBitmapFromBits(close_bits, 16, 16, wxColour(128,128,128)); m_activeLeftBmp = wxAuiBitmapFromBits(left_bits, 16, 16, *wxBLACK); m_disabledLeftBmp = wxAuiBitmapFromBits(left_bits, 16, 16, wxColour(128,128,128)); m_activeRightBmp = wxAuiBitmapFromBits(right_bits, 16, 16, *wxBLACK); m_disabledRightBmp = wxAuiBitmapFromBits(right_bits, 16, 16, wxColour(128,128,128)); m_activeWindowListBmp = wxAuiBitmapFromBits(list_bits, 16, 16, *wxBLACK); m_disabledWindowListBmp = wxAuiBitmapFromBits(list_bits, 16, 16, wxColour(128,128,128)); m_flags = 0; }
wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) { wxColour resultColor; #if wxOSX_USE_COCOA_OR_CARBON ThemeBrush colorBrushID; #endif switch ( index ) { case wxSYS_COLOUR_WINDOW: #if wxOSX_USE_COCOA_OR_CARBON resultColor = wxColour(wxMacCreateCGColorFromHITheme( 15 /* kThemeBrushDocumentWindowBackground */ )) ; #else resultColor = *wxWHITE; #endif break ; case wxSYS_COLOUR_SCROLLBAR : case wxSYS_COLOUR_BACKGROUND: case wxSYS_COLOUR_ACTIVECAPTION: case wxSYS_COLOUR_INACTIVECAPTION: case wxSYS_COLOUR_MENU: case wxSYS_COLOUR_WINDOWFRAME: case wxSYS_COLOUR_ACTIVEBORDER: case wxSYS_COLOUR_INACTIVEBORDER: case wxSYS_COLOUR_BTNFACE: case wxSYS_COLOUR_MENUBAR: #if wxOSX_USE_COCOA_OR_CARBON resultColor = wxColour(wxMacCreateCGColorFromHITheme( 3 /* kThemeBrushDialogBackgroundActive */)); #else resultColor = wxColour( 0xBE, 0xBE, 0xBE ) ; #endif break ; case wxSYS_COLOUR_LISTBOX : resultColor = *wxWHITE ; break ; case wxSYS_COLOUR_BTNSHADOW: resultColor = wxColour( 0xBE, 0xBE, 0xBE ); break ; case wxSYS_COLOUR_BTNTEXT: case wxSYS_COLOUR_MENUTEXT: case wxSYS_COLOUR_WINDOWTEXT: case wxSYS_COLOUR_CAPTIONTEXT: case wxSYS_COLOUR_INFOTEXT: case wxSYS_COLOUR_INACTIVECAPTIONTEXT: case wxSYS_COLOUR_LISTBOXTEXT: resultColor = *wxBLACK; break ; case wxSYS_COLOUR_HIGHLIGHT: { #if wxOSX_USE_COCOA_OR_CARBON #if 0 // NB: enable this case as desired colorBrushID = kThemeBrushAlternatePrimaryHighlightColor; #else colorBrushID = -3 /* kThemeBrushPrimaryHighlightColor */; #endif resultColor = wxColour( wxMacCreateCGColorFromHITheme(colorBrushID) ); #else resultColor = wxColor( 0xCC, 0xCC, 0xFF ); #endif } break ; case wxSYS_COLOUR_BTNHIGHLIGHT: case wxSYS_COLOUR_GRAYTEXT: resultColor = wxColor( 0xCC, 0xCC, 0xCC ); break ; case wxSYS_COLOUR_3DDKSHADOW: resultColor = wxColor( 0x44, 0x44, 0x44 ); break ; case wxSYS_COLOUR_3DLIGHT: resultColor = wxColor( 0xCC, 0xCC, 0xCC ); break ; case wxSYS_COLOUR_HIGHLIGHTTEXT : case wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT : #if wxOSX_USE_COCOA_OR_CARBON { wxColour highlightcolor( wxMacCreateCGColorFromHITheme(-3 /* kThemeBrushPrimaryHighlightColor */) ); if ((highlightcolor.Red() + highlightcolor.Green() + highlightcolor.Blue() ) == 0) resultColor = *wxWHITE ; else resultColor = *wxBLACK ; } #else resultColor = *wxWHITE ; #endif break ; case wxSYS_COLOUR_INFOBK : // we don't have a way to detect tooltip color, so use the // standard value used at least on 10.4: resultColor = wxColour( 0xFF, 0xFF, 0xD3 ) ; break ; case wxSYS_COLOUR_APPWORKSPACE: resultColor = wxColor( 0x80, 0x80, 0x80 ); ; break ; case wxSYS_COLOUR_HOTLIGHT: case wxSYS_COLOUR_GRADIENTACTIVECAPTION: case wxSYS_COLOUR_GRADIENTINACTIVECAPTION: case wxSYS_COLOUR_MENUHILIGHT: // TODO: resultColor = *wxBLACK; break ; // case wxSYS_COLOUR_MAX: default: resultColor = *wxWHITE; // wxCHECK_MSG( index >= wxSYS_COLOUR_MAX, false, wxT("unknown system colour index") ); break ; } //wxASSERT(resultColor.IsOk()); return resultColor; }
wxAuiDefaultDockArt::wxAuiDefaultDockArt() { #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON wxColor baseColour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground)); #else wxColor baseColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); #endif // the baseColour is too pale to use as our base colour, // so darken it a bit -- if ((255-baseColour.Red()) + (255-baseColour.Green()) + (255-baseColour.Blue()) < 60) { baseColour = baseColour.ChangeLightness(92); } m_baseColour = baseColour; wxColor darker1Colour = baseColour.ChangeLightness(85); wxColor darker2Colour = baseColour.ChangeLightness(75); wxColor darker3Colour = baseColour.ChangeLightness(60); //wxColor darker4Colour = baseColour.ChangeLightness(50); wxColor darker5Colour = baseColour.ChangeLightness(40); m_activeCaptionColour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); m_activeCaptionGradientColour = wxAuiLightContrastColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); m_activeCaptionTextColour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); m_inactiveCaptionColour = darker1Colour; m_inactiveCaptionGradientColour = baseColour.ChangeLightness(97); m_inactiveCaptionTextColour = *wxBLACK; m_sashBrush = wxBrush(baseColour); m_backgroundBrush = wxBrush(baseColour); m_gripperBrush = wxBrush(baseColour); m_borderPen = wxPen(darker2Colour); m_gripperPen1 = wxPen(darker5Colour); m_gripperPen2 = wxPen(darker3Colour); m_gripperPen3 = *wxWHITE_PEN; #ifdef __WXMAC__ m_captionFont = *wxSMALL_FONT; #else m_captionFont = wxFont(8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); #endif // default metric values #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON SInt32 height; GetThemeMetric( kThemeMetricSmallPaneSplitterHeight , &height ); m_sashSize = height; #elif defined(__WXGTK__) m_sashSize = wxRendererNative::Get().GetSplitterParams(NULL).widthSash; #else m_sashSize = 4; #endif m_captionSize = 17; m_borderSize = 1; m_buttonSize = 14; m_gripperSize = 9; m_gradientType = wxAUI_GRADIENT_VERTICAL; InitBitmaps(); }
wxAuiDefaultDockArt::wxAuiDefaultDockArt() { #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON wxColor base_colour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground)); #else wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); #endif // the base_colour is too pale to use as our base colour, // so darken it a bit -- if ((255-base_colour.Red()) + (255-base_colour.Green()) + (255-base_colour.Blue()) < 60) { base_colour = wxAuiStepColour(base_colour, 92); } m_base_colour = base_colour; wxColor darker1_colour = wxAuiStepColour(base_colour, 85); wxColor darker2_colour = wxAuiStepColour(base_colour, 75); wxColor darker3_colour = wxAuiStepColour(base_colour, 60); //wxColor darker4_colour = wxAuiStepColour(base_colour, 50); wxColor darker5_colour = wxAuiStepColour(base_colour, 40); m_active_caption_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); m_active_caption_gradient_colour = wxAuiLightContrastColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); m_active_caption_text_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); m_inactive_caption_colour = darker1_colour; m_inactive_caption_gradient_colour = wxAuiStepColour(base_colour, 97); m_inactive_caption_text_colour = *wxBLACK; m_sash_brush = wxBrush(base_colour); m_background_brush = wxBrush(base_colour); m_gripper_brush = wxBrush(base_colour); m_border_pen = wxPen(darker2_colour); m_gripper_pen1 = wxPen(darker5_colour); m_gripper_pen2 = wxPen(darker3_colour); m_gripper_pen3 = *wxWHITE_PEN; #ifdef __WXMAC__ m_caption_font = *wxSMALL_FONT; #else m_caption_font = wxFont(8, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE); #endif // some built in bitmaps #if defined( __WXMAC__ ) static const unsigned char close_bits[]={ 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0x03, 0xF8, 0x01, 0xF0, 0x19, 0xF3, 0xB8, 0xE3, 0xF0, 0xE1, 0xE0, 0xE0, 0xF0, 0xE1, 0xB8, 0xE3, 0x19, 0xF3, 0x01, 0xF0, 0x03, 0xF8, 0x0F, 0xFE, 0xFF, 0xFF }; #elif defined(__WXGTK__) static const unsigned char close_bits[]={ 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xfb, 0xef, 0xdb, 0xed, 0x8b, 0xe8, 0x1b, 0xec, 0x3b, 0xee, 0x1b, 0xec, 0x8b, 0xe8, 0xdb, 0xed, 0xfb, 0xef, 0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; #else static const unsigned char close_bits[]={ // reduced height, symmetric 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xf3, 0x9f, 0xf9, 0x3f, 0xfc, 0x7f, 0xfe, 0x3f, 0xfc, 0x9f, 0xf9, 0xcf, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; /* // same height as maximize/restore 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xe7, 0xcf, 0xf3, 0x9f, 0xf9, 0x3f, 0xfc, 0x7f, 0xfe, 0x3f, 0xfc, 0x9f, 0xf9, 0xcf, 0xf3, 0xe7, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; */ #endif static const unsigned char maximize_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xf7, 0xf7, 0x07, 0xf0, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; static const unsigned char restore_bits[]={ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0x1f, 0xf0, 0xdf, 0xf7, 0x07, 0xf4, 0x07, 0xf4, 0xf7, 0xf5, 0xf7, 0xf1, 0xf7, 0xfd, 0xf7, 0xfd, 0x07, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; static const unsigned char pin_bits[]={ 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfc,0xdf,0xfc,0xdf,0xfc, 0xdf,0xfc,0xdf,0xfc,0xdf,0xfc,0x0f,0xf8,0x7f,0xff,0x7f,0xff, 0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; #ifdef __WXMAC__ m_inactive_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, *wxWHITE); m_active_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, *wxWHITE ); #else m_inactive_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, m_inactive_caption_text_colour); m_active_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, m_active_caption_text_colour); #endif #ifdef __WXMAC__ m_inactive_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, *wxWHITE); m_active_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, *wxWHITE ); #else m_inactive_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, m_inactive_caption_text_colour); m_active_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, m_active_caption_text_colour); #endif #ifdef __WXMAC__ m_inactive_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, *wxWHITE); m_active_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, *wxWHITE ); #else m_inactive_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, m_inactive_caption_text_colour); m_active_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, m_active_caption_text_colour); #endif m_inactive_pin_bitmap = wxAuiBitmapFromBits(pin_bits, 16, 16, m_inactive_caption_text_colour); m_active_pin_bitmap = wxAuiBitmapFromBits(pin_bits, 16, 16, m_active_caption_text_colour); // default metric values #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON SInt32 height; GetThemeMetric( kThemeMetricSmallPaneSplitterHeight , &height ); m_sash_size = height; #elif defined(__WXGTK__) m_sash_size = wxRendererNative::Get().GetSplitterParams(NULL).widthSash; #else m_sash_size = 4; #endif m_caption_size = 17; m_border_size = 1; m_button_size = 14; m_gripper_size = 9; m_gradient_type = wxAUI_GRADIENT_VERTICAL; }