summaryrefslogtreecommitdiff
path: root/ui/trayIcon.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui/trayIcon.h')
-rw-r--r--ui/trayIcon.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/ui/trayIcon.h b/ui/trayIcon.h
new file mode 100644
index 00000000..370e85f3
--- /dev/null
+++ b/ui/trayIcon.h
@@ -0,0 +1,27 @@
+#ifndef TRAYICON_H_INCLUDED
+#define TRAYICON_H_INCLUDED
+
+#include <wx/event.h>
+#include <wx/toplevel.h>
+
+
+class MinimizeToTray : private wxEvtHandler
+{
+public:
+ MinimizeToTray(wxTopLevelWindow* callerWnd, wxWindow* secondWnd = NULL); //ensure callerWind has longer lifetime!
+ ~MinimizeToTray(); //show windows again
+
+ void setToolTip(const wxString& toolTipText);
+ void keepHidden(); //do not show windows again: avoid window flashing shortly before it is destroyed
+private:
+ void OnContextMenuSelection(wxCommandEvent& event);
+ void OnDoubleClick(wxCommandEvent& event);
+ void resumeFromTray();
+
+ wxTopLevelWindow* callerWnd_;
+ wxWindow* secondWnd_;
+ class TaskBarImpl;
+ TaskBarImpl* trayIcon; //actual tray icon (don't use inheritance to enable delayed deletion)
+};
+
+#endif // TRAYICON_H_INCLUDED
bgstack15