notifmsg.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/generic/notifmsg.h
  3. // Purpose: generic implementation of wxGenericNotificationMessage
  4. // Author: Vadim Zeitlin
  5. // Created: 2007-11-24
  6. // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
  7. // Licence: wxWindows licence
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_GENERIC_NOTIFMSG_H_
  10. #define _WX_GENERIC_NOTIFMSG_H_
  11. class wxNotificationMessageDialog;
  12. // ----------------------------------------------------------------------------
  13. // wxGenericNotificationMessage
  14. // ----------------------------------------------------------------------------
  15. class WXDLLIMPEXP_ADV wxGenericNotificationMessage : public wxNotificationMessageBase
  16. {
  17. public:
  18. wxGenericNotificationMessage() { Init(); }
  19. wxGenericNotificationMessage(const wxString& title,
  20. const wxString& message = wxString(),
  21. wxWindow *parent = NULL,
  22. int flags = wxICON_INFORMATION)
  23. : wxNotificationMessageBase(title, message, parent, flags)
  24. {
  25. Init();
  26. }
  27. virtual ~wxGenericNotificationMessage();
  28. virtual bool Show(int timeout = Timeout_Auto);
  29. virtual bool Close();
  30. // generic implementation-specific methods
  31. // get/set the default timeout (used if Timeout_Auto is specified)
  32. static int GetDefaultTimeout() { return ms_timeout; }
  33. static void SetDefaultTimeout(int timeout);
  34. private:
  35. void Init();
  36. // default timeout
  37. static int ms_timeout;
  38. // notification message is represented by a modeless dialog in this
  39. // implementation
  40. wxNotificationMessageDialog *m_dialog;
  41. wxDECLARE_NO_COPY_CLASS(wxGenericNotificationMessage);
  42. };
  43. #endif // _WX_GENERIC_NOTIFMSG_H_