From f2641bc2bffc818b44979292a238144bea620cda Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 25 Sep 2004 23:05:13 +0000 Subject: [PATCH] Add some missing methods to match other implementations git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/carbon/taskbarosx.h | 28 ++++++++++++++++------------ src/mac/carbon/taskbar.cpp | 5 +++-- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/include/wx/mac/carbon/taskbarosx.h b/include/wx/mac/carbon/taskbarosx.h index c68e386f83..4576eabc5e 100644 --- a/include/wx/mac/carbon/taskbarosx.h +++ b/include/wx/mac/carbon/taskbarosx.h @@ -22,18 +22,21 @@ class WXDLLEXPORT wxMenu; class WXDLLEXPORT wxTaskBarIcon : public wxTaskBarIconBase { public: - //type of taskbar item to create + //type of taskbar item to create //TODO: currently only DOCK is implemented - enum wxTaskBarIconType - { - DOCK, - STATUSITEM, - MENUEXTRA - }; - + enum wxTaskBarIconType + { + DOCK, + STATUSITEM, + MENUEXTRA + }; + wxTaskBarIcon(const wxTaskBarIconType& nType = DOCK); virtual ~wxTaskBarIcon(); + inline bool IsOk() const { return true; } + inline bool IsIconInstalled() const { return m_iconAdded; } + //TODO: not tested extensively bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString); bool RemoveIcon(); @@ -43,14 +46,15 @@ public: bool PopupMenu(wxMenu *menu); //internal functions - don't call - void SetInternalEvent(void* pEvent); + void SetInternalEvent(void* pEvent); wxMenu* GetCurrentMenu(); protected: - wxTaskBarIconType m_nType; - void* m_pEvent; + wxTaskBarIconType m_nType; + void* m_pEvent; wxMenu* m_pMenu; - + bool m_iconAdded; + DECLARE_DYNAMIC_CLASS(wxTaskBarIcon) }; #endif diff --git a/src/mac/carbon/taskbar.cpp b/src/mac/carbon/taskbar.cpp index 12a2e14164..e59ddefa04 100644 --- a/src/mac/carbon/taskbar.cpp +++ b/src/mac/carbon/taskbar.cpp @@ -103,7 +103,7 @@ pascal OSStatus wxDockEventHandler( EventHandlerCallRef inHandlerCallRef, DEFINE_ONE_SHOT_HANDLER_GETTER( wxDockEventHandler ); wxTaskBarIcon::wxTaskBarIcon(const wxTaskBarIconType& nType) - : m_nType(nType), m_pEvent(NULL), m_pMenu(NULL) + : m_nType(nType), m_pEvent(NULL), m_pMenu(NULL), m_iconAdded(false) { //Register the events that will return the dock menu EventTypeSpec tbEventList[] = { { kEventClassCommand, kEventProcessCommand }, @@ -166,6 +166,7 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) wxASSERT(err == 0); + m_iconAdded = true; return true; #endif } @@ -206,4 +207,4 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu) return true; } -#endif //wxHAS_TASK_BAR_ICON \ No newline at end of file +#endif //wxHAS_TASK_BAR_ICON -- 2.47.2