# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # An MDI (Multiple Document Interface) parent frame is a window which can contain MDI child frames in its client area which emulates the full desktop. # MDI is a user-interface model in which all the window reside inside the single parent window as opposed to being separate from each other. It remains popular despite dire warnings from Microsoft itself (which popularized this model in the first model) that MDI is obsolete. # An MDI parent frame always has a {Wx::MDIClientWindow} associated with it, which is the parent for MDI child frames. In the simplest case, the client window takes up the entire parent frame area but it is also possible to resize it to be smaller in order to have other windows in the frame, a typical example is using a sidebar along one of the window edges. # The appearance of MDI applications differs between different ports. The classic MDI model, with child windows which can be independently moved, resized etc, is only available under MSW, which provides native support for it. In Mac ports, multiple top level windows are used for the MDI children too and the MDI parent frame itself is invisible, to accommodate the native look and feel requirements. In all the other ports, a tab-based MDI implementation (sometimes called TDI) is used and so at most one MDI child is visible at any moment (child frames are always maximized). # # Although it is possible to have multiple MDI parent frames, a typical MDI application has a single MDI parent frame window inside which multiple MDI child frames, i.e. objects of class {Wx::MDIChildFrame}, can be created. # === Styles # # This class supports the following styles: # # There are no special styles for this class, all {Wx::Frame} styles apply to it in the usual way. The only exception is that {Wx::HSCROLL} and {Wx::VSCROLL} styles apply not to the frame itself but to the client window, so that using them enables horizontal and vertical scrollbars for this window and not the frame. # # === # # Category: Managed Windows # @see Wx::MDIChildFrame # @see Wx::MDIClientWindow # @see Wx::Frame # @see Wx::Dialog # # class MDIParentFrame < Frame # @overload initialize() # Default constructor. # Use {Wx::MDIParentFrame#create} for the objects created using this constructor. # @return [Wx::MDIParentFrame] # @overload initialize(parent, id, title, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=(Wx::DEFAULT_FRAME_STYLE|Wx::VSCROLL|Wx::HSCROLL), name=Wx::FrameNameStr) # Constructor, creating the window. # Notice that if you override virtual {Wx::MDIParentFrame#on_create_client} method you shouldn't be using this constructor but the default constructor and {Wx::MDIParentFrame#create} as otherwise your overridden method is never going to be called because of the usual C++ virtual call resolution rules. # # Under wxMSW, the client window will automatically have a sunken border style when the active child is not maximized, and no border style when a child is maximized. # @see Wx::MDIParentFrame#create # @see Wx::MDIParentFrame#on_create_client # @param parent [Wx::Window] The window parent. Usually is NULL. # @param id [Integer] The window identifier. It may take a value of {Wx::StandardID::ID_ANY} to indicate a default value. # @param title [String] The caption to be displayed on the frame's title bar. # @param pos [Array(Integer, Integer), Wx::Point] The window position. The value {Wx::DEFAULT_POSITION} indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform. # @param size [Array(Integer, Integer), Wx::Size] The window size. The value {Wx::DEFAULT_SIZE} indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform. # @param style [Integer] The window style. Default value includes {Wx::HSCROLL} and {Wx::VSCROLL} styles. # @param name [String] The name of the window. This parameter is used to associate a name with the item, allowing the application user to set Motif resource values for individual windows. # @return [Wx::MDIParentFrame] def initialize(*args) end # Activates the MDI child following the currently active one. # The MDI children are maintained in an ordered list and this function switches to the next element in this list, wrapping around the end of it if the currently active child is the last one. # @see Wx::MDIParentFrame#activate_previous # @return [void] def activate_next; end # Activates the MDI child preceding the currently active one. # # @see Wx::MDIParentFrame#activate_next # @return [void] def activate_previous; end # Arranges any iconized (minimized) MDI child windows. # This method is only implemented in MSW MDI implementation and does nothing under the other platforms. # @see Wx::MDIParentFrame#cascade # @see Wx::MDIParentFrame#tile # @return [void] def arrange_icons; end # Arranges the MDI child windows in a cascade. # This method is only implemented in MSW MDI implementation and does nothing under the other platforms. # @see Wx::MDIParentFrame#tile # @see Wx::MDIParentFrame#arrange_icons # @return [void] def cascade; end # Used in two-step frame construction. # See {Wx::MDIParentFrame#initialize} for further details. # @param parent [Wx::Window] # @param id [Integer] # @param title [String] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param name [String] # @return [Boolean] def create(parent, id, title, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=(Wx::DEFAULT_FRAME_STYLE|Wx::VSCROLL|Wx::HSCROLL), name=Wx::FrameNameStr) end # Returns a pointer to the active MDI child, if there is one. # If there are any children at all this function returns a non-NULL pointer. # @return [Wx::MDIChildFrame] def get_active_child; end alias_method :active_child, :get_active_child # Returns a pointer to the client window. # # @see Wx::MDIParentFrame#on_create_client # @return [wxMDIClientWindow *] def get_client_window; end alias_method :client_window, :get_client_window # Returns the current MDI Window menu. # Unless {Wx::FRAME_NO_WINDOW_MENU} style was used, a default menu listing all the currently active children and providing the usual operations (tile, cascade, ...) on them is created automatically by the library and this function can be used to retrieve it. Notice that the default menu can be replaced by calling {Wx::MDIParentFrame#set_window_menu}. # This function is currently not available under macOS. # The current Window menu or NULL. # @return [Wx::Menu] def get_window_menu; end alias_method :window_menu, :get_window_menu # Override this to return a different kind of client window. # If you override this function, you must create your parent frame in two stages, or your function will never be called, due to the way C++ treats virtual functions called from constructors. For example: # # ```ruby # frame = MyParentFrame.new # frame.create(parent, myParentFrameId, 'My Parent Frame') # ``` # # You might wish to derive from {Wx::MDIClientWindow} in order to implement different erase behaviour, for example, such as painting a bitmap on the background. # Note that it is probably impossible to have a client window that scrolls as well as painting a bitmap or pattern, since in OnScroll, the scrollbar positions always return zero. # @see Wx::MDIParentFrame#get_client_window # @see Wx::MDIClientWindow # @return [Wx::MDIClientWindow] def on_create_client; end # Replace the current MDI Window menu. # Ownership of the menu object passes to the frame when you call this function, i.e. the menu will be deleted by it when it's no longer needed (usually when the frame itself is deleted or when {Wx::MDIParentFrame#set_window_menu} is called again). # To remove the window completely, you can use the {Wx::FRAME_NO_WINDOW_MENU} window style but this function also allows doing it by passing NULL pointer as menu. # The menu may include the items with the following standard identifiers (but may use arbitrary text and help strings and bitmaps for them): # # - {Wx::StandardID::ID_MDI_WINDOW_CASCADE} # - {Wx::StandardID::ID_MDI_WINDOW_TILE_HORZ} # - {Wx::StandardID::ID_MDI_WINDOW_TILE_VERT} # - {Wx::StandardID::ID_MDI_WINDOW_ARRANGE_ICONS} # - {Wx::StandardID::ID_MDI_WINDOW_PREV} # - {Wx::StandardID::ID_MDI_WINDOW_NEXT} All of which are handled by {Wx::MDIParentFrame} itself. If any other commands are used in the menu, the derived frame should handle them. # # This function is currently not available under macOS. # @param menu [Wx::Menu] The menu to be used instead of the standard MDI Window menu or NULL. # @return [void] def set_window_menu(menu) end alias_method :window_menu=, :set_window_menu # Tiles the MDI child windows either horizontally or vertically depending on whether orient is {Wx::Orientation::HORIZONTAL} or {Wx::Orientation::VERTICAL}. # This method is only implemented in MSW MDI implementation and does nothing under the other platforms. # @param orient [Wx::Orientation] # @return [void] def tile(orient=Wx::Orientation::HORIZONTAL) end # Returns whether the MDI implementation is tab-based. # Currently only the MSW port uses the real MDI. In Mac ports the usual SDI is used, as common under this platforms, and all the other ports use TDI implementation. # TDI-based MDI applications have different appearance and functionality (e.g. child frames can't be minimized and only one of them is visible at any given time) so the application may need to adapt its interface somewhat depending on the return value of this function. # @return [Boolean] def self.is_tdi; end end # MDIParentFrame # An MDI child frame is a frame that can only exist inside a {Wx::MDIClientWindow}, which is itself a child of {Wx::MDIParentFrame}. # === Styles # # This class supports the following styles: # All of the standard {Wx::Frame} styles can be used but most of them are ignored by TDI-based MDI implementations. # Although internally an MDI child frame is a child of the MDI client window, in wxWidgets you create it as a child of {Wx::MDIParentFrame}. In fact, you can usually forget that the client window exists. MDI child frames are clipped to the area of the MDI client window, and may be iconized on the client window. You can associate a menubar with a child frame as usual, although an MDI child doesn't display its menubar under its own title bar. The MDI parent frame's menubar will be changed to reflect the currently active child frame. If there are currently no children, the parent frame's own menubar will be displayed. # # === # # Category: Managed Windows # @see Wx::MDIClientWindow # @see Wx::MDIParentFrame # @see Wx::Frame # # class MDIChildFrame < Frame # @overload initialize() # Default constructor. # @return [Wx::MDIChildFrame] # @overload initialize(parent, id, title, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::DEFAULT_FRAME_STYLE, name=Wx::FrameNameStr) # Constructor, creating the window. # # @see Wx::MDIChildFrame#create # @param parent [Wx::MDIParentFrame] The window parent. This should not be NULL. # @param id [Integer] The window identifier. It may take a value of -1 to indicate a default value. # @param title [String] The caption to be displayed on the frame's title bar. # @param pos [Array(Integer, Integer), Wx::Point] The window position. The value {Wx::DEFAULT_POSITION} indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform. # @param size [Array(Integer, Integer), Wx::Size] The window size. The value {Wx::DEFAULT_SIZE} indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform. # @param style [Integer] The window style. See {Wx::MDIChildFrame}. # @param name [String] The name of the window. This parameter is used to associate a name with the item, allowing the application user to set Motif resource values for individual windows. # @return [Wx::MDIChildFrame] def initialize(*args) end # Activates this MDI child frame. # # @see Wx::MDIChildFrame#maximize # @see Wx::MDIChildFrame#restore # @return [void] def activate; end # Used in two-step frame construction. # See {Wx::MDIChildFrame#initialize} for further details. # @param parent [Wx::MDIParentFrame] # @param id [Integer] # @param title [String] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param name [String] # @return [Boolean] def create(parent, id, title, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::DEFAULT_FRAME_STYLE, name=Wx::FrameNameStr) end # Returns the MDI parent frame containing this child. # Notice that this may return a different object than {Wx::MDIChildFrame#get_parent} as the child frames may be created as children of the client window internally. # @return [Wx::MDIParentFrame] def get_mdi_parent; end alias_method :mdi_parent, :get_mdi_parent # Returns true for MDI children in TDI implementations. # TDI-based implementations represent MDI children as pages in a {Wx::Notebook} and so they are always maximized and can't be restored or iconized. # @see Wx::MDIParentFrame.is_tdi. # @return [Boolean] def is_always_maximized; end alias_method :always_maximized?, :is_always_maximized # Maximizes this MDI child frame. # This function doesn't do anything if {Wx::MDIChildFrame#is_always_maximized} returns true. # @see Wx::MDIChildFrame#activate # @see Wx::MDIChildFrame#restore # @param maximize [Boolean] # @return [void] def maximize(maximize=true) end # Restores this MDI child frame (unmaximizes). # This function doesn't do anything if {Wx::MDIChildFrame#is_always_maximized} returns true. # @see Wx::MDIChildFrame#activate # @see Wx::MDIChildFrame#maximize # @return [void] def restore; end end # MDIChildFrame end