wxtaskbariconthis class represents a taskbar icon. a taskbar icon is an icon that appears in the 'system tray' and responds to mouse clicks, optionally with a tooltip above it to help provide information. x window system note under x window system, the window manager must support either the system tray protocol by freedesktop.org (wms used by modern desktop environments such as gnome >= 2, kde >= 3 and xfce >= 4 all do) or the older methods used in gnome 1.2 and kde 1 and 2. if it doesn't, the icon will appear as a toplevel window on user's desktop. because not all window managers have system tray, there's no guarantee that wxtaskbaricon will work correctly under x window system and so the applications should use it only as an optional component of their user interface. the user should be required to explicitly enable the taskbar icon on unix, it shouldn't be on by default. derived from include files <wx/taskbar.h> event handling to process input from a taskbar icon, use the following event handler macros to direct input to member functions that take a wxtaskbariconevent argument. note that not all ports are required to send these events and so it's better to override createpopupmenu if all that the application does is that it shows a popup menu in reaction to mouse click.
wxtaskbaricon::wxtaskbaricon
wxtaskbaricon::wxtaskbariconwxtaskbaricon() default constructor.
wxtaskbaricon::~wxtaskbaricon~wxtaskbaricon() destroys the wxtaskbaricon object, removing the icon if not already removed.
wxtaskbaricon::createpopupmenuvirtual wxmenu* createpopupmenu() this method is called by the library when the user requests popup menu (on windows and unix platforms, this is when the user right-clicks the icon). override this function in order to provide popup menu associated with the icon. if createpopupmenu returns null (this happens by default), no menu is shown, otherwise the menu is displayed and then deleted by the library as soon as the user dismisses it. the events can be handled by a class derived from wxtaskbaricon.
wxtaskbaricon::isiconinstalledbool isiconinstalled() returns true if seticon was called with no subsequent removeicon.
wxtaskbaricon::isokbool isok() returns true if the object initialized successfully.
wxtaskbaricon::popupmenubool popupmenu(wxmenu* menu) pops up a menu at the current mouse position. the events can be handled by a class derived from wxtaskbaricon. note it is recommended to override createpopupmenu callback instead of calling this method from event handler, because some ports (e.g. wxcocoa) may not implement popupmenu and mouse click events at all.
wxtaskbaricon::removeiconbool removeicon() removes the icon previously set with seticon.
wxtaskbaricon::seticonbool seticon(const wxicon& icon, const wxstring& tooltip) sets the icon, and optional tooltip text.
|