WXMainToolbar(wxFrame *parent) { m_tb = wxXmlResource::Get()->LoadToolBar(parent, "toolbar"); m_idUpdate = XRCID("toolbar_update"); #ifdef __WXGTK3__ gtk_style_context_add_class(gtk_widget_get_style_context(GTK_WIDGET(Toolbar())), GTK_STYLE_CLASS_PRIMARY_TOOLBAR); SetIcon(0 , "document-open-symbolic"); SetIcon(1 , "document-save-symbolic"); SetIcon(3 , "poedit-validate-symbolic"); SetIcon(4 , "poedit-update-symbolic"); SetIcon(6 , "sidebar-symbolic"); #endif #ifdef __WXMSW__ // De-uglify the toolbar a bit on Windows 10: if (IsWindows10OrGreater()) { if (wxUxThemeIsActive()) { wxUxThemeHandle hTheme(m_tb, L"ExplorerMenu::Toolbar"); m_tb->SetBackgroundColour(wxRGBToColour(::GetThemeSysColor(hTheme, COLOR_WINDOW))); } unsigned padding = PX(4); ::SendMessage((HWND) m_tb->GetHWND(), TB_SETPADDING, 0, MAKELPARAM(padding, padding)); } m_tb->SetDoubleBuffered(true); #endif }
wxAuiMSWTabArt::wxAuiMSWTabArt() { m_closeBtnSize = wxDefaultSize; m_maxTabHeight = 0; m_themed = wxUxThemeIsActive(); }
/* static */ const wxStatusBar::MSWMetrics& wxStatusBar::MSWGetMetrics() { static MSWMetrics s_metrics = { 0, 0 }; if ( !s_metrics.textMargin ) { // Grip size should be self explanatory (the only problem with it is // that it's hard coded as we don't know how to find its size using // API) but the margin might merit an explanation: Windows offsets the // text drawn in status bar panes so we need to take this extra margin // into account to make sure the text drawn by user fits inside the // pane. Notice that it's not the value returned by SB_GETBORDERS // which, at least on this Windows 2003 system, returns {0, 2, 2} #if wxUSE_UXTHEME if ( wxUxThemeIsActive() ) { s_metrics.gripWidth = 20; s_metrics.textMargin = 8; } else // classic/unthemed look #endif // wxUSE_UXTHEME { s_metrics.gripWidth = 18; s_metrics.textMargin = 4; } } return s_metrics; }
bool wxComboCtrl::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { // Set border long border = style & wxBORDER_MASK; if ( !border ) { if ( wxUxThemeIsActive() ) { // For XP, have 1-width custom border, for older version use sunken border = wxBORDER_NONE; m_widthCustomBorder = 1; } else border = wxBORDER_SUNKEN; style = (style & ~(wxBORDER_MASK)) | border; } // create main window if ( !wxComboCtrlBase::Create(parent, id, value, pos, size, style | wxFULL_REPAINT_ON_RESIZE, validator, name) ) return false; if ( wxUxThemeIsActive() && ::wxGetWinVersion() >= wxWinVersion_Vista ) m_iFlags |= wxCC_BUTTON_STAYS_DOWN |wxCC_BUTTON_COVERS_BORDER; if ( style & wxCC_STD_BUTTON ) m_iFlags |= wxCC_POPUP_ON_MOUSE_UP; // Prepare background for double-buffering or better background theme // support, whichever is possible. SetDoubleBuffered(true); if ( !IsDoubleBuffered() ) SetBackgroundStyle( wxBG_STYLE_PAINT ); // Create textctrl, if necessary CreateTextCtrl( wxNO_BORDER ); // Add keyboard input handlers for main control and textctrl InstallInputHandlers(); // SetInitialSize should be called last SetInitialSize(size); return true; }
wxCoord wxComboCtrl::GetNativeTextIndent() const { if ( wxUxThemeIsActive() ) return NATIVE_TEXT_INDENT_XP; return NATIVE_TEXT_INDENT_CLASSIC; }