HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
TaskbarIcon.cpp
Go to the documentation of this file.
1 /*******************************************************************/
9 #include "../../.HatchKeeper_Data_90/Images/TaskBar.xpm"
10 #include <wx/taskbar.h>
11 
12 const int ON_RESHOW = 5600;
13 const int ON_EXIT = 5601;
14 
21 class HatchTaskBarIcon : public wxTaskBarIcon
22 {
23 public:
25 #if defined(__WXOSX__) && wxOSX_USE_COCOA
26  HatchTaskBarIcon(wxTaskBarIconType iconType = wxTBI_CUSTOM_STATUSITEM )
27  : wxTaskBarIcon(iconType)
28 #else
30 #endif
31  {}
32 
33  //void OnLeftButtonDClick(wxTaskBarIconEvent&);
34  void OnWindowRestore(wxCommandEvent&);
35  void OnWindowExit(wxCommandEvent&);
36  virtual wxMenu *CreatePopupMenu();
37 
39 };
40 
43 {
44  wxMenu *menu = new wxMenu;
45  menu->Append(ON_RESHOW, l("Open HatchKeeper"));
46  menu->AppendSeparator();
47  /* OSX has built-in quit menu for the dock menu, but not for the status item */
48 #ifdef __WXOSX__
49  if ( OSXIsStatusItem() )
50 #endif
51  {
52  menu->AppendSeparator();
53  menu->Append(ON_EXIT, l("Exit Completely"));
54  }
55  return menu;
56 }
std::string l(std::string Text)
A Helper Function For HK_Language.
Definition: Declare.h:52
const int ON_EXIT
Definition: TaskbarIcon.cpp:13
const int ON_RESHOW
Definition: TaskbarIcon.cpp:12
A Taskbar Icon That Is Visable When HatchKeeper Is Running.
Definition: TaskbarIcon.cpp:22
void OnWindowRestore(wxCommandEvent &)
Calls ShowFrame()
HatchTaskBarIcon()
Constructor.
Definition: TaskbarIcon.cpp:29
void OnWindowExit(wxCommandEvent &)
Exits The App Completely.
virtual wxMenu * CreatePopupMenu()
Overridden To Show A Menu When The Icon Is Clicked.
Definition: TaskbarIcon.cpp:42