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();
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
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 },
wxASSERT(err == 0);
+ m_iconAdded = true;
return true;
#endif
}
return true;
}
-#endif //wxHAS_TASK_BAR_ICON
\ No newline at end of file
+#endif //wxHAS_TASK_BAR_ICON