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
This commit is contained in:
Robin Dunn
2004-09-25 23:05:13 +00:00
parent 8998887c22
commit f2641bc2bf
2 changed files with 19 additions and 14 deletions

View File

@@ -22,18 +22,21 @@ class WXDLLEXPORT wxMenu;
class WXDLLEXPORT wxTaskBarIcon : public wxTaskBarIconBase class WXDLLEXPORT wxTaskBarIcon : public wxTaskBarIconBase
{ {
public: public:
//type of taskbar item to create //type of taskbar item to create
//TODO: currently only DOCK is implemented //TODO: currently only DOCK is implemented
enum wxTaskBarIconType enum wxTaskBarIconType
{ {
DOCK, DOCK,
STATUSITEM, STATUSITEM,
MENUEXTRA MENUEXTRA
}; };
wxTaskBarIcon(const wxTaskBarIconType& nType = DOCK); wxTaskBarIcon(const wxTaskBarIconType& nType = DOCK);
virtual ~wxTaskBarIcon(); virtual ~wxTaskBarIcon();
inline bool IsOk() const { return true; }
inline bool IsIconInstalled() const { return m_iconAdded; }
//TODO: not tested extensively //TODO: not tested extensively
bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString); bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString);
bool RemoveIcon(); bool RemoveIcon();
@@ -43,13 +46,14 @@ public:
bool PopupMenu(wxMenu *menu); bool PopupMenu(wxMenu *menu);
//internal functions - don't call //internal functions - don't call
void SetInternalEvent(void* pEvent); void SetInternalEvent(void* pEvent);
wxMenu* GetCurrentMenu(); wxMenu* GetCurrentMenu();
protected: protected:
wxTaskBarIconType m_nType; wxTaskBarIconType m_nType;
void* m_pEvent; void* m_pEvent;
wxMenu* m_pMenu; wxMenu* m_pMenu;
bool m_iconAdded;
DECLARE_DYNAMIC_CLASS(wxTaskBarIcon) DECLARE_DYNAMIC_CLASS(wxTaskBarIcon)
}; };

View File

@@ -103,7 +103,7 @@ pascal OSStatus wxDockEventHandler( EventHandlerCallRef inHandlerCallRef,
DEFINE_ONE_SHOT_HANDLER_GETTER( wxDockEventHandler ); DEFINE_ONE_SHOT_HANDLER_GETTER( wxDockEventHandler );
wxTaskBarIcon::wxTaskBarIcon(const wxTaskBarIconType& nType) 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 //Register the events that will return the dock menu
EventTypeSpec tbEventList[] = { { kEventClassCommand, kEventProcessCommand }, EventTypeSpec tbEventList[] = { { kEventClassCommand, kEventProcessCommand },
@@ -166,6 +166,7 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
wxASSERT(err == 0); wxASSERT(err == 0);
m_iconAdded = true;
return true; return true;
#endif #endif
} }