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.
See XML-based resource system overview for details.
Constructor.
The flags in Wx::XmlResource are not useful in ruby. All XmlResources
created will have the optimal flags.
Wx::XRC_USE_LOCALE
: translatable strings will be translated via _().Wx::XRC_NO_SUBCLASSING
: subclass property of object nodes will be ignored (useful for previews in XRC editors).Wx::XRC_NO_RELOADING
will 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).Class method to get the global XmlResource object.
Class method to set the global resources object. Returns the pointer to
the previous one, or nil if there was not one.
Attaches an unknown control to the given panel/window/dialog.
Unknown controls are used in conjunction with <object class="unknown">
.
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 equal.
Returns flags, which may be a bitlist of XRC_USE_LOCALE and XRC_NO_SUBCLASSING.
Returns version information (a.b.c.d = d+ 256*c + 256*b + 256*a).
Returns a numeric ID that is equivalent to the string ID used in an XML
resource. To be used in event tables.
The module method Wx::xrcid(name)
is provided for convenience.
Initializes handlers for all supported controls/windows. In wxRuby
versions 1.9.6 and later, this is called automatically for you, so there
is no need to call this method
Loads resources from the XML file file
. If this file does not exist,
or contains invalid XML, an exception will be raised; if successful, the
loaded file name will be returneed.
Loads a bitmap resource from a file.
Loads a dialog. dlg points to a parent window (if any).
Loads a dialog. dlg 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:
dlg = MyDialog.new the_xml_resource.load_dialog_subclass(dlg, main_frame, “my_dialog”) dlg.show_modalLoads a frame.
Loads a frame. This form is used to finish creation of an already existing instance.
Loads an icon resource from a file.
Loads menu from resource. Returns NULL on failure.
Loads a menubar from resource. Returns NULL on failure.
MenuBar load_menu_bar(%(arg-type)String% name)Loads a menubar from resource. Returns NULL on failure.
Loads any arbitrary object from the XML resource. The object should be
some Window (or a subclass) created with the no-arguments version of the
constructor – ie, an incomplete instance. The layout definition in the
XRC will complete the instance.
The argument instance is the incomplete object, and parent is the
Window to which it will be attached. name is the name attribute of the
object in the XML file, and class_name is the wxWidgets name of the
class of the instance being loaded. The class_name needs to be in C++
form, for example “wxWizard”.
Loads a panel. panel points to parent window (if any).
Loads a panel. panel points to parent window (if any). This form
is used to finish creation of an already existing instance.
Loads a toolbar.
Creates a wizard from the item named name in the XRC.
Loads a wizard. This form is used to finish creation of an already
existing instance – which may be a custom Ruby subclass.
Sets flags (bitlist of XRC_USE_LOCALE and XRC_NO_SUBCLASSING).
This function unloads a resource previously loaded by
load.
Returns if the resource was successfully unloaded and if it hasn’t
been found in the list of loaded resources.
[This page automatically generated from the Textile source at 2023-06-13 21:31:33 +0000]