# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # This 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" (see http://freedesktop.org/wiki/Specifications/systemtray-spec) 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 {Wx::TaskBarIcon} 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. # === Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::TaskBarIconEvent} events. # Event handler methods for events emitted by this class:{Wx::TaskBarIcon#create_popup_menu} or {Wx::TaskBarIcon#get_popup_menu} if all that the application does is that it shows a popup menu in reaction to mouse click. # - {Wx::EvtHandler#evt_taskbar_move}(meth = nil, &block): Process a {Wx::EVT_TASKBAR_MOVE} event. # - {Wx::EvtHandler#evt_taskbar_left_down}(meth = nil, &block): Process a {Wx::EVT_TASKBAR_LEFT_DOWN} event. # - {Wx::EvtHandler#evt_taskbar_left_up}(meth = nil, &block): Process a {Wx::EVT_TASKBAR_LEFT_UP} event. # - {Wx::EvtHandler#evt_taskbar_right_down}(meth = nil, &block): Process a {Wx::EVT_TASKBAR_RIGHT_DOWN} event. # - {Wx::EvtHandler#evt_taskbar_right_up}(meth = nil, &block): Process a {Wx::EVT_TASKBAR_RIGHT_UP} event. # - {Wx::EvtHandler#evt_taskbar_left_dclick}(meth = nil, &block): Process a {Wx::EVT_TASKBAR_LEFT_DCLICK} event. # - {Wx::EvtHandler#evt_taskbar_right_dclick}(meth = nil, &block): Process a {Wx::EVT_TASKBAR_RIGHT_DCLICK} event. # - {Wx::EvtHandler#evt_taskbar_click}(meth = nil, &block): This is a synonym for either EVT_TASKBAR_RIGHT_DOWN or UP depending on the platform, use this event macro to catch the event which should result in the menu being displayed on the current platform. # # === # # Category: {Wx::Miscellaneous} # class TaskBarIcon < EvtHandler # Default constructor. # The iconType is only applicable on {Wx::OSX}/Cocoa. # @param iconType [TaskBarIconType] # @return [TaskBarIcon] def initialize(iconType=Wx::TBI_DEFAULT_TYPE) end # This method is similar to {Wx::Window#destroy} and can be used to schedule the task bar icon object for the delayed destruction: it will be deleted during the next event loop iteration, which allows the task bar icon to process any pending events for it before being destroyed. # @return [void] def destroy; end # Returns true if {Wx::TaskBarIcon#set_icon} was called with no subsequent {Wx::TaskBarIcon#remove_icon}. # @return [true,false] def is_icon_installed; end alias_method :icon_installed?, :is_icon_installed # Returns true if the object initialized successfully. # @return [true,false] def is_ok; end alias_method :ok?, :is_ok # Pops up a menu at the current mouse position. # The events can be handled by a class derived from {Wx::TaskBarIcon}. # It is recommended to override the {Wx::TaskBarIcon#create_popup_menu} or {Wx::TaskBarIcon#get_popup_menu} callback instead of calling this method from event handler, because some ports (e.g. {Wx::Cocoa}) may not implement {Wx::TaskBarIcon#popup_menu} and mouse click events at all. # @param menu [Wx::Menu] # @return [true,false] def popup_menu(menu) end # Removes the icon previously set with {Wx::TaskBarIcon#set_icon}. # @return [true,false] def remove_icon; end # Sets the icon, and optional tooltip text. # @param icon [Wx::BitmapBundle,Wx::Bitmap,Wx::Icon,Wx::Image] # @param tooltip [String] # @return [true,false] def set_icon(icon, tooltip=Wx::EMPTY_STRING) end alias_method :icon=, :set_icon # Returns true if system tray is available in the desktop environment the app runs under. # On Windows and macOS, the tray is always available and this function simply returns true. # On Unix, X11 environment may or may not provide the tray, depending on user's desktop environment. Most modern desktops support the tray via the System Tray Protocol by freedesktop.org (http://freedesktop.org/wiki/Specifications/systemtray-spec). # Tray availability may change during application's lifetime under X11 and so applications shouldn't cache the result. # # {Wx::TaskBarIcon} supports older GNOME 1.2 and KDE 1/2 methods of adding icons to tray, but they are unreliable and this method doesn't detect them. # @return [true,false] def self.is_available; end protected # Called by the library when the user requests popup menu if {Wx::TaskBarIcon#get_popup_menu} is not overridden. # Override this function in order to provide popup menu associated with the icon if you don't want to override {Wx::TaskBarIcon#get_popup_menu}, i.e. if you prefer creating a new menu every time instead of reusing the same menu. # If {Wx::TaskBarIcon#create_popup_menu} 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. If you don't want the menu to be destroyed when it is dismissed, override {Wx::TaskBarIcon#get_popup_menu} instead. # @return [Wx::Menu] def create_popup_menu; end end # TaskBarIcon end