X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/92661f979400ea71a57b4509a4f1be223e4bcdef..3e2656801d825761f55ea9b0b766802c6cd32f1d:/src/msw/tbar95.cpp diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 83fcc8a1e6..944a1d0b27 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -46,6 +46,10 @@ #include "wx/msw/private.h" +#if wxUSE_UXTHEME +#include "wx/msw/uxtheme.h" +#endif + // include "properly" #include "wx/msw/wrapcctl.h" @@ -246,6 +250,26 @@ bool wxToolBar::Create(wxWindow *parent, SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR)); SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); + // workaround for flat toolbar on Windows XP classic style +#if wxUSE_UXTHEME + if ( style & wxTB_FLAT ) + { + wxUxThemeEngine *p = wxUxThemeEngine::Get(); + if ( !p || !p->IsThemeActive() ) + { + DWORD dwToolbarStyle; + + dwToolbarStyle = (DWORD)::SendMessage(GetHwnd(), TB_GETSTYLE, 0, 0L ); + + if ((dwToolbarStyle & TBSTYLE_FLAT) == 0) + { + dwToolbarStyle |= TBSTYLE_FLAT; + ::SendMessage(GetHwnd(), TB_SETSTYLE, 0, (LPARAM)dwToolbarStyle ); + } + } + } +#endif + return TRUE; } @@ -256,7 +280,7 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size) // toolbar-specific post initialisation ::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); - + return TRUE; }