From: Vadim Zeitlin Date: Wed, 14 Jun 2006 18:27:55 +0000 (+0000) Subject: let wxFRAME_EX_CONTEXTHELP override wxM{IN|AX}IMIZE_BOX as the latter are included... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/dc134969ef4efd78faccc19fa616d715ab39c5f8 let wxFRAME_EX_CONTEXTHELP override wxM{IN|AX}IMIZE_BOX as the latter are included in the default style and getting rid of them manually requires writing ugly wxDEFAULT_FRAME_STYLE & ~(wxMINIMIZE_BOX | wxMAXIMIZE_BOX) while this is almost always what we need git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39726 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 15e7729302..d7bf04d4aa 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -207,10 +207,19 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const #endif // next translate the individual flags - if ( style & wxMINIMIZE_BOX ) - msflags |= WS_MINIMIZEBOX; - if ( style & wxMAXIMIZE_BOX ) - msflags |= WS_MAXIMIZEBOX; + + // WS_EX_CONTEXTHELP is incompatible with WS_MINIMIZEBOX and WS_MAXIMIZEBOX + // and is ignored if we specify both of them, but chances are that if we + // use wxFRAME_EX_CONTEXTHELP, we really do want to have the context help + // button while wxMINIMIZE/wxMAXIMIZE are included by default, so the help + // takes precedence + if ( !(GetExtraStyle() & wxFRAME_EX_CONTEXTHELP) ) + { + if ( style & wxMINIMIZE_BOX ) + msflags |= WS_MINIMIZEBOX; + if ( style & wxMAXIMIZE_BOX ) + msflags |= WS_MAXIMIZEBOX; + } #ifndef __WXWINCE__ if ( style & wxSYSTEM_MENU )