# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # Flags which can be used with {Wx::XmlResource::XmlResource}. # # # class XmlResourceFlags < Wx::Enum # Translatable strings will be translated via {_}. # XRC_USE_LOCALE = Wx::XmlResourceFlags.new(1) # Subclass property of object nodes will be ignored (useful for previews in XRC editors). # XRC_NO_SUBCLASSING = Wx::XmlResourceFlags.new(2) # Prevent the XRC files from being reloaded from disk in case they have been modified there since being last loaded (may slightly speed up loading them). # XRC_NO_RELOADING = Wx::XmlResourceFlags.new(4) # Expand environment variables for paths in XRC (such as bitmaps or icons). # XRC_USE_ENVVARS = Wx::XmlResourceFlags.new(8) end # XmlResourceFlags # This is the main class for interacting with the XML-based resource system. # The class holds XML resources from one or more .xml files, binary files or zip archive files. # Note that this is a singleton class and you'll never allocate/deallocate it. Just use the static {Wx::XmlResource.get} getter. # # === # # Category: XML Based Resource System (XRC) # @see XML Based Resource System (XRC) # @see XRC File Format # # class XmlResource < Object # @overload initialize(filemask, flags=Wx::XmlResourceFlags::XRC_USE_LOCALE, domain=('')) # Constructor. # @param filemask [String] The XRC file, archive file, or wildcard specification that will be used to load all resource files inside a zip archive. # @param flags [Integer] One or more value of the {Wx::XmlResourceFlags} enumeration. # @param domain [String] The name of the gettext catalog to search for translatable strings. By default all loaded catalogs will be searched. This provides a way to allow the strings to only come from a specific catalog. # @return [XmlResource] # @overload initialize(flags=Wx::XmlResourceFlags::XRC_USE_LOCALE, domain=('')) # Constructor. # @param flags [Integer] One or more value of the {Wx::XmlResourceFlags} enumeration. # @param domain [String] The name of the gettext catalog to search for translatable strings. By default all loaded catalogs will be searched. This provides a way to allow the strings to only come from a specific catalog. # @return [XmlResource] def initialize(*args) end # Attaches an unknown control to the given panel/window/dialog. # Unknown controls are used in conjunction with . # @param name [String] # @param control [Wx::Window] # @param parent [Wx::Window] # @return [true,false] def attach_unknown_control(name, control, parent=nil) end # Compares the XRC version to the argument. # Returns -1 if the XRC version is less than the argument, +1 if greater, and 0 if they are equal. # @param major [Integer] # @param minor [Integer] # @param release [Integer] # @param revision [Integer] # @return [Integer] def compare_version(major, minor, release, revision) end # Returns the domain (message catalog) that will be used to load translatable strings in the XRC. # @return [Wx::String] def get_domain; end alias_method :domain, :get_domain # Returns flags, which may be a bitlist of {Wx::XmlResourceFlags} enumeration values. # @return [Integer] def get_flags; end alias_method :flags, :get_flags # Returns the {Wx::XmlNode} containing the definition of the object with the given name or NULL. # This function recursively searches all the loaded XRC files for an object with the specified name. If the object is found, the {Wx::XmlNode} corresponding to it is returned, so this function can be used to access additional information defined in the XRC file and not used by {Wx::XmlResource} itself, e.g. contents of application-specific XML tags. # # The node corresponding to the resource with the given name or NULL. # @param name [String] The name of the resource which must be unique for this function to work correctly, if there is more than one resource with the given name the choice of the one returned by this function is undefined. # @return [Wx::XmlNode] def get_resource_node(name) end alias_method :resource_node, :get_resource_node # Returns version information (a.b.c.d = d + 256*c + 2562*b + 2563*a). # @return [Integer] def get_version; end alias_method :version, :get_version # Initializes handlers for all supported controls/windows. # This will make the executable quite big because it forces linking against most of the wxWidgets library. # @return [void] def init_all_handlers; end # Loads resources from XML files that match given filemask. # Example: # # if (!wxXmlResource::Get()->Load("rc/*.xrc")) # wxLogError("Couldn't load resources!"); # # If {Wx::USE_FILESYS} is enabled, this method understands {Wx::FileSystem} URLs (see Wx::FileSystem#find_first). # # If you are sure that the argument is name of single XRC file (rather than an URL or a wildcard), use {Wx::XmlResource#load_file} instead. # @see Wx::XmlResource#load_file # @see Wx::XmlResource#load_all_files # @param filemask [String] # @return [true,false] def load(filemask) end # Simpler form of {Wx::XmlResource#load} for loading a single XRC file. # # @see Wx::XmlResource#load # @see Wx::XmlResource#load_all_files # @see Wx::XmlResource#load_document # @param file [Wx::FileName] # @return [true,false] def load_file(file) end # Loads all .xrc files from directory dirname. # Tries to load as many files as possible; if there's an error while loading one file, it still attempts to load other files. # @see Wx::XmlResource#load_file # @see Wx::XmlResource#load # @param dirname [String] # @return [true,false] def load_all_files(dirname) end # Loads a bitmap resource from a file. # @param name [String] # @return [Wx::Bitmap] def load_bitmap(name) end # Loads a dialog. # parent points to parent window (if any). # @param parent [Wx::Window] # @param name [String] # @return [Wx::Dialog] def load_dialog(parent, name) end # Loads a dialog. # parent points to parent window (if any). # This form is used to finish creation of an already existing instance (the main reason for this is that you may want to use derived class with a new event table). Example: # # MyDialog dlg; # wxXmlResource::Get()->LoadDialog(&dlg, mainFrame, "my_dialog"); # dlg.ShowModal(); # @param dlg [Wx::Dialog] # @param parent [Wx::Window] # @param name [String] # @return [true,false] def load_dialog_subclass(dlg, parent, name) end # Loads a frame from the resource. # parent points to parent window (if any). # @param parent [Wx::Window] # @param name [String] # @return [Wx::Frame] def load_frame(parent, name) end # Loads the contents of a frame onto an existing {Wx::Frame}. # This form is used to finish creation of an already existing instance (the main reason for this is that you may want to use derived class with a new event table). # @param frame [Wx::Frame] # @param parent [Wx::Window] # @param name [String] # @return [true,false] def load_frame_subclass(frame, parent, name) end # Loads an icon resource from a file. # @param name [String] # @return [Wx::Icon] def load_icon(name) end # Loads menu from resource. # Returns NULL on failure. # @param name [String] # @return [Wx::Menu] def load_menu(name) end # @overload load_menu_bar(parent, name) # Loads a menubar from resource. # Returns NULL on failure. # @param parent [Wx::Window] # @param name [String] # @return [Wx::MenuBar] # @overload load_menu_bar(name) # @param name [String] # @return [Wx::MenuBar] def load_menu_bar(*args) end # @overload load_object(parent, name, classname) # Load an object from the resource specifying both the resource name and the class name. # The first overload lets you load nonstandard container windows and returns NULL on failure. The second one lets you finish the creation of an existing instance and returns false on failure. # In either case, only the resources defined at the top level of XRC files can be loaded by this function, use {Wx::XmlResource#load_object_recursively} if you need to load an object defined deeper in the hierarchy. # @param parent [Wx::Window] # @param name [String] # @param classname [String] # @return [Wx::Object] # @overload load_object(instance, parent, name, classname) # @param instance [Wx::Object] # @param parent [Wx::Window] # @param name [String] # @param classname [String] # @return [true,false] def load_object(*args) end # @overload load_object_recursively(parent, name, classname) # Load an object from anywhere in the resource tree. # These methods are similar to {Wx::XmlResource#load_object} but may be used to load an object from anywhere in the resource tree and not only the top level. Note that you will very rarely need to do this as in normal use the entire container window (defined at the top level) is loaded and not its individual children but this method can be useful in some particular situations. # @param parent [Wx::Window] # @param name [String] # @param classname [String] # @return [Wx::Object] # @overload load_object_recursively(instance, parent, name, classname) # @param instance [Wx::Object] # @param parent [Wx::Window] # @param name [String] # @param classname [String] # @return [true,false] def load_object_recursively(*args) end # Loads a panel. # parent points to the parent window. # @param parent [Wx::Window] # @param name [String] # @return [Wx::Panel] def load_panel(parent, name) end # Loads a panel. # parent points to the parent window. This form is used to finish creation of an already existing instance. # @param panel [Wx::Panel] # @param parent [Wx::Window] # @param name [String] # @return [true,false] def load_panel_subclass(panel, parent, name) end # Loads a toolbar. # @param parent [Wx::Window] # @param name [String] # @return [Wx::ToolBar] def load_tool_bar(parent, name) end # Sets the domain (message catalog) that will be used to load translatable strings in the XRC. # @param domain [String] # @return [void] def set_domain(domain) end alias_method :domain=, :set_domain # Sets flags (bitlist of {Wx::XmlResourceFlags} enumeration values). # @param flags [Integer] # @return [void] def set_flags(flags) end alias_method :flags=, :set_flags # This function unloads a resource previously loaded by {Wx::XmlResource#load}. # Returns true if the resource was successfully unloaded and false if it hasn't been found in the list of loaded resources. # @param filename [String] # @return [true,false] def unload(filename) end # Registers subclasses factory for use in XRC. # This is useful only for language bindings developers who need a way to implement subclassing in wxWidgets ports that don't support {Wx::RTTI} (e.g. {Wx::Python}). # @param factory [Wx::XmlSubclassFactory] # @return [void] def self.add_subclass_factory(factory) end # Returns a string ID corresponding to the given numeric ID. # The string returned is such that calling {Wx::XmlResource.get_xrcid} with it as parameter yields numId. If there is no string identifier corresponding to the given numeric one, an empty string is returned. # Notice that, unlike {Wx::XmlResource.get_xrcid}, this function is slow as it checks all of the identifiers used in XRC. # @param numId [Integer] # @return [String] def self.find_xrcid_by_id(numId) end # Gets the global resources object or creates one if none exists. # @return [Wx::XmlResource] def self.get; end # Returns a numeric ID that is equivalent to the string ID used in an XML resource. # If an unknown str_id is requested (i.e. other than {Wx::ID_XXX} or integer), a new record is created which associates the given string with a number. # If value_if_not_found is {Wx::StandardID::ID_NONE}, the number is obtained via {new_id}. Otherwise value_if_not_found is used. # Macro XRCID(name) is provided for convenient use in event tables. # IDs returned by XRCID() cannot be used with the EVT_*_RANGE macros, because the order in which they are assigned to symbolic name values is not guaranteed. # @param str_id [String] # @param value_if_not_found [Integer] # @return [Integer] def self.get_xrcid(str_id, value_if_not_found=Wx::StandardID::ID_NONE) end # Sets the global resources object and returns a pointer to the previous one (may be NULL). # @param res [Wx::XmlResource] # @return [Wx::XmlResource] def self.set(res) end end # XmlResource end