]> git.saurik.com Git - wxWidgets.git/commitdiff
add wxUSE_TASKBARICON_BALLOONS to make it possible to turn off their usage if our...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 8 Dec 2007 20:51:21 +0000 (20:51 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 8 Dec 2007 20:51:21 +0000 (20:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/chkconf.h
include/wx/msw/setup0.h
include/wx/msw/setup_inc.h
include/wx/msw/taskbar.h
include/wx/notifmsg.h
src/msw/taskbar.cpp

index 59d5dbc43304925213eb5ab5048150dc914e830a..930edc47a48832395dcc15db8dca2a86fbf2a444 100644 (file)
 #    endif
 #endif /* !defined(wxUSE_OLE_AUTOMATION) */
 
+#ifndef wxUSE_TASKBARICON_BALLOONS
+#   ifdef wxABORT_ON_CONFIG_ERROR
+#       error "wxUSE_TASKBARICON_BALLOONS must be defined."
+#   else
+#       define wxUSE_TASKBARICON_BALLOONS 0
+#   endif
+#endif /* wxUSE_TASKBARICON_BALLOONS */
+
 #ifndef wxUSE_UNICODE_MSLU
 #    ifdef wxABORT_ON_CONFIG_ERROR
 #        error "wxUSE_UNICODE_MSLU must be defined."
 #   endif
 #endif
 
+/*
+ * See WINVER definition in wx/msw/wrapwin.h for the explanation of this test
+ * logic.
+ */
+#if (defined(__VISUALC__) && (__VISUALC__ < 1300)) && \
+        (!defined(WINVER) || WINVER < 0x0500)
+#   undef wxUSE_TASKBARICON_BALLOONS
+#   define wxUSE_TASKBARICON_BALLOONS 0
+#endif
+
 /*
  * All of the settings below require SEH support (__try/__catch) and can't work
  * without it.
index 709b7fe5f9939b0d38356a1730f35af0666674b4..d1527cfde08c74e1bb581d06c3d004752e2bb153 100644 (file)
 // Recommended setting: 1, set to 0 for a small library size reduction
 #define wxUSE_OWNER_DRAWN 1
 
+// Set this to 1 to enable MSW-specific wxTaskBarIcon::ShowBalloon() method. It
+// is required by native wxNotificationMessage implementation.
+//
+// Default is 1 but disabled in wx/msw/chkconf.h if SDK is too old to contain
+// the necessary declarations.
+//
+// Recommended setting: 1, set to 0 for a tiny library size reduction
+#define wxUSE_TASKBARICON_BALLOONS 1
+
 // Set to 1 to compile MS Windows XP theme engine support
 #define wxUSE_UXTHEME           1
 
 //
 // Recommended setting: 1, set to 0 if your programs never crash
 #define wxUSE_CRASHREPORT 1
-
-// ----------------------------------------------------------------------------
-// obsolete settings
-// ----------------------------------------------------------------------------
-
-// NB: all settings in this section are obsolete and should not be used/changed
-//     at all, they will disappear
-
-// Define 1 to use bitmap messages.
-#define wxUSE_BITMAP_MESSAGE         1
-
 /* --- end MSW options --- */
 
 #endif // _WX_SETUP_H_
index 50c99f02dc27fa7238b2f36ebe4056a00647da0c..95a314740b544738779a3191ae35d54576dd3641 100644 (file)
 // Recommended setting: 1, set to 0 for a small library size reduction
 #define wxUSE_OWNER_DRAWN 1
 
+// Set this to 1 to enable MSW-specific wxTaskBarIcon::ShowBalloon() method. It
+// is required by native wxNotificationMessage implementation.
+//
+// Default is 1 but disabled in wx/msw/chkconf.h if SDK is too old to contain
+// the necessary declarations.
+//
+// Recommended setting: 1, set to 0 for a tiny library size reduction
+#define wxUSE_TASKBARICON_BALLOONS 1
+
 // Set to 1 to compile MS Windows XP theme engine support
 #define wxUSE_UXTHEME           1
 
index b6399dad3548445281b54eee8206f727fddab285..629b5407630320f1a95d07050e7ccff78104823b 100644 (file)
@@ -35,6 +35,7 @@ public:
 
     // MSW-specific class methods
 
+#if wxUSE_TASKBARICON_BALLOONS
     // show a balloon notification (the icon must have been already initialized
     // using SetIcon)
     //
@@ -50,6 +51,7 @@ public:
                      const wxString& text,
                      unsigned msec = 0,
                      int flags = 0);
+#endif // wxUSE_TASKBARICON_BALLOONS
 
 protected:
     friend class wxTaskBarIconWindow;
index 08f0672c2fa3202306a4e023abcff521d1693d97..90239b354b2e8436ca25ee2edff25475d50e0141 100644 (file)
@@ -134,7 +134,7 @@ private:
         - libnotify (Gnome)
         - Growl (http://growl.info/, OS X)
  */
-#elif defined(__WXMSW__) && wxUSE_TASKBARICON
+#elif defined(__WXMSW__) && wxUSE_TASKBARICON && wxUSE_TASKBARICON_BALLOONS
     #include "wx/msw/notifmsg.h"
 #else
     #include "wx/generic/notifmsg.h"
index d42b08fe47745a95a572d260151c55315f3bc307..cc52113434070e94a6a1e188e3c1e4f5dd76e1d3 100644 (file)
@@ -209,6 +209,8 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
     return ok;
 }
 
+#if wxUSE_TASKBARICON_BALLOONS
+
 bool
 wxTaskBarIcon::ShowBalloon(const wxString& title,
                            const wxString& text,
@@ -224,9 +226,7 @@ wxTaskBarIcon::ShowBalloon(const wxString& title,
     // the balloon disappearance
     NotifyIconData notifyData(hwnd);
     notifyData.uFlags = 0;
-#if (WINVER >= 0x0500)
     notifyData.uVersion = 3 /* NOTIFYICON_VERSION for Windows XP */;
-#endif
 
     wxShellNotifyIcon(NIM_SETVERSION, &notifyData);
 
@@ -234,7 +234,6 @@ wxTaskBarIcon::ShowBalloon(const wxString& title,
     // do show the balloon now
     notifyData = NotifyIconData(hwnd);
     notifyData.uFlags |= NIF_INFO;
-#if (WINVER >= 0x0500)
     notifyData.uTimeout = msec;
     wxStrncpy(notifyData.szInfo, text.wx_str(), WXSIZEOF(notifyData.szInfo));
     wxStrncpy(notifyData.szInfoTitle, title.wx_str(),
@@ -246,11 +245,12 @@ wxTaskBarIcon::ShowBalloon(const wxString& title,
         notifyData.dwInfoFlags |= NIIF_WARNING;
     else if ( flags & wxICON_ERROR )
         notifyData.dwInfoFlags |= NIIF_ERROR;
-#endif
 
     return wxShellNotifyIcon(NIM_MODIFY, &notifyData) != 0;
 }
 
+#endif // wxUSE_TASKBARICON_BALLOONS
+
 bool wxTaskBarIcon::RemoveIcon()
 {
     if (!m_iconAdded)