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 //---------------------------------------------------------------------------
27 // implement dummy classes and such for wxMac
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; }
45 wxEVT_TASKBAR_MOVE = 0,
46 wxEVT_TASKBAR_LEFT_DOWN = 0,
47 wxEVT_TASKBAR_LEFT_UP = 0,
48 wxEVT_TASKBAR_RIGHT_DOWN = 0,
49 wxEVT_TASKBAR_RIGHT_UP = 0,
50 wxEVT_TASKBAR_LEFT_DCLICK = 0,
51 wxEVT_TASKBAR_RIGHT_DCLICK = 0,
56 // // Otherwise make a class that can virtualize CreatePopupMenu
57 // class wxPyTaskBarIcon : public wxTaskBarIcon
59 // DECLARE_ABSTRACT_CLASS(wxPyTaskBarIcon);
61 // wxPyTaskBarIcon() : wxTaskBarIcon()
64 // wxMenu* CreatePopupMenu() {
65 // wxMenu *rval = NULL;
67 // bool blocked = wxPyBeginBlockThreads();
68 // if ((found = wxPyCBH_findCallback(m_myInst, "CreatePopupMenu"))) {
71 // ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
73 // if (wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxMenu")))
78 // wxPyEndBlockThreads(blocked);
80 // rval = wxTaskBarIcon::CreatePopupMenu();
87 // IMPLEMENT_ABSTRACT_CLASS(wxPyTaskBarIcon, wxTaskBarIcon);
93 // NOTE: TaskbarIcon has not yet been changed to be able to virtualize the
94 // CreatePopupMenu method because it is just before a release and I worry that
95 // there will be a problem in this case with it holding a reference to itself
96 // (since it depends on the dtor for cleanup.) Better safe than sorry!
98 // Perhaps a better mechanism for wxPython woudl be to turn CreatePopupMenu
101 MustHaveApp(wxTaskBarIcon);
103 class wxTaskBarIcon : public wxEvtHandler
119 %pythoncode { def __nonzero__(self): return self.IsOk() }
121 bool IsIconInstalled() const;
123 bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString);
125 bool PopupMenu(wxMenu *menu);
131 class wxTaskBarIconEvent : public wxEvent
134 wxTaskBarIconEvent(wxEventType evtType, wxTaskBarIcon *tbIcon);
139 %constant wxEventType wxEVT_TASKBAR_MOVE;
140 %constant wxEventType wxEVT_TASKBAR_LEFT_DOWN;
141 %constant wxEventType wxEVT_TASKBAR_LEFT_UP;
142 %constant wxEventType wxEVT_TASKBAR_RIGHT_DOWN;
143 %constant wxEventType wxEVT_TASKBAR_RIGHT_UP;
144 %constant wxEventType wxEVT_TASKBAR_LEFT_DCLICK;
145 %constant wxEventType wxEVT_TASKBAR_RIGHT_DCLICK;
149 EVT_TASKBAR_MOVE = wx.PyEventBinder ( wxEVT_TASKBAR_MOVE )
150 EVT_TASKBAR_LEFT_DOWN = wx.PyEventBinder ( wxEVT_TASKBAR_LEFT_DOWN )
151 EVT_TASKBAR_LEFT_UP = wx.PyEventBinder ( wxEVT_TASKBAR_LEFT_UP )
152 EVT_TASKBAR_RIGHT_DOWN = wx.PyEventBinder ( wxEVT_TASKBAR_RIGHT_DOWN )
153 EVT_TASKBAR_RIGHT_UP = wx.PyEventBinder ( wxEVT_TASKBAR_RIGHT_UP )
154 EVT_TASKBAR_LEFT_DCLICK = wx.PyEventBinder ( wxEVT_TASKBAR_LEFT_DCLICK )
155 EVT_TASKBAR_RIGHT_DCLICK = wx.PyEventBinder ( wxEVT_TASKBAR_RIGHT_DCLICK )
158 //---------------------------------------------------------------------------