# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx::RBN # Top-level control in a ribbon user interface. # Serves as a tabbed container for {Wx::RBN::RibbonPage} - a ribbon user interface typically has a ribbon bar, which contains one or more {Wx::RibbonPages}, which in turn each contain one or more {Wx::RibbonPanels}, which in turn contain controls. # While a {Wx::RBN::RibbonBar} has tabs similar to a {Wx::Notebook}, it does not follow the same API for adding pages. Containers like {Wx::Notebook} can contain any type of window as a page, hence the normal procedure is to create the sub-window and then call {Wx::BookCtrlBase#add_page}. As {Wx::RBN::RibbonBar} can only have {Wx::RBN::RibbonPage} as children (and a {Wx::RBN::RibbonPage} can only have a {Wx::RBN::RibbonBar} as parent), when a page is created, it is automatically added to the bar - there is no AddPage equivalent to call. # After all pages have been created, and all controls and panels placed on those pages, {Wx::RBN::RibbonBar#realize} must be called. # # === Styles # # This class supports the following styles: # # - {Wx::RBN::RibbonBarOption::RIBBON_BAR_DEFAULT_STYLE}: Defined as {Wx::RBN::RibbonBarOption::RIBBON_BAR_FLOW_HORIZONTAL} | {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_PAGE_LABELS} | {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS} | {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_TOGGLE_BUTTON} | {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_HELP_BUTTON}. # # - {Wx::RBN::RibbonBarOption::RIBBON_BAR_FOLDBAR_STYLE}: Defined as {Wx::RBN::RibbonBarOption::RIBBON_BAR_FLOW_VERTICAL} | {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_PAGE_ICONS} | {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS} | {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_PANEL_MINIMISE_BUTTONS} # # - {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_PAGE_LABELS}: Causes labels to be shown on the tabs in the ribbon bar. # # - {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_PAGE_ICONS}: Causes icons to be shown on the tabs in the ribbon bar. # # - {Wx::RBN::RibbonBarOption::RIBBON_BAR_FLOW_HORIZONTAL}: Causes panels within pages to stack horizontally. # # - {Wx::RBN::RibbonBarOption::RIBBON_BAR_FLOW_VERTICAL}: Causes panels within pages to stack vertically. # # - {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS}: Causes extension buttons to be shown on panels (where the panel has such a button). # # - {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_PANEL_MINIMISE_BUTTONS}: Causes minimise buttons to be shown on panels (where the panel has such a button). # # - {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_TOGGLE_BUTTON}: Causes a toggle button to appear on the ribbon bar at top-right corner. This style is new since wxWidgets 2.9.5. # # - {Wx::RBN::RibbonBarOption::RIBBON_BAR_SHOW_HELP_BUTTON}: Causes a help button to appear on the ribbon bar at the top-right corner. This style is new since wxWidgets 2.9.5. # # === Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::RBN::RibbonBarEvent} events. # Event handler methods for events emitted by this class: # # - {Wx::EvtHandler#evt_ribbonbar_page_changed}(id, meth = nil, &block): Triggered after the transition from one page being active to a different page being active. # # - {Wx::EvtHandler#evt_ribbonbar_page_changing}(id, meth = nil, &block): Triggered prior to the transition from one page being active to a different page being active, and can veto the change. # # - {Wx::EvtHandler#evt_ribbonbar_tab_middle_down}(id, meth = nil, &block): Triggered when the middle mouse button is pressed on a tab. # # - {Wx::EvtHandler#evt_ribbonbar_tab_middle_up}(id, meth = nil, &block): Triggered when the middle mouse button is released on a tab. # # - {Wx::EvtHandler#evt_ribbonbar_tab_right_down}(id, meth = nil, &block): Triggered when the right mouse button is pressed on a tab. # # - {Wx::EvtHandler#evt_ribbonbar_tab_right_up}(id, meth = nil, &block): Triggered when the right mouse button is released on a tab. # # - {Wx::EvtHandler#evt_ribbonbar_tab_left_dclick}(id, meth = nil, &block): Triggered when the left mouse button is double clicked on a tab. # # - {Wx::EvtHandler#evt_ribbonbar_toggled}(id, meth = nil, &block): Triggered when the button triggering the ribbon bar is clicked. This event is new since wxWidgets 2.9.5. # # - {Wx::EvtHandler#evt_ribbonbar_help_click}(id, meth = nil, &block): Triggered when the help button is clicked. This even is new since wxWidgets 2.9.5. # # === # # Category: Ribbon User Interface # @see Wx::RBN::RibbonPage # # @see Wx::RBN::RibbonPanel # # class RibbonBar < RibbonControl # @overload initialize() # Default constructor. # With this constructor, {Wx::RBN::RibbonBar#create} should be called in order to create the ribbon bar. # @return [Wx::RBN::RibbonBar] # @overload initialize(parent, id=Wx::StandardID::ID_ANY, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::RBN::RibbonBarOption::RIBBON_BAR_DEFAULT_STYLE) # Construct a ribbon bar with the given parameters. # @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 [Wx::RBN::RibbonBar] def initialize(*args) end # Create a ribbon bar in two-step ribbon 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::StandardID::ID_ANY, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::RBN::RibbonBarOption::RIBBON_BAR_DEFAULT_STYLE) end # Set the margin widths (in pixels) on the left and right sides of the tab bar region of the ribbon bar. # These margins will be painted with the tab background, but tabs and scroll buttons will never be painted in the margins. # The left margin could be used for rendering something equivalent to the "Office Button", though this is not currently implemented. The right margin could be used for rendering a help button, and/or MDI buttons, but again, this is not currently implemented. # @param left [Integer] # @param right [Integer] # @return [void] def set_tab_ctrl_margins(left, right) end # Set the art provider to be used be the ribbon bar. # Also sets the art provider on all current {Wx::RBN::RibbonPage} children, and any {Wx::RBN::RibbonPage} children added in the future. # Note that unlike most other ribbon controls, the ribbon bar creates a default art provider when initialised, so an explicit call to {Wx::RBN::RibbonBar#set_art_provider} is not required if the default art provider is sufficient. Also, unlike other ribbon controls, the ribbon bar takes ownership of the given pointer, and will delete it when the art provider is changed or the bar is destroyed. If this behaviour is not desired, then clone the art provider before setting it. # @param art [Wx::RBN::RibbonArtProvider] # @return [void] def set_art_provider(art) end alias_method :art_provider=, :set_art_provider # @overload set_active_page(page) # Set the active page by index, without triggering any events. # true if the specified page is now active, false if it could not be activated (for example because the page index is invalid). # @param page [Integer] The zero-based index of the page to activate. # @return [true,false] # @overload set_active_page(page) # Set the active page, without triggering any events. # true if the specified page is now active, false if it could not be activated (for example because the given page is not a child of the ribbon bar). # @param page [Wx::RBN::RibbonPage] The page to activate. # @return [true,false] def set_active_page(*args) end alias_method :active_page=, :set_active_page # Get the index of the active page. # In the rare case of no page being active, -1 is returned. # @return [Integer] def get_active_page; end alias_method :active_page, :get_active_page # Get a page by index. # NULL will be returned if the given index is out of range. # @param n [Integer] # @return [Wx::RBN::RibbonPage] def get_page(n) end alias_method :page, :get_page # Get the number of pages in this bar. # @return [Integer] def get_page_count; end alias_method :page_count, :get_page_count # Dismiss the expanded panel of the currently active page. # Calls and returns the value from {Wx::RBN::RibbonPage#dismiss_expanded_panel} for the currently active page, or false if there is no active page. # @return [true,false] def dismiss_expanded_panel; end # Returns the number for a given ribbon bar page. # The number can be used in other ribbon bar calls. # @param page [Wx::RBN::RibbonPage] # @return [Integer] def get_page_number(page) end alias_method :page_number, :get_page_number # Delete a single page from this ribbon bar. # The user must call {Wx::RBN::RibbonBar#realize} after one (or more) calls to this function. # @param n [Integer] # @return [void] def delete_page(n) end # Delete all pages from the ribbon bar. # @return [void] def clear_pages; end # Indicates whether the tab for the given page is shown to the user or not. # By default all page tabs are shown. # @param page [Integer] # @return [true,false] def is_page_shown(page) end alias_method :page_shown?, :is_page_shown # Show or hide the tab for a given page. # After showing or hiding a tab, you need to call {Wx::RBN::RibbonBar#realize}. If you hide the tab for the currently active page (GetActivePage) then you should call SetActivePage to activate a different page. # @param page [Integer] # @param show_tab [true,false] # @return [void] def show_page(page, show_tab=true) end # Hides the tab for a given page. # Equivalent to ShowPage(page, false). # @param page [Integer] # @return [void] def hide_page(page) end # Indicates whether a tab is currently highlighted. # # @see Wx::RBN::RibbonBar#add_page_highlight # @param page [Integer] # @return [true,false] def is_page_highlighted(page) end alias_method :page_highlighted?, :is_page_highlighted # Highlight the specified tab. # Highlighted tabs have a colour between that of the active tab and a tab over which the mouse is hovering. This can be used to make a tab (usually temporarily) more noticeable to the user. # @param page [Integer] # @param highlight [true,false] # @return [void] def add_page_highlight(page, highlight=true) end # Changes a tab to not be highlighted. # # @see Wx::RBN::RibbonBar#add_page_highlight # @param page [Integer] # @return [void] def remove_page_highlight(page) end # @overload show_panels(mode) # Shows or hide the panel area of the ribbon bar according to the given display mode. # @param mode [RibbonDisplayMode] # @return [void] # @overload show_panels(show=true) # Shows or hides the panel area of the ribbon bar. # If the panel area is hidden, then only the tab of the ribbon bar will be shown. This is useful for giving the user more screen space to work with when he/she doesn't need to see the ribbon's options. # If the panel is currently shown, this method pins it, use the other overload of this method to specify the exact panel display mode to avoid it. # @param show [true,false] # @return [void] def show_panels(*args) end # Hides the panel area of the ribbon bar. # This method behaves like {Wx::RBN::RibbonBar#show_panels} with false argument. # @return [void] def hide_panels; end # Indicates whether the panel area of the ribbon bar is shown. # # @see Wx::RBN::RibbonBar#show_panels # @return [true,false] def are_panels_shown; end # Returns the current display mode of the panel area. # # @see Wx::RBN::RibbonBar#show_panels # @return [RibbonDisplayMode] def get_display_mode; end alias_method :display_mode, :get_display_mode # Perform initial layout and size calculations of the bar and its children. # This must be called after all of the bar's children have been created (and their children created, etc.) - if it is not, then windows may not be laid out or sized correctly. # Also calls {Wx::RBN::RibbonPage#realize} on each child page. # @return [true,false] def realize; end end # RibbonBar end