From 7ce6cc9b8eda3c0195ae5233d8a4d35707a88190 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 6 Aug 2006 12:56:48 +0000 Subject: [PATCH] unified wxFRAME_EX_CONTEXTHELP and wxDIALOG_EX_CONTEXTHELP in a single wxWS_EX_CONTEXTHELP and changed its value to avoid conflict with wxWS_EX_TRANSIENT (this resulted in all progress dialogs having useless context help button in their title bar) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40490 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/window.tex | 12 +++++------- include/wx/defs.h | 13 ++++++++----- src/msw/toplevel.cpp | 6 +++--- src/univ/topluniv.cpp | 5 ++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex index 9ac167e736..cd9326c4f0 100644 --- a/docs/latex/wx/window.tex +++ b/docs/latex/wx/window.tex @@ -2799,14 +2799,12 @@ default for the reasons explained in the window from being used as an implicit parent for the dialogs which were created without a parent. It is useful for the windows which can disappear at any moment as creating children of such windows results in fatal problems.} -\twocolitem{\windowstyle{wxFRAME\_EX\_CONTEXTHELP}}{Under Windows, puts a query button on the -caption. When pressed, Windows will go into a context-sensitive help mode and wxWidgets will send -a wxEVT\_HELP event if the user clicked on an application window. +\twocolitem{\windowstyle{wxWS\_EX\_CONTEXTHELP}}{Under Windows, puts a query +button on the caption. When pressed, Windows will go into a context-sensitive +help mode and wxWidgets will send a wxEVT\_HELP event if the user clicked on an +application window. This style cannot be used together with wxMAXIMIZE\_BOX or wxMINIMIZE\_BOX, so -you should use the style of -{\tt wxDEFAULT\_FRAME\_STYLE \& \textasciitilde(wxMINIMIZE\_BOX | wxMAXIMIZE\_BOX)} for the -frames having this style (the dialogs don't have minimize nor maximize box by -default)} +these two styles are automatically turned of if this one is used.} \twocolitem{\windowstyle{wxWS\_EX\_PROCESS\_IDLE}}{This window should always process idle events, even if the mode set by \helpref{wxIdleEvent::SetMode}{wxidleeventsetmode} is wxIDLE\_PROCESS\_SPECIFIED.} \twocolitem{\windowstyle{wxWS\_EX\_PROCESS\_UI\_UPDATES}}{This window should always process UI update events, diff --git a/include/wx/defs.h b/include/wx/defs.h index 021c098b39..896a20de29 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -1513,15 +1513,18 @@ enum wxBorder /* this window should always process UI update events */ #define wxWS_EX_PROCESS_UI_UPDATES 0x00000020 -/* Use this style to add a context-sensitive help to the window (currently for */ -/* Win32 only and it doesn't work if wxMINIMIZE_BOX or wxMAXIMIZE_BOX are used) */ -#define wxFRAME_EX_CONTEXTHELP 0x00000004 -#define wxDIALOG_EX_CONTEXTHELP 0x00000004 - /* Draw the window in a metal theme on Mac */ #define wxFRAME_EX_METAL 0x00000040 #define wxDIALOG_EX_METAL 0x00000040 +/* Use this style to add a context-sensitive help to the window (currently for */ +/* Win32 only and it doesn't work if wxMINIMIZE_BOX or wxMAXIMIZE_BOX are used) */ +#define wxWS_EX_CONTEXTHELP 0x00000080 + +/* synonyms for wxWS_EX_CONTEXTHELP for compatibility */ +#define wxFRAME_EX_CONTEXTHELP wxWS_EX_CONTEXTHELP +#define wxDIALOG_EX_CONTEXTHELP wxWS_EX_CONTEXTHELP + /* Create a window which is attachable to another top level window */ #define wxFRAME_DRAWER 0x0020 diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index ac6b7b0840..0c5d936882 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -210,10 +210,10 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const // 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 + // use wxWS_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 ( !(GetExtraStyle() & wxWS_EX_CONTEXTHELP) ) { if ( style & wxMINIMIZE_BOX ) msflags |= WS_MINIMIZEBOX; @@ -273,7 +273,7 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const //else: nothing to do [here] } - if ( GetExtraStyle() & wxFRAME_EX_CONTEXTHELP ) + if ( GetExtraStyle() & wxWS_EX_CONTEXTHELP ) *exflags |= WS_EX_CONTEXTHELP; #endif // !__WXWINCE__ diff --git a/src/univ/topluniv.cpp b/src/univ/topluniv.cpp index b4ed44b881..a7c87890d6 100644 --- a/src/univ/topluniv.cpp +++ b/src/univ/topluniv.cpp @@ -97,8 +97,7 @@ bool wxTopLevelWindow::Create(wxWindow *parent, wxSYSTEM_MENU | wxRESIZE_BORDER | wxFRAME_TOOL_WINDOW | wxRESIZE_BORDER); style |= wxSIMPLE_BORDER; - SetExtraStyle(exstyleOrig & - ~(wxFRAME_EX_CONTEXTHELP | wxDIALOG_EX_CONTEXTHELP)); + SetExtraStyle(exstyleOrig & ~wxWS_EX_CONTEXTHELP); } if ( !wxTopLevelWindowNative::Create(parent, id, title, pos, @@ -154,7 +153,7 @@ long wxTopLevelWindow::GetDecorationsStyle() const style |= wxTOPLEVEL_BUTTON_MAXIMIZE; } #if wxUSE_HELP - if ( m_exStyle & (wxFRAME_EX_CONTEXTHELP | wxDIALOG_EX_CONTEXTHELP)) + if ( m_exStyle & wxWS_EX_CONTEXTHELP) style |= wxTOPLEVEL_BUTTON_HELP; #endif } -- 2.45.2