# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # CP_DEFAULT_STYLE = 2621440 # CP_NO_TLW_RESIZE = 2 # # EVT_COLLAPSIBLEPANE_CHANGED = 10189 # A collapsible pane is a container with an embedded button-like control which can be used by the user to collapse or expand the pane's contents. # # Once constructed you should use the {Wx::CollapsiblePane#get_pane} function to access the pane and add your controls inside it (i.e. use the returned pointer from {Wx::CollapsiblePane#get_pane} as parent for the controls which must go in the pane, not the {Wx::CollapsiblePane} itself!). # Note that because of its nature of control which can dynamically (and drastically) change its size at run-time under user-input, when putting {Wx::CollapsiblePane} inside a {Wx::Sizer} you should be careful to add it with a proportion value of zero; this is because otherwise all other windows with non-null proportion values will automatically resize each time the user expands or collapse the pane window usually resulting in a weird, flickering effect. # Usage sample: # # ```ruby # collpane = Wx::CollapsiblePane.new(self, Wx::ID_ANY, "Details:") # # # add the pane with a zero proportion value to the 'sz' sizer which contains it # sz.add(collpane, 0, Wx::GROW|Wx::ALL, 5) # # #/ now add a test label in the collapsible pane using a sizer to layout it: # win = collpane.get_pane # pane_sz = Wx::VBoxSizer # pane_sz.add(Wx::StaticText.new(win, Wx::ID_ANY, "test!"), 1, Wx::GROW|Wx::ALL, 2) # win.set_sizer(pane_sz) # pane_sz.set_size_hints(win) # ``` # # It is only available if {Wx::Setup::USE_COLLPANE} is set to 1 (the default). # ### Styles # # This class supports the following styles: # # - {Wx::CP_DEFAULT_STYLE}: The default style. It includes {Wx::TAB_TRAVERSAL} and {Wx::Border::BORDER_NONE}. # # - {Wx::CP_NO_TLW_RESIZE}: By default {Wx::CollapsiblePane} resizes the top level window containing it when its own size changes. This allows easily implementing dialogs containing an optionally shown part, for example, and so is the default behaviour but can be inconvenient in some specific cases use this flag to disable this automatic parent resizing then. # # ### Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::NavigationKeyEvent} events. # Event handler methods for events emitted by this class: # # - {Wx::EvtHandler#evt_collapsiblepane_changed}(id, meth = nil, &block): The user expanded or collapsed the collapsible pane. # # - {Wx::EvtHandler#evt_navigation_key}(meth = nil, &block): Process a navigation key event. # # Category: {Wx::Controls}
Appearance:
WXMSW Appearance # WXGTK Appearance # WXOSX Appearance #
# @see Wx::Panel # @see Wx::CollapsiblePaneEvent # # # @wxrb_require USE_COLLPANE class CollapsiblePane < Control # @overload initialize() # Default constructor. # @return [Wx::CollapsiblePane] # @overload initialize(parent, id, label, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::CP_DEFAULT_STYLE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::COLLAPSIBLE_PANE_NAME_STR) # Initializes the object and calls {Wx::CollapsiblePane#create} with all the parameters. # @param parent [Wx::Window] # @param id [Integer] # @param label [String] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param validator [Wx::Validator] # @param name [String] # @return [Wx::CollapsiblePane] def initialize(*args) end # # # true if the control was successfully created or false if creation failed. # @param parent [Wx::Window] Parent window, must not be non-NULL. # @param id [Integer] The identifier for the control. # @param label [String] The initial label shown in the button which allows the user to expand or collapse the pane window. # @param pos [Array(Integer, Integer), Wx::Point] Initial position. # @param size [Array(Integer, Integer), Wx::Size] Initial size. # @param style [Integer] The window style, see {Wx::CP_}* flags. # @param validator [Wx::Validator] Validator which can be used for additional data checks. # @param name [String] Control name. # @return [Boolean] def create(parent, id, label, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::CP_DEFAULT_STYLE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::COLLAPSIBLE_PANE_NAME_STR) end # Collapses or expands the pane window. # @param collapse [Boolean] # @return [void] def collapse(collapse=true) end # Same as calling Collapse(false). # @return [void] def expand; end # Returns a pointer to the pane window. # # Add controls to the returned {Wx::Window} to make them collapsible. # @return [Wx::Window] def get_pane; end alias_method :pane, :get_pane # Returns true if the pane window is currently hidden. # @return [Boolean] def is_collapsed; end alias_method :collapsed?, :is_collapsed # Returns true if the pane window is currently shown. # @return [Boolean] def is_expanded; end alias_method :expanded?, :is_expanded end # CollapsiblePane end