From 5e6b39c9d63999efa0b3e82d9cee788748aaaee3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 2 Dec 2007 19:42:15 +0000 Subject: [PATCH] added wxNotificationMessage::AlwaysUseGeneric() MSW-specific method git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/notifmsg.h | 10 ++++++++++ src/msw/notifmsg.cpp | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/wx/msw/notifmsg.h b/include/wx/msw/notifmsg.h index 0928ea71bc..d39fbbd7c4 100644 --- a/include/wx/msw/notifmsg.h +++ b/include/wx/msw/notifmsg.h @@ -47,11 +47,21 @@ public: // returns the task bar icon which was used previously (may be NULL) static wxTaskBarIcon *UseTaskBarIcon(wxTaskBarIcon *icon); + // call this to always use the generic implementation, even if the system + // supports the balloon tooltips used by the native one + static void AlwaysUseGeneric(bool alwaysUseGeneric) + { + ms_alwaysUseGeneric = alwaysUseGeneric; + } + private: // common part of all ctors void Init() { m_impl = NULL; } + // flag indicating whether we should always use generic implementation + static bool ms_alwaysUseGeneric; + // the real implementation of this class (selected during run-time because // the balloon task bar icons are not available in all Windows versions) class wxNotifMsgImpl *m_impl; diff --git a/src/msw/notifmsg.cpp b/src/msw/notifmsg.cpp index dbbc098ad2..cedac4899b 100644 --- a/src/msw/notifmsg.cpp +++ b/src/msw/notifmsg.cpp @@ -377,6 +377,9 @@ wxAutoNotifMsgImpl::DoShow(const wxString& title, // wxNotificationMessage // ---------------------------------------------------------------------------- +/* static */ +bool wxNotificationMessage::ms_alwaysUseGeneric = false; + /* static */ wxTaskBarIcon *wxNotificationMessage::UseTaskBarIcon(wxTaskBarIcon *icon) { @@ -387,7 +390,7 @@ bool wxNotificationMessage::Show(int timeout) { if ( !m_impl ) { - if ( wxTheApp->GetShell32Version() >= 500 ) + if ( !ms_alwaysUseGeneric && wxTheApp->GetShell32Version() >= 500 ) { if ( timeout == Timeout_Never ) m_impl = new wxManualNotifMsgImpl(GetParent()); -- 2.45.2