# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # # EVT_TREEBOOK_PAGE_CHANGED = 10087 # # EVT_TREEBOOK_PAGE_CHANGING = 10086 # # EVT_TREEBOOK_NODE_COLLAPSED = 10088 # # EVT_TREEBOOK_NODE_EXPANDED = 10089 # This class is an extension of the {Wx::Notebook} class that allows a tree structured set of pages to be shown in a control. # A classic example is a netscape preferences dialog that shows a tree of preference sections on the left and select section page on the right. # To use the class simply create it and populate with pages using {Wx::Treebook#insert_page}, {Wx::Treebook#insert_sub_page}, {Wx::Treebook#add_page}, {Wx::Treebook#add_sub_page}. # If your tree is no more than 1 level in depth then you could simply use {Wx::Treebook#add_page} and {Wx::Treebook#add_sub_page} to sequentially populate your tree by adding at every step a page or a subpage to the end of the tree. # === Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::BookCtrlEvent} events. # Event handler methods for events emitted by this class: # - {Wx::EvtHandler#evt_treebook_page_changed}(id, meth = nil, &block): The page selection was changed. Processes a {Wx::EVT_TREEBOOK_PAGE_CHANGED} event. # - {Wx::EvtHandler#evt_treebook_page_changing}(id, meth = nil, &block): The page selection is about to be changed. Processes a {Wx::EVT_TREEBOOK_PAGE_CHANGING} event. This event can be {Wx::vetoed}. # - {Wx::EvtHandler#evt_treebook_node_collapsed}(id, meth = nil, &block): The page node is going to be collapsed. Processes a {Wx::EVT_TREEBOOK_NODE_COLLAPSED} event. # - {Wx::EvtHandler#evt_treebook_node_expanded}(id, meth = nil, &block): The page node is going to be expanded. Processes a {Wx::EVT_TREEBOOK_NODE_EXPANDED} event. # # === # # Category: Book Controls # @see Wx::BookCtrl # @see Wx::BookCtrlEvent # @see Wx::Notebook # @see Wx::TreeCtrl # @see Wx::ImageList # @see wxBookCtrl Overview # @see Notebook Sample # # class Treebook < BookCtrlBase # @overload initialize() # Default constructor. # @return [Treebook] # @overload initialize(parent, id, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::BK_DEFAULT, name=Wx::EMPTY_STRING) # Creates an empty {Wx::Treebook}. # @param parent [Wx::Window] The parent window. Must be non-NULL. # @param id [Integer] The window identifier. # @param pos [Array(Integer, Integer), Wx::Point] The window position. # @param size [Array(Integer, Integer), Wx::Size] The window size. # @param style [Integer] The window style. See {Wx::Notebook}. # @param name [String] The name of the control (used only under Motif). # @return [Treebook] def initialize(*args) end # Adds a new page. # The page is placed at the topmost level after all other pages. NULL could be specified for page to create an empty page. # @param page [Wx::Window] # @param text [String] # @param bSelect [true,false] # @param imageId [Integer] # @return [true,false] def add_page(page, text, bSelect=false, imageId=Wx::NOT_FOUND) end # Adds a new child-page to the last top-level page. # NULL could be specified for page to create an empty page. # @param page [Wx::Window] # @param text [String] # @param bSelect [true,false] # @param imageId [Integer] # @return [true,false] def add_sub_page(page, text, bSelect=false, imageId=Wx::NOT_FOUND) end # Shortcut for {Wx::Treebook#expand_node}( pageId, false ). # @param pageId [Integer] # @return [true,false] def collapse_node(pageId) end # Creates a treebook control. # See {Wx::Treebook#initialize} for the description of the 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] # @param name [String] # @return [true,false] def create(parent, id, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::BK_DEFAULT, name=Wx::EMPTY_STRING) end # Deletes the page at the specified position and all its children. # Could trigger page selection change in a case when selected page is removed. In that case its parent is selected (or the next page if no parent). # @param pagePos [Integer] # @return [true,false] def delete_page(pagePos) end # Expands (collapses) the pageId node. # Returns the previous state. May generate page changing events (if selected page is under the collapsed branch, then its parent is autoselected). # @param pageId [Integer] # @param expand [true,false] # @return [true,false] def expand_node(pageId, expand=true) end # Returns the parent page of the given one or {Wx::NOT_FOUND} if this is a top-level page. # @param page [Integer] # @return [Integer] def get_page_parent(page) end alias_method :page_parent, :get_page_parent # Returns the currently selected page, or {Wx::NOT_FOUND} if none was selected. # This method may return either the previously or newly selected page when called from the EVT_TREEBOOK_PAGE_CHANGED() handler depending on the platform and so {Wx::BookCtrlEvent#get_selection} should be used instead in this case. # @return [Integer] def get_selection; end alias_method :selection, :get_selection # Inserts a new page just before the page indicated by pagePos. # The new page is placed before pagePos page and on the same level. NULL could be specified for page to create an empty page. # @param pagePos [Integer] # @param page [Wx::Window] # @param text [String] # @param bSelect [true,false] # @param imageId [Integer] # @return [true,false] def insert_page(pagePos, page, text, bSelect=false, imageId=Wx::NOT_FOUND) end # Inserts a sub page under the specified page. # NULL could be specified for page to create an empty page. # @param pagePos [Integer] # @param page [Wx::Window] # @param text [String] # @param bSelect [true,false] # @param imageId [Integer] # @return [true,false] def insert_sub_page(pagePos, page, text, bSelect=false, imageId=Wx::NOT_FOUND) end # Returns true if the page represented by pageId is expanded. # @param pageId [Integer] # @return [true,false] def is_node_expanded(pageId) end alias_method :node_expanded?, :is_node_expanded end # Treebook end