1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface defs for wxTaskBarIcon
7 // Created: 2-June-1998
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
21 //---------------------------------------------------------------------------
26 #ifndef wxHAS_TASK_BAR_ICON
27 // implement dummy classes for platforms that don't have it
29 class wxTaskBarIcon : public wxEvtHandler
32 wxTaskBarIcon() { wxPyRaiseNotImplemented(); }
36 class wxTaskBarIconEvent : public wxEvent
39 wxTaskBarIconEvent(wxEventType, wxTaskBarIcon *)
40 { wxPyRaiseNotImplemented(); }
41 virtual wxEvent* Clone() const { return NULL; }
42 bool IsOk() const { return false; }
43 bool IsIconInstalled() const { return false; }
44 bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString) { return false; }
45 bool RemoveIcon() { return false; }
46 bool PopupMenu(wxMenu *menu) { return false; }
50 wxEVT_TASKBAR_MOVE = 0,
51 wxEVT_TASKBAR_LEFT_DOWN = 0,
52 wxEVT_TASKBAR_LEFT_UP = 0,
53 wxEVT_TASKBAR_RIGHT_DOWN = 0,
54 wxEVT_TASKBAR_RIGHT_UP = 0,
55 wxEVT_TASKBAR_LEFT_DCLICK = 0,
56 wxEVT_TASKBAR_RIGHT_DCLICK = 0,
61 // // Otherwise make a class that can virtualize CreatePopupMenu
62 // class wxPyTaskBarIcon : public wxTaskBarIcon
64 // DECLARE_ABSTRACT_CLASS(wxPyTaskBarIcon);
66 // wxPyTaskBarIcon() : wxTaskBarIcon()
69 // wxMenu* CreatePopupMenu() {
70 // wxMenu *rval = NULL;
72 // bool blocked = wxPyBeginBlockThreads();
73 // if ((found = wxPyCBH_findCallback(m_myInst, "CreatePopupMenu"))) {
76 // ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
78 // if (wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxMenu")))
83 // wxPyEndBlockThreads(blocked);
85 // rval = wxTaskBarIcon::CreatePopupMenu();
92 // IMPLEMENT_ABSTRACT_CLASS(wxPyTaskBarIcon, wxTaskBarIcon);
98 // NOTE: TaskbarIcon has not yet been changed to be able to virtualize the
99 // CreatePopupMenu method because it is just before a release and I worry that
100 // there will be a problem in this case with it holding a reference to itself
101 // (since it depends on the dtor for cleanup.) Better safe than sorry!
103 // Perhaps a better mechanism for wxPython would be to turn CreatePopupMenu
106 MustHaveApp(wxTaskBarIcon);
108 class wxTaskBarIcon : public wxEvtHandler
123 %pythoncode { def __nonzero__(self): return self.IsOk() }
125 bool IsIconInstalled() const;
127 bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString);
129 bool PopupMenu(wxMenu *menu);
134 class wxTaskBarIconEvent : public wxEvent
137 wxTaskBarIconEvent(wxEventType evtType, wxTaskBarIcon *tbIcon);
142 %constant wxEventType wxEVT_TASKBAR_MOVE;
143 %constant wxEventType wxEVT_TASKBAR_LEFT_DOWN;
144 %constant wxEventType wxEVT_TASKBAR_LEFT_UP;
145 %constant wxEventType wxEVT_TASKBAR_RIGHT_DOWN;
146 %constant wxEventType wxEVT_TASKBAR_RIGHT_UP;
147 %constant wxEventType wxEVT_TASKBAR_LEFT_DCLICK;
148 %constant wxEventType wxEVT_TASKBAR_RIGHT_DCLICK;
152 EVT_TASKBAR_MOVE = wx.PyEventBinder ( wxEVT_TASKBAR_MOVE )
153 EVT_TASKBAR_LEFT_DOWN = wx.PyEventBinder ( wxEVT_TASKBAR_LEFT_DOWN )
154 EVT_TASKBAR_LEFT_UP = wx.PyEventBinder ( wxEVT_TASKBAR_LEFT_UP )
155 EVT_TASKBAR_RIGHT_DOWN = wx.PyEventBinder ( wxEVT_TASKBAR_RIGHT_DOWN )
156 EVT_TASKBAR_RIGHT_UP = wx.PyEventBinder ( wxEVT_TASKBAR_RIGHT_UP )
157 EVT_TASKBAR_LEFT_DCLICK = wx.PyEventBinder ( wxEVT_TASKBAR_LEFT_DCLICK )
158 EVT_TASKBAR_RIGHT_DCLICK = wx.PyEventBinder ( wxEVT_TASKBAR_RIGHT_DCLICK )
161 //---------------------------------------------------------------------------