# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx::RBN # Flags for button bar button size and state. # # Buttons on a ribbon button bar can each come in three sizes: small, medium, and large. In some places this is called the size class, and the term size used for the pixel width and height associated with a particular size class. # A button can also be in zero or more hovered or active states, or in the disabled state. # class RibbonButtonBarButtonState < Wx::Enum # Button is small (the interpretation of small is dependent upon the art provider, but it will be smaller than medium). # RIBBON_BUTTONBAR_BUTTON_SMALL = Wx::RBN::RibbonButtonBarButtonState.new(0) # Button is medium sized (the interpretation of medium is dependent upon the art provider, but it will be between small and large). # RIBBON_BUTTONBAR_BUTTON_MEDIUM = Wx::RBN::RibbonButtonBarButtonState.new(1) # Button is large (the interpretation of large is dependent upon the art provider, but it will be larger than medium). # RIBBON_BUTTONBAR_BUTTON_LARGE = Wx::RBN::RibbonButtonBarButtonState.new(2) # A mask to extract button size from a combination of flags. # RIBBON_BUTTONBAR_BUTTON_SIZE_MASK = Wx::RBN::RibbonButtonBarButtonState.new(3) # The normal (non-dropdown) region of the button is being hovered over by the mouse cursor. # RIBBON_BUTTONBAR_BUTTON_NORMAL_HOVERED = Wx::RBN::RibbonButtonBarButtonState.new(8) # The dropdown region of the button is being hovered over by the mouse cursor. # RIBBON_BUTTONBAR_BUTTON_DROPDOWN_HOVERED = Wx::RBN::RibbonButtonBarButtonState.new(16) # A mask to extract button hover state from a combination of flags. # RIBBON_BUTTONBAR_BUTTON_HOVER_MASK = Wx::RBN::RibbonButtonBarButtonState.new(24) # The normal (non-dropdown) region of the button is being pressed. # RIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE = Wx::RBN::RibbonButtonBarButtonState.new(32) # The dropdown region of the button is being pressed. # RIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE = Wx::RBN::RibbonButtonBarButtonState.new(64) # A mask to extract active flags. # RIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK = Wx::RBN::RibbonButtonBarButtonState.new(96) # The button is disabled. # RIBBON_BUTTONBAR_BUTTON_DISABLED = Wx::RBN::RibbonButtonBarButtonState.new(128) # The button is a toggle button which is currently in the toggled state. # RIBBON_BUTTONBAR_BUTTON_TOGGLED = Wx::RBN::RibbonButtonBarButtonState.new(256) # A mask to extract button state from a combination of flags. # RIBBON_BUTTONBAR_BUTTON_STATE_MASK = Wx::RBN::RibbonButtonBarButtonState.new(504) end # RibbonButtonBarButtonState # # EVT_RIBBONBUTTONBAR_CLICKED = 10440 # # EVT_RIBBONBUTTONBAR_DROPDOWN_CLICKED = 10441 # A ribbon button bar is similar to a traditional toolbar. # It contains one or more buttons (button bar buttons, not {Wx::Buttons}), each of which has a label and an icon. It differs from a {Wx::RBN::RibbonToolBar} in several ways: # - Individual buttons can grow and contract. # - Buttons have labels as well as bitmaps. # - Bitmaps are typically larger (at least 32x32 pixels) on a button bar compared to a tool bar (which typically has 16x15). # - There is no grouping of buttons on a button bar # - A button bar typically has a border around each individual button, whereas a tool bar typically has a border around each group of buttons. # # === Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::RBN::RibbonButtonBarEvent} events. # Event handler methods for events emitted by this class: # - {Wx::EvtHandler#evt_ribbonbuttonbar_clicked}(id, meth = nil, &block): Triggered when the normal (non-dropdown) region of a button on the button bar is clicked. # - {Wx::EvtHandler#evt_ribbonbuttonbar_dropdown_clicked}(id, meth = nil, &block): Triggered when the dropdown region of a button on the button bar is clicked. {Wx::RBN::RibbonButtonBarEvent#popup_menu} should be called by the event handler if it wants to display a popup menu (which is what most dropdown buttons should be doing). # # === # # Category: Ribbon User Interface # class RibbonButtonBar < RibbonControl # @overload initialize() # Default constructor. # With this constructor, {Wx::RBN::RibbonButtonBar#create} should be called in order to create the button bar. # @return [RibbonButtonBar] # @overload initialize(parent, id=Wx::ID_ANY, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0) # Construct a ribbon button bar with the given parameters. # @param parent [Wx::Window] Parent window for the button bar (typically a {Wx::RBN::RibbonPanel}). # @param id [Integer] An identifier for the button bar. {Wx::StandardID::ID_ANY} is taken to mean a default. # @param pos [Array(Integer, Integer), Wx::Point] Initial position of the button bar. # @param size [Array(Integer, Integer), Wx::Size] Initial size of the button bar. # @param style [Integer] Button bar style, currently unused. # @return [RibbonButtonBar] def initialize(*args) end # Create a button bar in two-step button bar construction. # Should only be called when the default constructor is used, and arguments have the same meaning as in the full constructor. # @param parent [Wx::Window] # @param id [Integer] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @return [true,false] def create(parent, id=Wx::ID_ANY, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0) end # @overload add_button(button_id, label, bitmap, help_string, kind=Wx::RIBBON_BUTTON_NORMAL) # Add a button to the button bar (simple version). # @param button_id [Integer] # @param label [String] # @param bitmap [Wx::Bitmap] # @param help_string [String] # @param kind [RibbonButtonKind] # @return [Integer] # @overload add_button(button_id, label, bitmap, bitmap_small=Wx::NULL_BITMAP, bitmap_disabled=Wx::NULL_BITMAP, bitmap_small_disabled=Wx::NULL_BITMAP, kind=Wx::RIBBON_BUTTON_NORMAL, help_string=Wx::EMPTY_STRING) # Add a button to the button bar. # An opaque pointer which can be used only with other button bar methods. # @see Wx::RBN::RibbonButtonBar#add_dropdown_button # # @see Wx::RBN::RibbonButtonBar#add_hybrid_button # # @see Wx::RBN::RibbonButtonBar#add_toggle_button # @param button_id [Integer] ID of the new button (used for event callbacks). # @param label [String] Label of the new button. # @param bitmap [Wx::Bitmap] Large bitmap of the new button. Must be the same size as all other large bitmaps used on the button bar. # @param bitmap_small [Wx::Bitmap] Small bitmap of the new button. If left as null, then a small bitmap will be automatically generated. Must be the same size as all other small bitmaps used on the button bar. # @param bitmap_disabled [Wx::Bitmap] Large bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap. # @param bitmap_small_disabled [Wx::Bitmap] Small bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap_small. # @param kind [RibbonButtonKind] The kind of button to add. # @param help_string [String] The UI help string to associate with the new button. # @return [Integer] def add_button(*args) end # Add a dropdown button to the button bar (simple version). # # @see Wx::RBN::RibbonButtonBar#add_button # @param button_id [Integer] # @param label [String] # @param bitmap [Wx::Bitmap] # @param help_string [String] # @return [Integer] def add_dropdown_button(button_id, label, bitmap, help_string=Wx::EMPTY_STRING) end # Add a hybrid button to the button bar (simple version). # # @see Wx::RBN::RibbonButtonBar#add_button # @param button_id [Integer] # @param label [String] # @param bitmap [Wx::Bitmap] # @param help_string [String] # @return [Integer] def add_hybrid_button(button_id, label, bitmap, help_string=Wx::EMPTY_STRING) end # Add a toggle button to the button bar (simple version). # # @see Wx::RBN::RibbonButtonBar#add_button # @param button_id [Integer] # @param label [String] # @param bitmap [Wx::Bitmap] # @param help_string [String] # @return [Integer] def add_toggle_button(button_id, label, bitmap, help_string=Wx::EMPTY_STRING) end # @overload insert_button(pos, button_id, label, bitmap, help_string, kind=Wx::RIBBON_BUTTON_NORMAL) # Inserts a button to the button bar (simple version) at the given position. # # @see Wx::RBN::RibbonButtonBar#add_button # @param pos [Integer] # @param button_id [Integer] # @param label [String] # @param bitmap [Wx::Bitmap] # @param help_string [String] # @param kind [RibbonButtonKind] # @return [Integer] # @overload insert_button(pos, button_id, label, bitmap, bitmap_small=Wx::NULL_BITMAP, bitmap_disabled=Wx::NULL_BITMAP, bitmap_small_disabled=Wx::NULL_BITMAP, kind=Wx::RIBBON_BUTTON_NORMAL, help_string=Wx::EMPTY_STRING) # Insert a button to the button bar at the given position. # An opaque pointer which can be used only with other button bar methods. # @see Wx::RBN::RibbonButtonBar#insert_dropdown_button # # @see Wx::RBN::RibbonButtonBar#insert_hybrid_button # # @see Wx::RBN::RibbonButtonBar#insert_toggle_button # # @see Wx::RBN::RibbonButtonBar#add_button # @param pos [Integer] Position of the new button in the button bar. # @param button_id [Integer] ID of the new button (used for event callbacks). # @param label [String] Label of the new button. # @param bitmap [Wx::Bitmap] Large bitmap of the new button. Must be the same size as all other large bitmaps used on the button bar. # @param bitmap_small [Wx::Bitmap] Small bitmap of the new button. If left as null, then a small bitmap will be automatically generated. Must be the same size as all other small bitmaps used on the button bar. # @param bitmap_disabled [Wx::Bitmap] Large bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap. # @param bitmap_small_disabled [Wx::Bitmap] Small bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap_small. # @param kind [RibbonButtonKind] The kind of button to add. # @param help_string [String] The UI help string to associate with the new button. # @return [Integer] def insert_button(*args) end # Inserts a dropdown button to the button bar (simple version) at the given position. # # @see Wx::RBN::RibbonButtonBar#insert_button # # @see Wx::RBN::RibbonButtonBar#add_dropdown_button # # @see Wx::RBN::RibbonButtonBar#add_button # @param pos [Integer] # @param button_id [Integer] # @param label [String] # @param bitmap [Wx::Bitmap] # @param help_string [String] # @return [Integer] def insert_dropdown_button(pos, button_id, label, bitmap, help_string=Wx::EMPTY_STRING) end # Inserts a hybrid button to the button bar (simple version) at the given position. # # @see Wx::RBN::RibbonButtonBar#insert_button # # @see Wx::RBN::RibbonButtonBar#add_hybrid_button # # @see Wx::RBN::RibbonButtonBar#add_button # @param pos [Integer] # @param button_id [Integer] # @param label [String] # @param bitmap [Wx::Bitmap] # @param help_string [String] # @return [Integer] def insert_hybrid_button(pos, button_id, label, bitmap, help_string=Wx::EMPTY_STRING) end # Inserts a toggle button to the button bar (simple version) at the given position. # # @see Wx::RBN::RibbonButtonBar#insert_button # # @see Wx::RBN::RibbonButtonBar#add_toggle_button # # @see Wx::RBN::RibbonButtonBar#add_button # @param pos [Integer] # @param button_id [Integer] # @param label [String] # @param bitmap [Wx::Bitmap] # @param help_string [String] # @return [Integer] def insert_toggle_button(pos, button_id, label, bitmap, help_string=Wx::EMPTY_STRING) end # Returns the number of buttons in this button bar. # @return [Integer] def get_button_count; end alias_method :button_count, :get_button_count # Set the client data associated with a button. # Please, note that you cannot use both client object and client data. # @param item [Integer] # @param data [Object] # @return [void] def set_item_client_data(item, data) end # Get the client data associated with a button. # @param item [Integer] # @return [Object] def get_item_client_data(item) end alias_method :item_client_data, :get_item_client_data # Returns the N-th button of the bar. # # @see Wx::RBN::RibbonButtonBar#get_button_count # @param n [Integer] # @return [Integer] def get_item(n) end alias_method :item, :get_item # Returns the items's rect with coordinates relative to the button bar's parent, or a default-constructed rect if the tool is not found. # @param button_id [Integer] ID of the button in question. # @return [Wx::Rect] def get_item_rect(button_id) end alias_method :item_rect, :get_item_rect # Calculate button layouts and positions. # Must be called after buttons are added to the button bar, as otherwise the newly added buttons will not be displayed. In normal situations, it will be called automatically when {Wx::RBN::RibbonBar#realize} is called. # @return [true,false] def realize; end # Delete all buttons from the button bar. # # @see Wx::RBN::RibbonButtonBar#delete_button # @return [void] def clear_buttons; end # Delete a single button from the button bar. # The corresponding button is deleted by this function, so any pointers to it previously obtained by {Wx::RBN::RibbonButtonBar#get_item} or {Wx::RBN::RibbonButtonBar#get_item_by_id} become invalid. # @see Wx::RBN::RibbonButtonBar#clear_buttons # @param button_id [Integer] # @return [true,false] def delete_button(button_id) end # Enable or disable a single button on the bar. # @param button_id [Integer] ID of the button to enable or disable. # @param enable [true,false] true to enable the button, false to disable it. # @return [void] def enable_button(button_id, enable=true) end # Set a toggle button to the checked or unchecked state. # @param button_id [Integer] ID of the toggle button to manipulate. # @param checked [true,false] true to set the button to the toggled/pressed/checked state, false to set it to the untoggled/unpressed/unchecked state. # @return [void] def toggle_button(button_id, checked) end # Changes the bitmap of an existing button. # @param button_id [Integer] ID of the button to manipulate. # @param bitmap [Wx::Bitmap] Large bitmap of the new button. Must be the same size as all other large bitmaps used on the button bar. # @param bitmap_small [Wx::Bitmap] Small bitmap of the new button. If left as null, then a small bitmap will be automatically generated. Must be the same size as all other small bitmaps used on the button bar. # @param bitmap_disabled [Wx::Bitmap] Large bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap. # @param bitmap_small_disabled [Wx::Bitmap] Small bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap_small. # @return [void] def set_button_icon(button_id, bitmap, bitmap_small=Wx::NULL_BITMAP, bitmap_disabled=Wx::NULL_BITMAP, bitmap_small_disabled=Wx::NULL_BITMAP) end # Changes the label text of an existing button. # If text size has changed, {Wx::RBN::RibbonButtonBar#realize} must be called on the top level {Wx::RBN::RibbonBar} object to recalculate panel sizes. Use {Wx::RBN::RibbonButtonBar#set_button_text_min_width} to avoid calling {Wx::RBN::RibbonButtonBar#realize} after every change. # @see Wx::RBN::RibbonButtonBar#set_button_text_min_width # @param button_id [Integer] ID of the button to manipulate. # @param label [String] New label of the button. # @return [void] def set_button_text(button_id, label) end # @overload set_button_text_min_width(button_id, min_width_medium, min_width_large) # Sets the minimum width of the button label, to indicate to the {Wx::RBN::RibbonArtProvider} layout mechanism that this is the minimum required size. # You have to call {Wx::RBN::RibbonButtonBar#realize} after calling this function to apply the given minimum width. # # This function is used together with {Wx::RBN::RibbonButtonBar#set_button_text} to change button labels on the fly without modifying the button bar layout. # @see Wx::RBN::RibbonButtonBar#set_button_text # @param button_id [Integer] ID of the button to manipulate. # @param min_width_medium [Integer] Requested minimum width of the button text in pixel if the button is medium size. # @param min_width_large [Integer] Requested minimum width of the button text in pixel if the button is large size. # @return [void] # @overload set_button_text_min_width(button_id, label) # Sets the minimum width of the button label, to indicate to the {Wx::RBN::RibbonArtProvider} layout mechanism that this is the minimum required size. # You have to call {Wx::RBN::RibbonButtonBar#realize} after calling this function to apply the given minimum width. # # This function is used together with {Wx::RBN::RibbonButtonBar#set_button_text} to change button labels on the fly without modifying the button bar layout. # @see Wx::RBN::RibbonButtonBar#set_button_text # @param button_id [Integer] ID of the button to manipulate. # @param label [String] The minimum width is set to the width of this label. # @return [void] def set_button_text_min_width(*args) end # Sets the minimum size class of a ribbon button. # You have to call {Wx::RBN::RibbonButtonBar#realize} after calling this function to apply the given minimum size. # @param button_id [Integer] ID of the button to manipulate. # @param min_size_class [RibbonButtonBarButtonState] The minimum size-class of the button. Buttons on a button bar can have three distinct sizes: {Wx::RBN::RibbonButtonBarButtonState::RIBBON_BUTTONBAR_BUTTON_SMALL}, {Wx::RBN::RibbonButtonBarButtonState::RIBBON_BUTTONBAR_BUTTON_MEDIUM}, and {Wx::RBN::RibbonButtonBarButtonState::RIBBON_BUTTONBAR_BUTTON_LARGE}. # @return [void] def set_button_min_size_class(button_id, min_size_class) end # Sets the maximum size class of a ribbon button. # You have to call {Wx::RBN::RibbonButtonBar#realize} after calling this function to apply the given maximum size. # @param button_id [Integer] ID of the button to manipulate. # @param max_size_class [RibbonButtonBarButtonState] The maximum size-class of the button. Buttons on a button bar can have three distinct sizes: {Wx::RBN::RibbonButtonBarButtonState::RIBBON_BUTTONBAR_BUTTON_SMALL}, {Wx::RBN::RibbonButtonBarButtonState::RIBBON_BUTTONBAR_BUTTON_MEDIUM}, and {Wx::RBN::RibbonButtonBarButtonState::RIBBON_BUTTONBAR_BUTTON_LARGE}. # @return [void] def set_button_max_size_class(button_id, max_size_class) end # Returns the active item of the button bar or NULL if there is none. # The active button is the one being clicked. # @return [Integer] def get_active_item; end alias_method :active_item, :get_active_item # Returns the hovered item of the button bar or NULL if there is none. # The hovered button is the one the mouse is over. # @return [Integer] def get_hovered_item; end alias_method :hovered_item, :get_hovered_item # Indicates whether tooltips are shown for disabled buttons. # By default they are not shown. # @param show [true,false] # @return [void] def set_show_tool_tips_for_disabled(show) end alias_method :show_tool_tips_for_disabled=, :set_show_tool_tips_for_disabled # Sets whether tooltips should be shown for disabled buttons or not. # You may wish to show it to explain why a button is disabled or what it normally does when enabled. # @return [true,false] def get_show_tool_tips_for_disabled; end alias_method :show_tool_tips_for_disabled, :get_show_tool_tips_for_disabled end # RibbonButtonBar end