# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # Enumeration used by {Wx::LayoutAlgorithm}. # # # class LayoutOrientation < Wx::Enum # # LAYOUT_HORIZONTAL = Wx::LayoutOrientation.new(0) # # LAYOUT_VERTICAL = Wx::LayoutOrientation.new(1) end # LayoutOrientation # Enumeration used by {Wx::LayoutAlgorithm}. # # # class LayoutAlignment < Wx::Enum # # LAYOUT_NONE = Wx::LayoutAlignment.new(0) # # LAYOUT_TOP = Wx::LayoutAlignment.new(1) # # LAYOUT_LEFT = Wx::LayoutAlignment.new(2) # # LAYOUT_RIGHT = Wx::LayoutAlignment.new(3) # # LAYOUT_BOTTOM = Wx::LayoutAlignment.new(4) end # LayoutAlignment # # EVT_QUERY_LAYOUT_INFO = 10011 # # EVT_CALCULATE_LAYOUT = 10012 # {Wx::SashLayoutWindow} responds to OnCalculateLayout events generated by {Wx::LayoutAlgorithm}. # It allows the application to use simple accessors to specify how the window should be laid out, rather than having to respond to events. # The fact that the class derives from {Wx::SashWindow} allows sashes to be used if required, to allow the windows to be user-resizable. # The documentation for {Wx::LayoutAlgorithm} explains the purpose of this class in more detail. # For the window styles see {Wx::SashWindow}. # This class handles the EVT_QUERY_LAYOUT_INFO and EVT_CALCULATE_LAYOUT events for you. However, if you use sashes, see {Wx::SashWindow} for relevant event information. See also {Wx::LayoutAlgorithm} for information about the layout events. # === # # Category: Miscellaneous Windows # @see Wx::LayoutAlgorithm # @see Wx::SashWindow # @see Events and Event Handling # # class SashLayoutWindow < SashWindow # @overload initialize() # Default ctor. # @return [SashLayoutWindow] # @overload initialize(parent, id, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=(Wx::CLIP_CHILDREN|wxSW_3D), name=("layoutWindow")) # Constructs a sash layout window, which can be a child of a frame, dialog or any other non-control window. # @param parent [Wx::Window] Pointer to a parent window. # @param id [Integer] Window identifier. If -1, will automatically create an identifier. # @param pos [Array(Integer, Integer), Wx::Point] Window position. {Wx::DEFAULT_POSITION} is (-1, -1) which indicates that {Wx::SashLayoutWindows} should generate a default position for the window. If using the {Wx::SashLayoutWindow} class directly, supply an actual position. # @param size [Array(Integer, Integer), Wx::Size] Window size. {Wx::DEFAULT_SIZE} is (-1, -1) which indicates that {Wx::SashLayoutWindows} should generate a default size for the window. # @param style [Integer] Window style. For window styles, please see {Wx::SashLayoutWindow}. # @param name [String] Window name. # @return [SashLayoutWindow] def initialize(*args) end # Initializes a sash layout window, which can be a child of a frame, dialog or any other non-control window. # @param parent [Wx::Window] Pointer to a parent window. # @param id [Integer] Window identifier. If -1, will automatically create an identifier. # @param pos [Array(Integer, Integer), Wx::Point] Window position. {Wx::DEFAULT_POSITION} is (-1, -1) which indicates that {Wx::SashLayoutWindows} should generate a default position for the window. If using the {Wx::SashLayoutWindow} class directly, supply an actual position. # @param size [Array(Integer, Integer), Wx::Size] Window size. {Wx::DEFAULT_SIZE} is (-1, -1) which indicates that {Wx::SashLayoutWindows} should generate a default size for the window. # @param style [Integer] Window style. For window styles, please see {Wx::SashLayoutWindow}. # @param name [String] Window name. # @return [true,false] def create(parent, id=Wx::StandardID::ID_ANY, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=(Wx::CLIP_CHILDREN|wxSW_3D), name=("layoutWindow")) end # Returns the alignment of the window: one of {Wx::LayoutAlignment::LAYOUT_TOP}, {Wx::LayoutAlignment::LAYOUT_LEFT}, {Wx::LayoutAlignment::LAYOUT_RIGHT}, {Wx::LayoutAlignment::LAYOUT_BOTTOM}. # @return [LayoutAlignment] def get_alignment; end alias_method :alignment, :get_alignment # Returns the orientation of the window: one of {Wx::LayoutOrientation::LAYOUT_HORIZONTAL}, {Wx::LayoutOrientation::LAYOUT_VERTICAL}. # @return [LayoutOrientation] def get_orientation; end alias_method :orientation, :get_orientation # The default handler for the event that is generated by {Wx::LayoutAlgorithm}. # The implementation of this function calls {Wx::CalculateLayoutEvent#set_rect} to shrink the provided size according to how much space this window takes up. For further details, see {Wx::LayoutAlgorithm} and {Wx::CalculateLayoutEvent}. # @param event [Wx::CalculateLayoutEvent] # @return [void] def on_calculate_layout(event) end # The default handler for the event that is generated by OnCalculateLayout to get size, alignment and orientation information for the window. # The implementation of this function uses member variables as set by accessors called by the application. # For further details, see {Wx::LayoutAlgorithm} and {Wx::QueryLayoutInfoEvent}. # @param event [Wx::QueryLayoutInfoEvent] # @return [void] def on_query_layout_info(event) end # Sets the alignment of the window (which edge of the available parent client area the window is attached to). # alignment is one of {Wx::LayoutAlignment::LAYOUT_TOP}, {Wx::LayoutAlignment::LAYOUT_LEFT}, {Wx::LayoutAlignment::LAYOUT_RIGHT}, {Wx::LayoutAlignment::LAYOUT_BOTTOM}. # @param alignment [LayoutAlignment] # @return [void] def set_alignment(alignment) end alias_method :alignment=, :set_alignment # Sets the default dimensions of the window. # The dimension other than the orientation will be fixed to this value, and the orientation dimension will be ignored and the window stretched to fit the available space. # @param size [Array(Integer, Integer), Wx::Size] # @return [void] def set_default_size(size) end alias_method :default_size=, :set_default_size # Sets the orientation of the window (the direction the window will stretch in, to fill the available parent client area). # orientation is one of {Wx::LayoutOrientation::LAYOUT_HORIZONTAL}, {Wx::LayoutOrientation::LAYOUT_VERTICAL}. # @param orientation [LayoutOrientation] # @return [void] def set_orientation(orientation) end alias_method :orientation=, :set_orientation end # SashLayoutWindow # {Wx::LayoutAlgorithm} implements layout of subwindows in MDI or SDI frames. # It sends a {Wx::CalculateLayoutEvent} event to children of the frame, asking them for information about their size. For MDI parent frames, the algorithm allocates the remaining space to the MDI client window (which contains the MDI child frames). # For SDI (normal) frames, a 'main' window is specified as taking up the remaining space. # Because the event system is used, this technique can be applied to any windows, which are not necessarily 'aware' of the layout classes (no virtual functions in {Wx::Window} refer to {Wx::LayoutAlgorithm} or its events). However, you may wish to use {Wx::SashLayoutWindow} for your subwindows since this class provides handlers for the required events, and accessors to specify the desired size of the window. The sash behaviour in the base class can be used, optionally, to make the windows user-resizable. # {Wx::LayoutAlgorithm} is typically used in IDE (integrated development environment) applications, where there are several resizable windows in addition to the MDI client window, or other primary editing window. Resizable windows might include toolbars, a project window, and a window for displaying error and warning messages. # When a window receives an OnCalculateLayout event, it should call SetRect in the given event object, to be the old supplied rectangle minus whatever space the window takes up. It should also set its own size accordingly. {Wx::SashLayoutWindow#on_calculate_layout} generates an OnQueryLayoutInfo event which it sends to itself to determine the orientation, alignment and size of the window, which it gets from internal member variables set by the application. # The algorithm works by starting off with a rectangle equal to the whole frame client area. It iterates through the frame children, generating {Wx::LayoutAlgorithm::OnCalculateLayout} events which subtract the window size and return the remaining rectangle for the next window to process. It is assumed (by {Wx::SashLayoutWindow#on_calculate_layout}) that a window stretches the full dimension of the frame client, according to the orientation it specifies. For example, a horizontal window will stretch the full width of the remaining portion of the frame client area. In the other orientation, the window will be fixed to whatever size was specified by {Wx::LayoutAlgorithm::OnQueryLayoutInfo}. An alignment setting will make the window 'stick' to the left, top, right or bottom of the remaining client area. This scheme implies that order of window creation is important. Say you wish to have an extra toolbar at the top of the frame, a project window to the left of the MDI client window, and an output window above the status bar. You should therefore create the windows in this order: toolbar, output window, project window. This ensures that the toolbar and output window take up space at the top and bottom, and then the remaining height in-between is used for the project window. # {Wx::LayoutAlgorithm} is quite independent of the way in which {Wx::LayoutAlgorithm::OnCalculateLayout} chooses to interpret a window's size and alignment. Therefore you could implement a different window class with a new {Wx::LayoutAlgorithm::OnCalculateLayout} event handler, that has a more sophisticated way of laying out the windows. It might allow specification of whether stretching occurs in the specified orientation, for example, rather than always assuming stretching. (This could, and probably should, be added to the existing implementation). # {Wx::LayoutAlgorithm} has nothing to do with {Wx::LayoutConstraints}. It is an alternative way of specifying layouts for which the normal constraint system is unsuitable. # # === Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::CalculateLayoutEvent} events. # Event handler methods for events emitted by this class: # - {Wx::EvtHandler#evt_query_layout_info}(meth = nil, &block): Process a {Wx::EVT_QUERY_LAYOUT_INFO} event, to get size, orientation and alignment from a window. See {Wx::QueryLayoutInfoEvent}. # - {Wx::EvtHandler#evt_calculate_layout}(meth = nil, &block): Process a {Wx::EVT_CALCULATE_LAYOUT} event, which asks the window to take a 'bite' out of a rectangle provided by the algorithm. See {Wx::CalculateLayoutEvent}. # # Note that the algorithm object does not respond to events, but itself generates the previous events in order to calculate window sizes. # === # # Category: Window Layout # @see Wx::SashEvent # @see Wx::SashLayoutWindow # @see Events and Event Handling # # class LayoutAlgorithm < Object # Default constructor. # @return [LayoutAlgorithm] def initialize; end # Lays out the children of a normal frame. # mainWindow is set to occupy the remaining space. This function simply calls {Wx::LayoutAlgorithm#layout_window}. # @param frame [Wx::Frame] # @param mainWindow [Wx::Window] # @return [true,false] def layout_frame(frame, mainWindow=nil) end # Lays out the children of an MDI parent frame. # If rect is non-NULL, the given rectangle will be used as a starting point instead of the frame's client area. The MDI client window is set to occupy the remaining space. # @param frame [Wx::MDIParentFrame] # @param rect [Wx::Rect] # @return [true,false] def layout_mdi_frame(frame, rect=nil) end # Lays out the children of a normal frame or other window. # mainWindow is set to occupy the remaining space. If this is not specified, then the last window that responds to a calculate layout event in query mode will get the remaining space (that is, a non-query OnCalculateLayout event will not be sent to this window and the window will be set to the remaining size). # @param parent [Wx::Window] # @param mainWindow [Wx::Window] # @return [true,false] def layout_window(parent, mainWindow=nil) end end # LayoutAlgorithm end