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:
@@ -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,14 +46,15 @@ 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)
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@@ -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
|
||||||
}
|
}
|
||||||
@@ -206,4 +207,4 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //wxHAS_TASK_BAR_ICON
|
#endif //wxHAS_TASK_BAR_ICON
|
||||||
|
Reference in New Issue
Block a user