diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 18591104a0..a6350c1afc 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -219,6 +219,12 @@ public: // created yet) void MSWUpdateStyle(long flagsOld, long exflagsOld); +#if wxABI_VERSION >= 20805 + // Helper for getting an appropriate theme style for the application. Unnecessary in + // 2.9 and above. + wxBorder GetThemedBorderStyle() const; +#endif + // translate wxWidgets coords into Windows ones suitable to be passed to // ::CreateWindow() // diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index b11b53b16a..4649312b92 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -30,10 +30,6 @@ #include "wx/image.h" -#if defined(__WXMSW__) && wxUSE_UXTHEME -#include "wx/msw/uxtheme.h" -#endif - #define WXMAX(a,b) ((a)>(b)?(a):(b)) // ---------------------------------------------------------------------------- @@ -327,9 +323,10 @@ bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id, { int borderStyle = wxBORDER_SIMPLE; -#if defined(__WXMSW__) && wxUSE_UXTHEME && !(defined(__POCKETPC__) || defined(__SMARTPHONE__)) - if (wxUxThemeEngine::GetIfActive()) - borderStyle = wxBORDER_THEME; +#if defined(__WXMSW__) + borderStyle = GetThemedBorderStyle(); + if (borderStyle == wxBORDER_SUNKEN) + borderStyle = wxBORDER_SIMPLE; #elif defined(__WXGTK__) borderStyle = wxBORDER_SUNKEN; #endif diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp index 17a376198b..02466fe11c 100644 --- a/src/html/helpwnd.cpp +++ b/src/html/helpwnd.cpp @@ -108,8 +108,9 @@ class wxHtmlHelpHashData : public wxObject class wxHtmlHelpHtmlWindow : public wxHtmlWindow { public: - wxHtmlHelpHtmlWindow(wxHtmlHelpWindow *win, wxWindow *parent) - : wxHtmlWindow(parent), m_Window(win) + wxHtmlHelpHtmlWindow(wxHtmlHelpWindow *win, wxWindow *parent, wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = wxHW_DEFAULT_STYLE) + : wxHtmlWindow(parent, id, pos, sz, style), m_Window(win) { SetStandardFonts(); } @@ -361,6 +362,14 @@ bool wxHtmlHelpWindow::Create(wxWindow* parent, wxWindowID id, wxSizer *navigSizer = NULL; +#ifdef __WXMSW__ + wxBorder htmlWindowBorder = GetThemedBorderStyle(); + if (htmlWindowBorder == wxBORDER_SUNKEN) + htmlWindowBorder = wxBORDER_SIMPLE; +#else + wxBorder htmlWindowBorder = wxBORDER_SIMPLE; +#endif + if (helpStyle & (wxHF_CONTENTS | wxHF_INDEX | wxHF_SEARCH)) { // traditional help controller; splitter window with html page on the @@ -369,7 +378,7 @@ bool wxHtmlHelpWindow::Create(wxWindow* parent, wxWindowID id, topWindowSizer->Add(m_Splitter, 1, wxEXPAND); - m_HtmlWin = new wxHtmlHelpHtmlWindow(this, m_Splitter); + m_HtmlWin = new wxHtmlHelpHtmlWindow(this, m_Splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_DEFAULT_STYLE|htmlWindowBorder); m_NavigPan = new wxPanel(m_Splitter, wxID_ANY); m_NavigNotebook = new wxNotebook(m_NavigPan, wxID_HTML_NOTEBOOK, wxDefaultPosition, wxDefaultSize); @@ -382,7 +391,7 @@ bool wxHtmlHelpWindow::Create(wxWindow* parent, wxWindowID id, else { // only html window, no notebook with index,contents etc - m_HtmlWin = new wxHtmlWindow(this); + m_HtmlWin = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_DEFAULT_STYLE|htmlWindowBorder); topWindowSizer->Add(m_HtmlWin, 1, wxEXPAND); } diff --git a/src/msw/window.cpp b/src/msw/window.cpp index ca7970714e..2ee2b289a9 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1425,6 +1425,19 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const return style; } +// Helper for getting an appropriate theme style for the application. Unnecessary in +// 2.9 and above. +wxBorder wxWindowMSW::GetThemedBorderStyle() const +{ +#if defined(__POCKETPC__) || defined(__SMARTPHONE__) + return wxBORDER_SIMPLE +#elif wxUSE_UXTHEME + if (wxUxThemeEngine::GetIfActive()) + return wxBORDER_THEME; +#endif + return wxBORDER_SUNKEN; +} + // Setup background and foreground colours correctly void wxWindowMSW::SetupColours() { diff --git a/version-script.in b/version-script.in index 271ef92a2e..a2035761b1 100644 --- a/version-script.in +++ b/version-script.in @@ -40,6 +40,7 @@ *wxLogChain*DetachOldLog*; *wxMemoryFSHandler*AddFileWithMimeType*; *wxMetafileDC*DoGetTextExtent*; + *wxWindowMSW*GetThemedBorderStyle*; *wxWizard*GetBitmap*; *wxWizard*SetBitmap*; };