2 % automatically generated by HelpGen $Revision$ from
3 % xmlres.h at 22/Jan/02 23:08:28
6 \section{\class{wxXmlResource
}}\label{wxxmlresource
}
8 This is the main class for interacting with the XML-based resource system.
10 The class holds XML resources from one or more .xml files, binary files or zip archive files.
12 See
\helpref{XML-based resource system overview
}{xrcoverview
} for details.
14 \wxheading{Derived from
}
16 \helpref{wxObject
}{wxobject
}
18 \wxheading{Include files
}
25 enum wxXmlResourceFlags
28 wxXRC_NO_SUBCLASSING =
2,
29 wxXRC_NO_RELOADING =
4
33 \latexignore{\rtfignore{\wxheading{Members
}}}
36 \membersection{wxXmlResource::wxXmlResource
}\label{wxxmlresourcector
}
38 \func{}{wxXmlResource
}{\param{const wxString\&
}{filemask
},
\param{int
}{flags = wxXRC
\_USE\_LOCALE}}
42 \docparam{filemask
}{The XRC file, archive file, or wildcard specification that will be used to
43 load all resource files inside a zip archive.
}
45 \docparam{flags
}{wxXRC
\_USE\_LOCALE: translatable strings will be translated via
\_().
46 wxXRC
\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
47 (useful for previews in XRC editors).
}
49 \func{}{wxXmlResource
}{\param{int
}{flags = wxXRC
\_USE\_LOCALE}}
53 \docparam{flags
}{wxXRC
\_USE\_LOCALE: translatable strings will be translated via
\_().
54 wxXRC
\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
55 (useful for previews in XRC editors). wxXRC
\_NO\_RELOADING will prevent the
56 XRC files from being reloaded from disk in case they have been modified there
57 since being last loaded (may slightly speed up loading them).
}
60 \membersection{wxXmlResource::
\destruct{wxXmlResource
}}\label{wxxmlresourcedtor
}
62 \func{}{\destruct{wxXmlResource
}}{\void}
67 \membersection{wxXmlResource::AddHandler
}\label{wxxmlresourceaddhandler
}
69 \func{void
}{AddHandler
}{\param{wxXmlResourceHandler*
}{handler
}}
71 Initializes only a specific handler (or custom handler). Convention says
72 that the handler name is equal to the control's name plus 'XmlHandler', for example
73 wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource compiler
74 (wxxrc) can create include file that contains initialization code for
75 all controls used within the resource. Note that this handler should be
76 allocated on the heap, since it will be delete by
77 \helpref{ClearHandlers
}{wxxmlresourceclearhandlers
} later.
80 \membersection{wxXmlResource::AttachUnknownControl
}\label{wxxmlresourceattachunknowncontrol
}
82 \func{bool
}{AttachUnknownControl
}{\param{const wxString\&
}{name
},
\param{wxWindow*
}{control
},
\param{wxWindow*
}{parent = NULL
}}
84 Attaches an unknown control to the given panel/window/dialog.
85 Unknown controls are used in conjunction with <object class="unknown">.
88 \membersection{wxXmlResource::ClearHandlers
}\label{wxxmlresourceclearhandlers
}
90 \func{void
}{ClearHandlers
}{\void}
92 Removes all handlers and deletes them (this means that any handlers added using
93 \helpref{AddHandler
}{wxxmlresourceaddhandler
} must be allocated on the heap).
96 \membersection{wxXmlResource::CompareVersion
}\label{wxxmlresourcecompareversion
}
98 \constfunc{int
}{CompareVersion
}{\param{int
}{major
},
\param{int
}{minor
},
\param{int
}{release
},
\param{int
}{revision
}}
100 Compares the XRC version to the argument. Returns -
1 if the XRC version
101 is less than the argument, +
1 if greater, and
0 if they equal.
104 \membersection{wxXmlResource::Get
}\label{wxxmlresourceget
}
106 \func{wxXmlResource*
}{Get
}{\void}
108 Gets the global resources object or creates one if none exists.
111 \membersection{wxXmlResource::GetFlags
}\label{wxxmlresourcegetflags
}
113 \func{int
}{GetFlags
}{\void}
115 Returns flags, which may be a bitlist of wxXRC
\_USE\_LOCALE and wxXRC
\_NO\_SUBCLASSING.
118 \membersection{wxXmlResource::GetVersion
}\label{wxxmlresourcegetversion
}
120 \constfunc{long
}{GetVersion
}{\void}
122 Returns version information (a.b.c.d = d+
256*c +
256\textasciicircum2*b +
256\textasciitilde3*a).
125 \membersection{wxXmlResource::GetXRCID
}\label{wxxmlresourcegetxmlid
}
127 \func{int
}{GetXRCID
}{\param{const wxChar*
}{str
\_id},
\param{int
}{value
\_if\_not\_found = -
2}}
129 Returns a numeric ID that is equivalent to the string ID used in an XML
130 resource. If an unknown
\arg{str
\_id} is requested (i.e. other than wxID
\_XXX
131 or integer), a new record is created which associates the given string with
132 a number. If
\arg{value
\_if\_not\_found} is
\texttt{wxID
\_NONE}, the number is obtained via
133 \helpref{wxNewId()
}{wxnewid
}. Otherwise
\arg{value
\_if\_not\_found} is used.
134 Macro
{\tt XRCID(name)
} is provided for convenient use in event tables.
136 \membersection{wxXmlResource::InitAllHandlers
}\label{wxxmlresourceinitallhandlers
}
138 \func{void
}{InitAllHandlers
}{\void}
140 Initializes handlers for all supported controls/windows. This will
141 make the executable quite big because it forces linking against
142 most of the wxWidgets library.
145 \membersection{wxXmlResource::Load
}\label{wxxmlresourceload
}
147 \func{bool
}{Load
}{\param{const wxString\&
}{filemask
}}
149 Loads resources from XML files that match given filemask.
150 This method understands VFS (see filesys.h).
153 \membersection{wxXmlResource::LoadBitmap
}\label{wxxmlresourceloadbitmap
}
155 \func{wxBitmap
}{LoadBitmap
}{\param{const wxString\&
}{name
}}
157 Loads a bitmap resource from a file.
160 \membersection{wxXmlResource::LoadDialog
}\label{wxxmlresourceloaddialog
}
162 \func{wxDialog*
}{LoadDialog
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
164 Loads a dialog.
{\it dlg
} points to a parent window (if any).
166 \func{bool
}{LoadDialog
}{\param{wxDialog*
}{dlg
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
168 Loads a dialog.
{\it dlg
} points to parent window (if any).
170 This form is used to finish creation of an already existing instance (the main reason
171 for this is that you may want to use derived class with a new event table).
177 wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
182 \membersection{wxXmlResource::LoadFrame
}\label{wxxmlresourceloadframe
}
184 \func{bool
}{LoadFrame
}{\param{wxFrame*
}{frame
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
189 \membersection{wxXmlResource::LoadIcon
}\label{wxxmlresourceloadicon
}
191 \func{wxIcon
}{LoadIcon
}{\param{const wxString\&
}{name
}}
193 Loads an icon resource from a file.
196 \membersection{wxXmlResource::LoadMenu
}\label{wxxmlresourceloadmenu
}
198 \func{wxMenu*
}{LoadMenu
}{\param{const wxString\&
}{name
}}
200 Loads menu from resource. Returns NULL on failure.
203 \membersection{wxXmlResource::LoadMenuBar
}\label{wxxmlresourceloadmenubar
}
205 \func{wxMenuBar*
}{LoadMenuBar
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
207 Loads a menubar from resource. Returns NULL on failure.
209 \func{wxMenuBar*
}{LoadMenuBar
}{\param{const wxString\&
}{name
}}
211 Loads a menubar from resource. Returns NULL on failure.
214 \membersection{wxXmlResource::LoadPanel
}\label{wxxmlresourceloadpanel
}
216 \func{wxPanel*
}{LoadPanel
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
218 Loads a panel.
{\it panel
} points to parent window (if any).
220 \func{bool
}{LoadPanel
}{\param{wxPanel*
}{panel
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
222 Loads a panel.
{\it panel
} points to parent window (if any). This form
223 is used to finish creation of an already existing instance.
226 \membersection{wxXmlResource::LoadToolBar
}\label{wxxmlresourceloadtoolbar
}
228 \func{wxToolBar*
}{LoadToolBar
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
233 \membersection{wxXmlResource::Set
}\label{wxxmlresourceset
}
235 \func{wxXmlResource*
}{Set
}{\param{wxXmlResource*
}{res
}}
237 Sets the global resources object and returns a pointer to the previous one (may be NULL).
240 \membersection{wxXmlResource::SetFlags
}\label{wxxmlresourcesetflags
}
242 \func{void
}{SetFlags
}{\param{int
}{flags
}}
244 Sets flags (bitlist of wxXRC
\_USE\_LOCALE and wxXRC
\_NO\_SUBCLASSING).
247 \membersection{wxXmlResource::Unload
}\label{wxxmlresourceunload
}
249 \func{bool
}{Unload
}{\param{const wxString\&
}{filename
}}
251 This function unloads a resource previously loaded by
252 \helpref{Load()
}{wxxmlresourceload
}.
254 Returns
\true if the resource was successfully unloaded and
\false if it hasn't
255 been found in the list of loaded resources.