Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[832b36]: src / hugin1 / ptbatcher / BatchTrayIcon.h Maximize Restore History

Download this file

BatchTrayIcon.h    86 lines (76 with data), 2.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// -*- c-basic-offset: 4 -*-
/** @file BatchTrayIcon.h
*
* @brief definition of tray/task bar icon for PTBatcherGUI
*
* @author T. Modes
*
*/
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef BATCHTRAYICON_H
#define BATCHTRAYICON_H
/** class for showing a taskbar/tray icon */
#include <wx/taskbar.h>
class BatchTaskBarIcon : public wxTaskBarIcon
{
protected:
/** handler if double clicked on taskbar icon, opens window */
void OnLeftButtonDClick(wxTaskBarIconEvent&);
/** handler to open window */
void OnShowGUI(wxCommandEvent& e);
/** handler to start batch */
void OnStartBatch(wxCommandEvent& e);
/** handler to pause batch */
void OnPauseBatch(wxCommandEvent& e);
/** handler to stop batch */
void OnStopBatch(wxCommandEvent& e);
/** handler to exit PTBatcherGUI */
void OnExit(wxCommandEvent& e);
/** handler to adding a project to stitching queue */
void OnAddProject(wxCommandEvent& e);
/** creates the popup menu */
virtual wxMenu *CreatePopupMenu();
DECLARE_EVENT_TABLE()
};
#if defined __WXMSW__ && wxUSE_TASKBARICON_BALLOONS && wxCHECK_VERSION(2,9,0)
// wxMSW, version 2.9 offers a native balloon for the traybar notification
// we need to implement a own version for the other systems only
#else
#include <wx/frame.h>
#include <wx/timer.h>
/** class to show a taskbar balloon */
// idea from http://wiki.wxwidgets.org/WxTaskBarIcon
class TaskBarBalloon : public wxFrame
{
public:
TaskBarBalloon(wxString sTitle, wxString sMessage);
virtual ~TaskBarBalloon();
/** timer to close window */
void OnTimerTick(wxTimerEvent & e);
/** click on the balloon */
void OnClick(wxMouseEvent & e);
/** key down event in the balloon */
void OnKeyDown(wxKeyEvent & e);
/** display the baloon and run the timer */
void showBalloon(unsigned int iTimeout);
private:
wxTimer * m_timer;
DECLARE_EVENT_TABLE();
};
#endif
#endif // BATCHTRAYICON_H