Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BatchTrayIcon.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
11 /*
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This software is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public
23  * License along with this software. If not, see
24  * <http://www.gnu.org/licenses/>.
25  *
26  */
27 
28 #ifndef BATCHTRAYICON_H
29 #define BATCHTRAYICON_H
30 
32 #include <wx/taskbar.h>
33 class BatchTaskBarIcon : public wxTaskBarIcon
34 {
35 protected:
37  void OnLeftButtonDClick(wxTaskBarIconEvent&);
39  void OnShowGUI(wxCommandEvent& e);
41  void OnStartBatch(wxCommandEvent& e);
43  void OnPauseBatch(wxCommandEvent& e);
45  void OnStopBatch(wxCommandEvent& e);
47  void OnExit(wxCommandEvent& e);
49  void OnAddProject(wxCommandEvent& e);
51  void OnAddProjectToAssistant(wxCommandEvent& e);
53  virtual wxMenu* CreatePopupMenu();
54 
55  DECLARE_EVENT_TABLE()
56 };
57 
58 #if defined __WXMSW__ && wxUSE_TASKBARICON_BALLOONS
59 // wxMSW, version 2.9 offers a native balloon for the traybar notification
60 // we need to implement a own version for the other systems only
61 #else
62 #include <wx/frame.h>
63 #include <wx/timer.h>
64 
66 // idea from http://wiki.wxwidgets.org/WxTaskBarIcon
67 class TaskBarBalloon : public wxFrame
68 {
69 public:
70  TaskBarBalloon(wxString sTitle, wxString sMessage);
71  virtual ~TaskBarBalloon();
73  void OnTimerTick(wxTimerEvent& e);
75  void OnClick(wxMouseEvent& e);
77  void OnKeyDown(wxKeyEvent& e);
78 
80  void showBalloon(unsigned int iTimeout);
81 private:
82  wxTimer* m_timer;
84 };
85 #endif
86 
87 #endif // BATCHTRAYICON_H
void OnLeftButtonDClick(wxTaskBarIconEvent &)
handler if double clicked on taskbar icon, opens window
void OnStopBatch(wxCommandEvent &e)
handler to stop batch
TaskBarBalloon(wxString sTitle, wxString sMessage)
void OnKeyDown(wxKeyEvent &e)
key down event in the balloon
class to show a taskbar balloon
Definition: BatchTrayIcon.h:67
void OnShowGUI(wxCommandEvent &e)
handler to open window
void OnPauseBatch(wxCommandEvent &e)
handler to pause batch
void OnStartBatch(wxCommandEvent &e)
handler to start batch
class for showing a taskbar/tray icon
Definition: BatchTrayIcon.h:33
virtual wxMenu * CreatePopupMenu()
creates the popup menu
virtual ~TaskBarBalloon()
void OnAddProject(wxCommandEvent &e)
handler to adding a project to stitching queue
void OnAddProjectToAssistant(wxCommandEvent &e)
handler to adding a project to assistant queue
void showBalloon(unsigned int iTimeout)
display the baloon and run the timer
void OnTimerTick(wxTimerEvent &e)
timer to close window
void OnExit(wxCommandEvent &e)
handler to exit PTBatcherGUI
wxTimer * m_timer
Definition: BatchTrayIcon.h:82
void OnClick(wxMouseEvent &e)
click on the balloon