# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # DEFAULT_FRAME_STYLE = 541072960 # Requests user attention,. # USER_ATTENTION_INFO = 1 # Results in a more drastic action. # USER_ATTENTION_ERROR = 2 # # # # class ContentProtection < Wx::Enum # Window contents are visible in screen captures. # CONTENT_PROTECTION_NONE = Wx::ContentProtection.new(0) # Window contents are not visible in screen captures. # CONTENT_PROTECTION_ENABLED = Wx::ContentProtection.new(1) end # ContentProtection # Don't display the menu bar. # FULLSCREEN_NOMENUBAR = 1 # Don't display toolbar bars. # FULLSCREEN_NOTOOLBAR = 2 # Don't display the status bar. # FULLSCREEN_NOSTATUSBAR = 4 # Don't display any border. # FULLSCREEN_NOBORDER = 8 # Don't display a caption. # FULLSCREEN_NOCAPTION = 16 # Combination of all above, will display the least possible. # FULLSCREEN_ALL = 31 # {Wx::TopLevelWindow} is a common base class for {Wx::Dialog} and {Wx::Frame}. # It is an abstract base class meaning that you never work with objects of this class directly, but all of its methods are also applicable for the two classes above. # Note that the instances of {Wx::TopLevelWindow} are managed by wxWidgets in the internal top level window list. # === Events emitted by this class # # Event handler methods for events emitted by this class: # # - {Wx::EvtHandler#EVT_MAXIMIZE}(meth = nil, &block): Process a {Wx::EVT_MAXIMIZE} event. See {Wx::MaximizeEvent}. # - {Wx::EvtHandler#evt_move}(meth = nil, &block): Process a {Wx::EVT_MOVE} event, which is generated when a window is moved. See {Wx::MoveEvent}. # - {Wx::EvtHandler#evt_move_start}(meth = nil, &block): Process a {Wx::EVT_MOVE_START} event, which is generated when the user starts to move or size a window. {Wx::MSW} only. See {Wx::MoveEvent}. # - {Wx::EvtHandler#evt_move_end}(meth = nil, &block): Process a {Wx::EVT_MOVE_END} event, which is generated when the user stops moving or sizing a window. {Wx::MSW} only. See {Wx::MoveEvent}. # - {Wx::EvtHandler#evt_show}(meth = nil, &block): Process a {Wx::EVT_SHOW} event. See {Wx::ShowEvent}. # - {Wx::EvtHandler#EVT_FULLSCREEN}(meth = nil, &block): Process a {Wx::EVT_FULLSCREEN} event. See {Wx::FullScreenEvent}. # # === # # Category: Managed Windows # @see Wx::Dialog # @see Wx::Frame # # class TopLevelWindow < NonOwnedWindow # @overload initialize() # Default ctor. # @return [TopLevelWindow] # @overload initialize(parent, id, title, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::DEFAULT_FRAME_STYLE, name=Wx::FrameNameStr) # Constructor creating the top level window. # @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 [TopLevelWindow] def initialize(*args) end # Creates the top level window. # @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 [true,false] def create(parent, id, title, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::DEFAULT_FRAME_STYLE, name=Wx::FrameNameStr) end # Returns true if the platform supports making the window translucent. # # @see Wx::TopLevelWindow#set_transparent # @return [true,false] def can_set_transparent; end alias_method :can_set_transparent?, :can_set_transparent # A synonym for {Wx::TopLevelWindow#centre_on_screen}. # @param direction [Integer] # @return [void] def center_on_screen(direction=Wx::Orientation::BOTH) end # Centres the window on screen. # # @see Wx::Window#centre_on_parent # @param direction [Integer] Specifies the direction for the centering. May be {Wx::Orientation::HORIZONTAL}, {Wx::Orientation::VERTICAL} or {Wx::Orientation::BOTH}. # @return [void] def centre_on_screen(direction=Wx::Orientation::BOTH) end # Enables or disables the Close button (most often in the right upper corner of a dialog) and the Close entry of the system menu (most often in the left upper corner of the dialog). # Returns true if operation was successful. This may be wrong on X11 (including GTK+) where the window manager may not support this operation and there is no way to find out. # @param enable [true,false] # @return [true,false] def enable_close_button(enable=true) end # Enables or disables the Maximize button (in the right or left upper corner of a frame or dialog). # Currently only implemented for {Wx::MSW} and {Wx::OSX}. # The window style must contain {Wx::MAXIMIZE_BOX}. # Returns true if operation was successful. Note that a successful operation does not change the window style flags. # @param enable [true,false] # @return [true,false] def enable_maximize_button(enable=true) end # Enables or disables the Minimize button (in the right or left upper corner of a frame or dialog). # Currently only implemented for {Wx::MSW} and {Wx::OSX}. # The window style must contain {Wx::MINIMIZE_BOX}. # Note that in {Wx::MSW} a successful operation will change the window style flags. # Returns true if operation was successful. Note that a successful operation does not change the window style flags. # @param enable [true,false] # @return [true,false] def enable_minimize_button(enable=true) end # Returns a pointer to the button which is the default for this window, or NULL. # The default button is the one activated by pressing the Enter key. # @return [Wx::Window] def get_default_item; end alias_method :default_item, :get_default_item # Returns the standard icon of the window. # The icon will be invalid if it hadn't been previously set by {Wx::TopLevelWindow#set_icon}. # @see Wx::TopLevelWindow#get_icons # @return [Wx::Icon] def get_icon; end alias_method :icon, :get_icon # Returns all icons associated with the window, there will be none of them if neither {Wx::TopLevelWindow#set_icon} nor {Wx::TopLevelWindow#set_icons} had been called before. # Use {Wx::TopLevelWindow#get_icon} to get the main icon of the window. # @see Wx::IconBundle # @return [void] def get_icons; end alias_method :icons, :get_icons # Gets a string containing the window title. # # @see Wx::TopLevelWindow#set_title # @return [String] def get_title; end alias_method :title, :get_title # Iconizes or restores the window. # Note that in {Wx::GTK} the change to the window state is not immediate, i.e. {Wx::TopLevelWindow#is_iconized} will typically return false right after a call to {Wx::TopLevelWindow#iconize} and its return value will only change after the control flow returns to the event loop and the notification about the window being really iconized is received. # @see Wx::TopLevelWindow#is_iconized # @see Wx::TopLevelWindow#restore() # @see Wx::IconizeEvent. # @param iconize [true,false] If true, iconizes the window; if false, shows and restores it. # @return [void] def iconize(iconize=true) end # Returns true if this window is currently active, i.e. if the user is currently working with it. # @return [true,false] def is_active; end alias_method :active?, :is_active # Returns true if this window is expected to be always maximized, either due to platform policy or due to local policy regarding particular class. # @return [true,false] def is_always_maximized; end alias_method :always_maximized?, :is_always_maximized # Returns true if the window is in fullscreen mode. # # @see Wx::TopLevelWindow#show_full_screen # @return [true,false] def is_full_screen; end alias_method :full_screen?, :is_full_screen # Returns true if the window is iconized. # @return [true,false] def is_iconized; end alias_method :iconized?, :is_iconized # Returns true if the window is maximized. # @return [true,false] def is_maximized; end alias_method :maximized?, :is_maximized # This method is specific to {Wx::Universal} port. # Returns true if this window is using native decorations, false if we draw them ourselves. # @see Wx::TopLevelWindow#use_native_decorations # @see Wx::TopLevelWindow#use_native_decorations_by_default # @return [true,false] def is_using_native_decorations; end alias_method :using_native_decorations?, :is_using_native_decorations # Lays out the children using the window sizer or resizes the only child of the window to cover its entire area. # This class overrides the base class {Wx::TopLevelWindow#layout} method to check if this window contains exactly one child which is commonly the case, with {Wx::Panel} being often created as the only child of {Wx::TopLevelWindow} and, if this is the case, resizes this child window to cover the entire client area. # Note that if you associate a sizer with this window, the sizer takes precedence and the only-child-resizing is only used as fallback. # false if nothing was done because the window has neither a sizer nor a single child, true otherwise. # @return [true,false] def layout; end # Maximizes or restores the window. # Note that, just as with {Wx::TopLevelWindow#iconize}, the change to the window state is not immediate in at least {Wx::GTK} port. # @see Wx::TopLevelWindow#restore # @see Wx::TopLevelWindow#iconize # @param maximize [true,false] If true, maximizes the window, otherwise it restores it. # @return [void] def maximize(maximize=true) end # MSW-specific function for accessing the system menu. # Returns a {Wx::Menu} pointer representing the system menu of the window under MSW. The returned {Wx::Menu} may be used, if non-NULL, to add extra items to the system menu. The usual {Wx::EVT_MENU} events (that can be processed using EVT_MENU event table macro) will then be generated for them. All the other {Wx::Menu} methods may be used as well but notice that they won't allow you to access any standard system menu items (e.g. they can't be deleted or modified in any way currently). # Notice that because of the native system limitations the identifiers of the items added to the system menu must be multiples of 16, otherwise no events will be generated for them. # The returned pointer must not be deleted, it is owned by the window and will be only deleted when the window itself is destroyed. # This function is not available in the other ports by design, any occurrences of it in the portable code must be guarded by # # #ifdef __WXMSW__ # preprocessor guards. # @return [Wx::Menu] def msw_get_system_menu; end # Use a system-dependent way to attract users attention to the window when it is in background. # flags may have the value of either {Wx::USER_ATTENTION_INFO} (default) or {Wx::USER_ATTENTION_ERROR} which results in a more drastic action. When in doubt, use the default value. # This function should normally be only used when the application is not already in foreground. # # This function is currently implemented for Win32 where it flashes the window icon in the taskbar, and for {Wx::GTK} with task bars supporting it. # @param flags [Integer] # @return [void] def request_user_attention(flags=Wx::USER_ATTENTION_INFO) end # Restore a previously iconized or maximized window to its normal state. # In {Wx::GTK} this method currently doesn't return the maximized window to its normal state and you must use {Wx::TopLevelWindow#maximize} with false argument explicitly for this. In the other ports, it both unmaximizes the maximized windows and uniconizes the iconized ones. # @see Wx::TopLevelWindow#iconize # @see Wx::TopLevelWindow#maximize # @return [void] def restore; end # Changes the default item for the panel, usually win is a button. # # @see Wx::TopLevelWindow#get_default_item # @param win [Wx::Window] # @return [Wx::Window] def set_default_item(win) end alias_method :default_item=, :set_default_item # @param win [Wx::Window] # @return [Wx::Window] def set_tmp_default_item(win) end alias_method :tmp_default_item=, :set_tmp_default_item # @return [Wx::Window] def get_tmp_default_item; end alias_method :tmp_default_item, :get_tmp_default_item # Sets the icon for this window. # The window takes a 'copy' of icon, but since it uses reference counting, the copy is very quick. It is safe to delete icon after calling this function. # # In {Wx::MSW}, icon must be either 16x16 or 32x32 icon. # @see Wx::Icon # @see Wx::TopLevelWindow#set_icons # @param icon [Wx::Icon] The {Wx::Icon} to associate with this window. # @return [void] def set_icon(icon) end alias_method :icon=, :set_icon # Sets several icons of different sizes for this window: this allows using different icons for different situations (e.g. # task switching bar, taskbar, window title bar) instead of scaling, with possibly bad looking results, the only icon set by {Wx::TopLevelWindow#set_icon}. # # In {Wx::MSW}, icons must contain a 16x16 or 32x32 icon, preferably both. # @see Wx::IconBundle # @param icons [Wx::IconBundle] The icons to associate with this window. # @return [void] def set_icons(icons) end alias_method :icons=, :set_icons # A simpler interface for setting the size hints than {Wx::TopLevelWindow#set_size_hints}. # @param size [Array(Integer, Integer), Wx::Size] # @return [void] def set_max_size(size) end alias_method :max_size=, :set_max_size # A simpler interface for setting the size hints than {Wx::TopLevelWindow#set_size_hints}. # @param size [Array(Integer, Integer), Wx::Size] # @return [void] def set_min_size(size) end alias_method :min_size=, :set_min_size # @overload set_size_hints(minW, minH, maxW=-1, maxH=-1, incW=-1, incH=-1) # Allows specification of minimum and maximum window sizes, and window size increments. # If a pair of values is not set (or set to -1), no constraints will be used. # # Notice that this function not only prevents the user from resizing the window outside the given bounds but it also prevents the program itself from doing it using {Wx::Window#set_size}. # @param minW [Integer] The minimum width. # @param minH [Integer] The minimum height. # @param maxW [Integer] The maximum width. # @param maxH [Integer] The maximum height. # @param incW [Integer] Specifies the increment for sizing the width (GTK/Motif/Xt only). # @param incH [Integer] Specifies the increment for sizing the height (GTK/Motif/Xt only). # @return [void] # @overload set_size_hints(minSize, maxSize=Wx::DEFAULT_SIZE, incSize=Wx::DEFAULT_SIZE) # Allows specification of minimum and maximum window sizes, and window size increments. # If a pair of values is not set (or set to -1), no constraints will be used. # # Notice that this function not only prevents the user from resizing the window outside the given bounds but it also prevents the program itself from doing it using {Wx::Window#set_size}. # @param minSize [Array(Integer, Integer), Wx::Size] The minimum size of the window. # @param maxSize [Array(Integer, Integer), Wx::Size] The maximum size of the window. # @param incSize [Array(Integer, Integer), Wx::Size] Increment size (only taken into account under X11-based ports such as {Wx::GTK}/{Wx::Motif}/{Wx::X11}). # @return [void] def set_size_hints(*args) end alias_method :size_hints=, :set_size_hints # Sets the window title. # # @see Wx::TopLevelWindow#get_title # @param title [String] The window title. # @return [void] def set_title(title) end alias_method :title=, :set_title # If the platform supports it will set the window to be translucent. # Note that in {Wx::GTK} this function must be called before the window is shown the first time it's called (but it can be called again after showing the window too). # See the shaped sample for an example of using this function. # @param alpha [Integer] Determines how opaque or transparent the window will be, if the platform supports the operation. A value of 0 sets the window to be fully transparent, and a value of 255 sets the window to be fully opaque. # @return [true,false] def set_transparent(alpha) end alias_method :transparent=, :set_transparent # This virtual function is not meant to be called directly but can be overridden to return false (it returns true by default) to allow the application to close even if this, presumably not very important, window is still opened. # By default, the application stays alive as long as there are any open top level windows. # @return [true,false] def should_prevent_app_exit; end # This function sets the {Wx::TopLevelWindow}'s modified state on macOS, which currently draws a black dot in the {Wx::TopLevelWindow}'s close button. # On other platforms, this method does nothing. # @see Wx::TopLevelWindow#osx_is_modified # @param modified [true,false] # @return [void] def osx_set_modified(modified) end # Returns the current modified state of the {Wx::TopLevelWindow} on macOS. # On other platforms, this method does nothing. # @see Wx::TopLevelWindow#osx_set_modified # @return [true,false] def osx_is_modified; end # Sets the file name represented by this {Wx::TopLevelWindow}. # Under macOS, this file name is used to set the "proxy icon", which appears in the window title bar near its title, corresponding to this file name. Under other platforms it currently doesn't do anything but it is harmless to call it now and it might be implemented to do something useful in the future so you're encouraged to use it for any window representing a file-based document. # @param filename [String] # @return [void] def set_represented_filename(filename) end alias_method :represented_filename=, :set_represented_filename # Show the {Wx::TopLevelWindow}, but do not give it keyboard focus. # This can be used for pop up or notification windows that should not steal the current focus. # @return [void] def show_without_activating; end # Enables the zoom button to toggle full screen mode. # A {Wx::FullScreenEvent} is generated when the users enters or exits full screen via the enter/exit full screen button. # # true if the button behaviour has been changed, false if running under another OS. # # Having the button is also required to let {Wx::TopLevelWindow#show_full_screen} make use of the full screen API: a full screen window gets its own space and entering and exiting the mode is animated. If the button is not present the old way of switching to full screen is used. Only {Wx::FULLSCREEN_NOTOOLBAR} and {Wx::FULLSCREEN_NOMENUBAR} will be used when using the fullscreen API (other values are ignored). # # Availability: only available for the {Wx::OSX/Cocoa} port. {Wx::osx} # @see Wx::TopLevelWindow#show_full_screen # @see Wx::FullScreenEvent # @param enable [true,false] If true (default) make the zoom button toggle full screen; if false the button does only toggle zoom. # @param style [Integer] This parameter sets which elements will be hidden when the user presses the full screen button. See {Wx::TopLevelWindow#show_full_screen} for possible values. It is available since wxWidgets 3.1.6. # @return [true,false] def enable_full_screen_view(enable=true, style=Wx::FULLSCREEN_ALL) end # Depending on the value of show parameter the window is either shown full screen or restored to its normal state. # style is a bit list containing some or all of the following values, which indicate what elements of the window to hide in full-screen mode: # # - {Wx::FULLSCREEN_NOMENUBAR} - {Wx::FULLSCREEN_NOTOOLBAR} - {Wx::FULLSCREEN_NOSTATUSBAR} - {Wx::FULLSCREEN_NOBORDER} - {Wx::FULLSCREEN_NOCAPTION} - {Wx::FULLSCREEN_ALL} (all of the above) # # This function has not been tested with MDI frames. # Showing a window full screen also actually {Wx::TopLevelWindow#show}s the window if it isn't shown. # @see Wx::TopLevelWindow#enable_full_screen_view # @see Wx::TopLevelWindow#is_full_screen # @param show [true,false] # @param style [Integer] # @return [true,false] def show_full_screen(show, style=Wx::FULLSCREEN_ALL) end # Get the current content protection of the window. # # @see Wx::TopLevelWindow#set_content_protection # @return [ContentProtection] def get_content_protection; end alias_method :content_protection, :get_content_protection # Set content protection for the window. # When content protection is enabled contents of this window will not be included in screen captures. # Obviously this can't provide absolute security as there might be workarounds and tools that bypass this protection. Additionally a screen could always be photographed. # true if the content protection was changed, false if running under an unsupported OS. # # Windows 7 or newer is required but any macOS version is supported. # # Availability: only available for the {Wx::MSW}, {Wx::OSX/Cocoa} ports. {Wx::msw},{Wx::osx} # @see Wx::TopLevelWindow#get_content_protection # @param contentProtection [ContentProtection] # @return [true,false] def set_content_protection(contentProtection) end alias_method :content_protection=, :set_content_protection # This method is specific to {Wx::Universal} port. # Use native or custom-drawn decorations for this window only. Notice that to have any effect this method must be called before really creating the window, i.e. two step creation must be used: # # MyFrame *frame = new MyFrame; // use default ctor # frame->UseNativeDecorations(false); // change from default "true" # frame->Create(parent, title, ...); // really create the frame # @see Wx::TopLevelWindow#use_native_decorations_by_default # @see Wx::TopLevelWindow#is_using_native_decorations # @param native [true,false] # @return [void] def use_native_decorations(native=true) end # This method is specific to {Wx::Universal} port. # Top level windows in {Wx::Universal} port can use either system-provided window decorations (i.e. title bar and various icons, buttons and menus in it) or draw the decorations themselves. By default the system decorations are used if they are available, but this method can be called with native set to false to change this for all windows created after this point. # Also note that if WXDECOR environment variable is set, then custom decorations are used by default and so it may make sense to call this method with default argument if the application can't use custom decorations at all for some reason. # @see Wx::TopLevelWindow#use_native_decorations # @param native [true,false] # @return [void] def use_native_decorations_by_default(native=true) end # Get the default size for a new top level window. # This is used internally by wxWidgets on some platforms to determine the default size for a window created using {Wx::DEFAULT_SIZE} so it is not necessary to use it when creating a {Wx::TopLevelWindow}, however it may be useful if a rough estimation of the window size is needed for some other reason. # @return [Wx::Size] def self.get_default_size; end end # TopLevelWindow end