# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # NB_DEFAULT = 0 # NB_TOP = 16 # NB_BOTTOM = 32 # NB_LEFT = 64 # NB_RIGHT = 128 # NB_FIXEDWIDTH = 256 # NB_MULTILINE = 512 # NB_NOPAGETHEME = 1024 # # NB_HITTEST_NOWHERE = 1 # # NB_HITTEST_ONICON = 2 # # NB_HITTEST_ONLABEL = 4 # # NB_HITTEST_ONITEM = 16 # # NB_HITTEST_ONPAGE = 8 # # EVT_NOTEBOOK_PAGE_CHANGED = 10133 # # EVT_NOTEBOOK_PAGE_CHANGING = 10134 # This class represents a notebook control, which manages multiple windows with associated tabs. # To use the class, create a {Wx::Notebook} object and call {Wx::Notebook::AddPage} or {Wx::Notebook#insert_page}, passing a window to be used as the page. Do not explicitly delete the window for a page that is currently managed by {Wx::Notebook}. # {Wx::NotebookPage} is a typedef for {Wx::Window}. # === Styles # # This class supports the following styles: # # - {Wx::NB_TOP}: Place tabs on the top side. # - {Wx::NB_LEFT}: Place tabs on the left side. # - {Wx::NB_RIGHT}: Place tabs on the right side. # - {Wx::NB_BOTTOM}: Place tabs under instead of above the notebook pages. # - {Wx::NB_FIXEDWIDTH}: (Windows only) All tabs will have same width. # - {Wx::NB_MULTILINE}: (Windows only) There can be several rows of tabs. # - {Wx::NB_NOPAGETHEME}: (Windows only) Display a solid colour on notebook pages, and not a gradient, which can reduce performance. # # The styles {Wx::NB_LEFT}, RIGHT and BOTTOM are not supported under Microsoft Windows when using visual themes. # === 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_notebook_page_changed}(id, meth = nil, &block): The page selection was changed. Processes a {Wx::EVT_NOTEBOOK_PAGE_CHANGED} event. # - {Wx::EvtHandler#evt_notebook_page_changing}(id, meth = nil, &block): The page selection is about to be changed. Processes a {Wx::EVT_NOTEBOOK_PAGE_CHANGING} event. This event can be vetoed. # # == Page backgrounds # # On Windows, the default theme paints a background on the notebook's pages. If you wish to suppress this theme, for aesthetic or performance reasons, there are three ways of doing it. You can use {Wx::NB_NOPAGETHEME} to disable themed drawing for a particular notebook, you can call {Wx::SystemOptions.set_option} to disable it for the whole application, or you can disable it for individual pages by using {Wx::Notebook#set_background_colour}. # To disable themed pages globally: # # wxSystemOptions::SetOption("msw.notebook.themed-background", 0); # # Set the value to 1 to enable it again. To give a single page a solid background that more or less fits in with the overall theme, use: # # wxColour col = notebook->GetThemeBackgroundColour(); # if (col.IsOk()) # { # page->SetBackgroundColour(col); # } # # On platforms other than Windows, or if the application is not using Windows themes, {Wx::Notebook#get_theme_background_colour} will return an uninitialised colour object, and the above code will therefore work on all platforms. # === # # Category: Book Controls
Appearance:
{Wx::MSW} Appearance # {Wx::GTK} Appearance # {Wx::OSX} Appearance #
# @see Wx::BookCtrl # @see Wx::BookCtrlEvent # @see Wx::ImageList # @see Notebook Sample # # class Notebook < BookCtrlBase # @overload initialize() # Constructs a notebook control. # @return [Notebook] # @overload initialize(parent, id, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, name=Wx::NotebookNameStr) # Constructs a notebook control. # Note that sometimes you can reduce flicker by passing the {Wx::CLIP_CHILDREN} window style. # @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. # @return [Notebook] def initialize(*args) end # Creates a notebook control. # See {Wx::Notebook#notebook} for a 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=0, name=Wx::NotebookNameStr) end # Returns the number of rows in the notebook control. # @return [Integer] def get_row_count; end alias_method :row_count, :get_row_count # If running under Windows and themes are enabled for the application, this function returns a suitable colour for painting the background of a notebook page, and can be passed to {Wx::Notebook#set_background_colour}. # Otherwise, an uninitialised colour will be returned. # @return [Wx::Colour] def get_theme_background_colour; end alias_method :theme_background_colour, :get_theme_background_colour # Sets the amount of space around each page's icon and label, in pixels. # The vertical padding cannot be changed in {Wx::GTK}. # @param padding [Array(Integer, Integer), Wx::Size] # @return [void] def set_padding(padding) end alias_method :padding=, :set_padding # Returns the image index for the given page. # @param nPage [Integer] # @return [Integer] def get_page_image(nPage) end alias_method :page_image, :get_page_image # Sets the image index for the given page. # image is an index into the image list which was set with {Wx::Notebook#set_image_list}. # @param page [Integer] # @param image [Integer] # @return [true,false] def set_page_image(page, image) end # Returns the string for the given page. # @param nPage [Integer] # @return [String] def get_page_text(nPage) end alias_method :page_text, :get_page_text # Sets the text for the given page. # @param page [Integer] # @param text [String] # @return [true,false] def set_page_text(page, text) end # Returns the currently selected page, or {Wx::NOT_FOUND} if none was selected. # Note that this method may return either the previously or newly selected page when called from the EVT_BOOKCTRL_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 # Sets the selection to the given page, returning the previous selection. # Notice that the call to this function generates the page changing events, use the {Wx::Notebook#change_selection} function if you don't want these events to be generated. # @see Wx::Notebook#get_selection # @param page [Integer] # @return [Integer] def set_selection(page) end alias_method :selection=, :set_selection # Changes the selection to the given page, returning the previous selection. # This function behaves as {Wx::Notebook#set_selection} but does not generate the page changing events. # See User Generated Events vs Programmatically Generated Events for more information. # @param page [Integer] # @return [Integer] def change_selection(page) end # Inserts a new page at the specified position. # true if successful, false otherwise. # # Do not delete the page, it will be deleted by the book control. # @see Wx::Notebook#add_page # @param index [Integer] Specifies the position for the new page. # @param page [Wx::Window] Specifies the new page. # @param text [String] Specifies the text for the new page. # @param select [true,false] Specifies whether the page should be selected. # @param imageId [Integer] Specifies the optional image index for the new page. # @return [true,false] def insert_page(index, page, text, select=false, imageId=Wx::AUI::AuiMDIClientWindow::NO_IMAGE) end end # Notebook end