# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # SP_NOBORDER = 0 # SP_THIN_SASH = 0 # SP_NOSASH = 16 # SP_PERMIT_UNSPLIT = 64 # SP_LIVE_UPDATE = 128 # SP_3DSASH = 256 # SP_3DBORDER = 512 # SP_NO_XP_THEME = 1024 # SP_BORDER = 512 # SP_3D = 768 # # # # class SplitMode < Wx::Enum # # SPLIT_HORIZONTAL = Wx::SplitMode.new(1) # # SPLIT_VERTICAL = Wx::SplitMode.new(2) end # SplitMode # # SPLIT_DRAG_NONE = 0 # # SPLIT_DRAG_DRAGGING = 1 # # SPLIT_DRAG_LEFT_DOWN = 2 # # EVT_SPLITTER_SASH_POS_CHANGED = 10092 # # EVT_SPLITTER_SASH_POS_CHANGING = 10093 # # EVT_SPLITTER_SASH_POS_RESIZE = 10094 # # EVT_SPLITTER_DOUBLECLICKED = 10095 # # EVT_SPLITTER_UNSPLIT = 10096 # This class manages up to two subwindows. # The current view can be split into two programmatically (perhaps from a menu command), and unsplit either programmatically or via the {Wx::SplitterWindow} user interface. # === Styles # # This class supports the following styles: # # - {Wx::SP_3D}: Draws a 3D effect border and sash. # - {Wx::SP_THIN_SASH}: Draws a thin sash. # - {Wx::SP_3DSASH}: Draws a 3D effect sash (part of default style). # - {Wx::SP_3DBORDER}: Synonym for {Wx::SP_BORDER}. # - {Wx::SP_BORDER}: Draws a standard border. # - {Wx::SP_NOBORDER}: No border (default). # - {Wx::SP_NO_XP_THEME}: Under Windows, switches off the attempt to draw the splitter using Windows theming, so the borders and sash will take on the pre-XP look. # - {Wx::SP_PERMIT_UNSPLIT}: Always allow to unsplit, even with the minimum pane size other than zero. # - {Wx::SP_LIVE_UPDATE}: Don't draw XOR line but resize the child windows immediately. # # === Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::SplitterEvent} events. # Event handler methods for events emitted by this class: # - {Wx::EvtHandler#evt_splitter_sash_pos_changing}(id, meth = nil, &block): The sash position is in the process of being changed. May be used to modify the position of the tracking bar to properly reflect the position that would be set if the drag were to be completed at this point. Processes a {Wx::EVT_SPLITTER_SASH_POS_CHANGING} event. # - {Wx::EvtHandler#evt_splitter_sash_pos_resize}(id, meth = nil, &block): The sash position is in the process of being updated. May be used to modify the position of the tracking bar to properly reflect the position that would be set if the update were to be completed. This can happen e.g. when the window is resized and the sash is moved according to the gravity setting. This event is sent when the window is resized and allows the application to select the desired new sash position. If it doesn't process the event, the position is determined by the gravity setting. Processes a {Wx::EVT_SPLITTER_SASH_POS_RESIZE} event and is only available in wxWidgets 3.1.6 or newer. # - {Wx::EvtHandler#evt_splitter_sash_pos_changed}(id, meth = nil, &block): The sash position was changed. May be used to modify the sash position before it is set, or to prevent the change from taking place. Processes a {Wx::EVT_SPLITTER_SASH_POS_CHANGED} event. # - {Wx::EvtHandler#evt_splitter_unsplit}(id, meth = nil, &block): The splitter has been just unsplit. Processes a {Wx::EVT_SPLITTER_UNSPLIT} event. # - {Wx::EvtHandler#evt_splitter_dclick}(id, meth = nil, &block): The sash was double clicked. The default behaviour is to unsplit the window when this happens (unless the minimum pane size has been set to a value greater than zero). Processes a {Wx::EVT_SPLITTER_DOUBLECLICKED} event. # # === # # Category: Miscellaneous Windows # @see Wx::SplitterEvent # @see wxSplitterWindow Overview # # class SplitterWindow < Window # @overload initialize() # Default constructor. # @return [SplitterWindow] # @overload initialize(parent, id=Wx::ID_ANY, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=wxSP_3D, name=("Wx::SPLITTER_WINDOW")) # Constructor for creating the window. # After using this constructor, you must create either one or two subwindows with the splitter window as parent, and then call one of {Wx::SplitterWindow#initialize}, {Wx::SplitterWindow#split_vertically} and {Wx::SplitterWindow#split_horizontally} in order to set the pane(s). You can create two windows, with one hidden when not being shown; or you can create and delete the second pane on demand. # @see Wx::SplitterWindow#initialize # @see Wx::SplitterWindow#split_vertically # @see Wx::SplitterWindow#split_horizontally # @see Wx::SplitterWindow#create # @param parent [Wx::Window] The parent of the splitter window. # @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::SplitterWindow}. # @param name [String] The window name. # @return [SplitterWindow] def initialize(*args) end # Creation function, for two-step construction. # See {Wx::SplitterWindow#splitter_window} for details. # @param parent [Wx::Window] # @param id [Integer] # @param point [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=Wx::ID_ANY, point=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=wxSP_3D, name=("Wx::SPLITTER")) end # Returns the current minimum pane size (defaults to zero). # # @see Wx::SplitterWindow#set_minimum_pane_size # @return [Integer] def get_minimum_pane_size; end alias_method :minimum_pane_size, :get_minimum_pane_size # Returns the current sash gravity. # # @see Wx::SplitterWindow#set_sash_gravity # @return [Float] def get_sash_gravity; end alias_method :sash_gravity, :get_sash_gravity # Returns the current sash position. # # @see Wx::SplitterWindow#set_sash_position # @return [Integer] def get_sash_position; end alias_method :sash_position, :get_sash_position # Returns the default sash size in pixels or 0 if it is invisible. # # @see Wx::SplitterWindow#get_default_sash_size # @see Wx::SplitterWindow#is_sash_invisible # @return [Integer] def get_sash_size; end alias_method :sash_size, :get_sash_size # Returns the default sash size in pixels. # The size of the sash is its width for a vertically split window and its height for a horizontally split one. Its other direction is the same as the client size of the window in the corresponding direction. # The default sash size is platform-dependent because it conforms to the current platform look-and-feel and cannot be changed. # @return [Integer] def get_default_sash_size; end alias_method :default_sash_size, :get_default_sash_size # Gets the split mode. # # @see Wx::SplitterWindow#set_split_mode # @see Wx::SplitterWindow#split_vertically # @see Wx::SplitterWindow#split_horizontally. # @return [SplitMode] def get_split_mode; end alias_method :split_mode, :get_split_mode # Returns the left/top or only pane. # @return [Wx::Window] def get_window1; end alias_method :window1, :get_window1 # Returns the right/bottom pane. # @return [Wx::Window] def get_window2; end alias_method :window2, :get_window2 # Initializes the splitter window to have one pane. # The child window is shown if it is currently hidden. # # This should be called if you wish to initially view only a single pane in the splitter window. # @see Wx::SplitterWindow#split_vertically # @see Wx::SplitterWindow#split_horizontally # @param window [Wx::Window] The pane for the unsplit window. # @return [void] def init(window) end # Returns true if the sash is invisible even when the window is split, false otherwise. # This is a shortcut for HasFlag({Wx::SP_NOSASH}) # @see Wx::SplitterWindow#set_sash_invisible # @return [true,false] def is_sash_invisible; end alias_method :sash_invisible?, :is_sash_invisible # Returns true if the window is split, false otherwise. # @return [true,false] def is_split; end alias_method :split?, :is_split # Application-overridable function called when the sash is double-clicked with the left mouse button. # The default implementation of this function calls Unsplit if the minimum pane size is zero. # @see Wx::SplitterWindow#unsplit # @param x [Integer] The x position of the mouse cursor. # @param y [Integer] The y position of the mouse cursor. # @return [void] def on_double_click_sash(x, y) end # Application-overridable function called when the sash position is changed by user. # It may return false to prevent the change or true to allow it. # # The default implementation of this function verifies that the sizes of both panes of the splitter are greater than minimum pane size. # @param newSashPosition [Integer] The new sash position (always positive or zero) # @return [true,false] def on_sash_position_change(newSashPosition) end # Application-overridable function called when the window is unsplit, either programmatically or using the {Wx::SplitterWindow} user interface. # The default implementation of this function simply hides removed. You may wish to delete the window. # @param removed [Wx::Window] The window being removed. # @return [void] def on_unsplit(removed) end # This function replaces one of the windows managed by the {Wx::SplitterWindow} with another one. # It is in general better to use it instead of calling {Wx::SplitterWindow#unsplit} and then resplitting the window back because it will provoke much less flicker (if any). It is valid to call this function whether the splitter has two windows or only one. # Both parameters should be non-NULL and winOld must specify one of the windows managed by the splitter. If the parameters are incorrect or the window couldn't be replaced, false is returned. Otherwise the function will return true, but please notice that it will not delete the replaced window and you may wish to do it yourself. # @see Wx::SplitterWindow#get_minimum_pane_size # @param winOld [Wx::Window] # @param winNew [Wx::Window] # @return [true,false] def replace_window(winOld, winNew) end # Sets the minimum pane size. # The default minimum pane size is zero, which means that either pane can be reduced to zero by dragging the sash, thus removing one of the panes. To prevent this behaviour (and veto out-of-range sash dragging), set a minimum size, for example 20 pixels. If the {Wx::SP_PERMIT_UNSPLIT} style is used when a splitter window is created, the window may be unsplit even if minimum size is non-zero. # @see Wx::SplitterWindow#get_minimum_pane_size # @param paneSize [Integer] Minimum pane size in pixels. # @return [void] def set_minimum_pane_size(paneSize) end alias_method :minimum_pane_size=, :set_minimum_pane_size # Sets the sash gravity. # Gravity is real factor which controls position of sash while resizing {Wx::SplitterWindow}. Gravity tells {Wx::SplitterWindow} how much will left/top window grow while resizing. Example values: # - 0.0: only the bottom/right window is automatically resized- 0.5: both windows grow by equal size- 1.0: only left/top window grows Gravity should be a real value between 0.0 and 1.0. Default value of sash gravity is 0.0. That value is compatible with previous (before gravity was introduced) behaviour of {Wx::SplitterWindow}. # # Notice that when sash gravity for a newly created splitter window, it is often necessary to explicitly set the splitter size using {Wx::SplitterWindow#set_size} to ensure that is big enough for its initial sash position. Otherwise, i.e. if the window is created with the default tiny size and only resized to its correct size later, the initial sash position will be affected by the gravity and typically result in sash being at the rightmost position for the gravity of 1. See the example code creating {Wx::SplitterWindow} in the splitter sample for more details. # @see Wx::SplitterWindow#get_sash_gravity # @param gravity [Float] The sash gravity. Value between 0.0 and 1.0. # @return [void] def set_sash_gravity(gravity) end alias_method :sash_gravity=, :set_sash_gravity # Sets the sash position. # Does not currently check for an out-of-range value. # @see Wx::SplitterWindow#get_sash_position # @param position [Integer] The sash position in pixels. # @param redraw [true,false] If true, resizes the panes and redraws the sash and border. # @return [void] def set_sash_position(position, redraw=true) end alias_method :sash_position=, :set_sash_position # Sets the split mode. # Only sets the internal variable; does not update the display. # @see Wx::SplitterWindow#get_split_mode # @see Wx::SplitterWindow#split_vertically # @see Wx::SplitterWindow#split_horizontally. # @param mode [Integer] Can be {Wx::SplitMode::SPLIT_VERTICAL} or {Wx::SplitMode::SPLIT_HORIZONTAL}. # @return [void] def set_split_mode(mode) end alias_method :split_mode=, :set_split_mode # Sets whether the sash should be invisible, even when the window is split. # When the sash is invisible, it doesn't appear on the screen at all and, in particular, doesn't allow the user to resize the windows. # Only sets the internal variable; does not update the display. # @see Wx::SplitterWindow#is_sash_invisible # @param invisible [true,false] If true, the sash is always invisible, else it is shown when the window is split. # @return [void] def set_sash_invisible(invisible=true) end alias_method :sash_invisible=, :set_sash_invisible # Initializes the top and bottom panes of the splitter window. # The child windows are shown if they are currently hidden. # # true if successful, false otherwise (the window was already split). # # This should be called if you wish to initially view two panes. It can also be called at any subsequent time, but the application should check that the window is not currently split using {Wx::SplitterWindow#is_split}. # @see Wx::SplitterWindow#split_vertically # @see Wx::SplitterWindow#is_split # @see Wx::SplitterWindow#unsplit # @param window1 [Wx::Window] The top pane. # @param window2 [Wx::Window] The bottom pane. # @param sashPosition [Integer] The initial position of the sash. If this value is positive, it specifies the size of the upper pane. If it is negative, its absolute value gives the size of the lower pane. Finally, specify 0 (default) to choose the default position (half of the total window height). # @return [true,false] def split_horizontally(window1, window2, sashPosition=0) end # Initializes the left and right panes of the splitter window. # The child windows are shown if they are currently hidden. # # true if successful, false otherwise (the window was already split). # # This should be called if you wish to initially view two panes. It can also be called at any subsequent time, but the application should check that the window is not currently split using {Wx::SplitterWindow#is_split}. # @see Wx::SplitterWindow#split_horizontally # @see Wx::SplitterWindow#is_split # @see Wx::SplitterWindow#unsplit. # @param window1 [Wx::Window] The left pane. # @param window2 [Wx::Window] The right pane. # @param sashPosition [Integer] The initial position of the sash. If this value is positive, it specifies the size of the left pane. If it is negative, it is absolute value gives the size of the right pane. Finally, specify 0 (default) to choose the default position (half of the total window width). # @return [true,false] def split_vertically(window1, window2, sashPosition=0) end # Unsplits the window. # true if successful, false otherwise (the window was not split). # # This call will not actually delete the pane being removed; it calls {Wx::SplitterWindow#on_unsplit} which can be overridden for the desired behaviour. By default, the pane being removed is hidden. # @see Wx::SplitterWindow#split_horizontally # @see Wx::SplitterWindow#split_vertically # @see Wx::SplitterWindow#is_split # @see Wx::SplitterWindow#on_unsplit # @param toRemove [Wx::Window] The pane to remove, or NULL to remove the right or bottom pane. # @return [true,false] def unsplit(toRemove=nil) end # Causes any pending sizing of the sash and child panes to take place immediately. # Such resizing normally takes place in idle time, in order to wait for layout to be completed. However, this can cause unacceptable flicker as the panes are resized after the window has been shown. To work around this, you can perform window layout (for example by sending a size event to the parent window), and then call this function, before showing the top-level window. # @return [void] def update_size; end end # SplitterWindow end