Implement wxNotificationMessage using libnotify in wxGTK.

Use libnotify -- if detected by configure -- to provide native notifications
in wxGTK. Our API maps to libnotify one in rather straightforward way, we
might consider extending it to cover more of libnotify functionality
(categories, user-defined icons and, especially, actions) later.

Also update the dialogs sample to show another kind of notification and the
documentation to clarify the behaviour of various methods.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-07-27 15:36:54 +00:00
parent 5a92b56137
commit afbf46a317
13 changed files with 481 additions and 9 deletions

View File

@@ -11,10 +11,9 @@
This class allows to show the user a message non intrusively.
Currently it is implemented natively only for the Maemo platform and uses
Currently it is implemented natively for Windows and GTK and uses
(non-modal) dialogs for the display of the notifications under the other
platforms but it will be extended to use the platform-specific notifications
in the other ports in the future.
platforms.
Notice that this class is not a window and so doesn't derive from wxWindow.
@@ -46,6 +45,14 @@ public:
wxNotificationMessage(const wxString& title, const wxString& message = wxEmptyString,
wxWindow* parent = NULL, int flags = wxICON_INFORMATION);
/**
Destructor does not hide the notification.
The notification can continue to be shown even after the C++ object was
destroyed, call Close() explicitly if it needs to be hidden.
*/
virtual ~wxNotificationMessage();
/**
Hides the notification.
@@ -95,6 +102,11 @@ public:
because the current platform may only support default timeout value
and also because the user may be able to close the notification.
@note When using native notifications in wxGTK, the timeout is ignored
for the notifications with @c wxICON_WARNING or @c wxICON_ERROR
flags, they always remain shown unless they're explicitly hidden by
the user, i.e. behave as if Timeout_Auto were given.
@return @false if an error occurred.
*/
virtual bool Show(int timeout = Timeout_Auto);