-
Notifications
You must be signed in to change notification settings - Fork 2
/
TrayIcon.h
67 lines (57 loc) · 1.33 KB
/
TrayIcon.h
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
#pragma once
#include "Project.h"
#include "MenuItem.h"
namespace EShellMenu
{
class Application;
namespace EventIDs
{
enum EventID
{
First = wxID_HIGHEST + 1,
Exit = First,
Help,
Refresh,
Reload,
Update,
Add,
Last = Add,
};
}
class TrayIcon : public wxTaskBarIcon
{
public:
TrayIcon( Application* application );
virtual ~TrayIcon();
void Initialize();
void Cleanup();
bool IsMenuShowing() const
{
return m_IsMenuShowing;
}
void BeginBusy();
void EndBusy();
void Refresh( bool reload );
protected:
void OnTrayIconClick( wxTaskBarIconEvent& evt );
void OnMenuExit( wxCommandEvent& evt );
void OnMenuHelp( wxCommandEvent& evt );
void OnMenuRefresh( wxCommandEvent& evt );
void OnMenuReload( wxCommandEvent& evt );
void OnMenuShortcut( wxCommandEvent& evt );
void OnMenuAdd( wxCommandEvent& evt );
void OnMenuRemove( wxCommandEvent& evt );
void OnMenuEdit( wxCommandEvent& evt );
private:
void DetectAndSetIcon( MenuItem& menuItem, wxMenuItem* actualMenuItem );
void CreateProjectsMenu( wxMenu* parentMenu );
private:
Application* m_Application;
std::vector< Project > m_Projects;
std::map< tstring, std::pair< uint32_t, std::vector< MenuItem > > > m_MenuItems;
wxMenu* m_Menu;
wxMenuItem* m_UpdateMenuItem;
int m_BusyCount;
bool m_IsMenuShowing;
};
}