Enable TaskBarIcon for Mac too. Some cleanup.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29362 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-09-25 23:14:11 +00:00
parent 6dc48d382c
commit b17dd4ceee

View File

@@ -23,8 +23,8 @@
%{ %{
#ifdef __WXMAC__ #ifndef wxHAS_TASK_BAR_ICON
// implement dummy classes and such for wxMac // implement dummy classes for platforms that don't have it
class wxTaskBarIcon : public wxEvtHandler class wxTaskBarIcon : public wxEvtHandler
{ {
@@ -39,6 +39,11 @@ public:
wxTaskBarIconEvent(wxEventType, wxTaskBarIcon *) wxTaskBarIconEvent(wxEventType, wxTaskBarIcon *)
{ wxPyRaiseNotImplemented(); } { wxPyRaiseNotImplemented(); }
virtual wxEvent* Clone() const { return NULL; } virtual wxEvent* Clone() const { return NULL; }
bool IsOk() const { return false; }
bool IsIconInstalled() const { return false; }
bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString) { return false; }
bool RemoveIcon() { return false; }
bool PopupMenu(wxMenu *menu) { return false; }
}; };
enum { enum {
@@ -95,7 +100,7 @@ enum {
// there will be a problem in this case with it holding a reference to itself // there will be a problem in this case with it holding a reference to itself
// (since it depends on the dtor for cleanup.) Better safe than sorry! // (since it depends on the dtor for cleanup.) Better safe than sorry!
// //
// Perhaps a better mechanism for wxPython woudl be to turn CreatePopupMenu // Perhaps a better mechanism for wxPython would be to turn CreatePopupMenu
// into an event... // into an event...
MustHaveApp(wxTaskBarIcon); MustHaveApp(wxTaskBarIcon);
@@ -114,7 +119,6 @@ public:
} }
} }
#ifndef __WXMAC__
bool IsOk() const; bool IsOk() const;
%pythoncode { def __nonzero__(self): return self.IsOk() } %pythoncode { def __nonzero__(self): return self.IsOk() }
@@ -123,7 +127,6 @@ public:
bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString); bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString);
bool RemoveIcon(); bool RemoveIcon();
bool PopupMenu(wxMenu *menu); bool PopupMenu(wxMenu *menu);
#endif
}; };