From: Vadim Zeitlin Date: Sat, 1 Dec 2001 03:18:24 +0000 (+0000) Subject: fixed compilation after wxTipWindow base class change, added wxUSE_TIPWINDOW X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f38bcae5bfb5c008f48dadf619fba0ea23d5d975 fixed compilation after wxTipWindow base class change, added wxUSE_TIPWINDOW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12786 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index ced72e708b..3360f18422 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -493,6 +493,14 @@ # endif #endif /* !defined(wxUSE_TEXTFILE) */ +#ifndef wxUSE_TIPWINDOW +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_TIPWINDOW must be defined." +# else +# define wxUSE_TIPWINDOW 0 +# endif +#endif /* !defined(wxUSE_TIPWINDOW) */ + #ifndef wxUSE_TOOLBAR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TOOLBAR must be defined." @@ -869,5 +877,14 @@ # endif #endif /* wxUSE_CLIPBOARD */ +#if wxUSE_TIPWINDOW && !wxUSE_POPUPWIN +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxTipWindow requires wxPopupWindow" +# else +# undef wxUSE_POPUPWIN +# define wxUSE_POPUPWIN 1 +# endif +#endif /* wxUSE_TIPWINDOW */ + #endif /* wxUSE_GUI */ diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index bf73e59862..2a49eafd46 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -415,12 +415,21 @@ // Recommended setting: 1 (don't change except for very special programs) #define wxUSE_CONTROLS 1 -// wxPopupWindow class is not used currently by wxMSW +// wxPopupWindow class is a top level transient window. It is currently used +// to implement wxTipWindow // -// Default is 0 +// Default is 1 // -// Recommended setting: 0 -#define wxUSE_POPUPWIN 0 +// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW) +#define wxUSE_POPUPWIN 1 + +// wxTipWindow allows to implement the custom tooltips, it is used by the +// context help classes. Requires wxUSE_POPUPWIN. +// +// Default is 1 +// +// Recommended setting: 1 (may be set to 0) +#define wxUSE_TIPWINDOW 1 // Each of the settings below corresponds to one wxWindows control. They are // all switched on by default but may be disabled if you are sure that your diff --git a/include/wx/tipwin.h b/include/wx/tipwin.h index ce4e3ec69a..8a274e5794 100644 --- a/include/wx/tipwin.h +++ b/include/wx/tipwin.h @@ -20,6 +20,7 @@ #include "wx/popupwin.h" #if wxUSE_POPUPWIN + // ---------------------------------------------------------------------------- // wxTipWindow // ---------------------------------------------------------------------------- @@ -55,4 +56,6 @@ private: }; #endif // wxUSE_POPUPWIN + #endif // _WX_TIPWIN_H_ + diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index cb9a8d895f..ba35623830 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -305,6 +305,7 @@ void wxSimpleHelpProvider::AddHelp(wxWindowID id, const wxString& text) bool wxSimpleHelpProvider::ShowHelp(wxWindowBase *window) { +#if wxUSE_TIPWINDOW static wxTipWindow* s_tipWindow = NULL; if (s_tipWindow) @@ -323,6 +324,7 @@ bool wxSimpleHelpProvider::ShowHelp(wxWindowBase *window) return TRUE; } +#endif // wxUSE_TIPWINDOW return FALSE; } diff --git a/src/generic/tipwin.cpp b/src/generic/tipwin.cpp index fc18fbff7b..824df91743 100644 --- a/src/generic/tipwin.cpp +++ b/src/generic/tipwin.cpp @@ -33,6 +33,9 @@ #endif // WX_PRECOMP #include "wx/tipwin.h" + +#if wxUSE_TIPWINDOW + #include "wx/timer.h" #include "wx/settings.h" @@ -205,4 +208,5 @@ void wxTipWindow::Close() Destroy(); } +#endif // wxUSE_TIPWINDOW diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index e513a50f63..ad43374bd6 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -195,7 +195,7 @@ bool wxHtmlHelpController::DisplaySection(int sectionNo) bool wxHtmlHelpController::DisplayTextPopup(const wxString& text, const wxPoint& WXUNUSED(pos)) { -#if wxUSE_HELP +#if wxUSE_TIPWINDOW static wxTipWindow* s_tipWindow = NULL; if (s_tipWindow) @@ -213,7 +213,8 @@ bool wxHtmlHelpController::DisplayTextPopup(const wxString& text, const wxPoint& return TRUE; } -#endif +#endif // wxUSE_TIPWINDOW + return FALSE; }