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
}
22 \wxheading{Data structures
}
25 enum wxXmlResourceFlags
28 wxXRC_NO_SUBCLASSING =
2
32 \latexignore{\rtfignore{\wxheading{Members
}}}
34 \membersection{wxXmlResource::wxXmlResource
}\label{wxxmlresourcector
}
36 \func{}{wxXmlResource
}{\param{const wxString\&
}{filemask
},
\param{int
}{flags = wxXRC
\_USE\_LOCALE}}
40 \docparam{filemask
}{The XRC file, archive file, or wildcard specification that will be used to
41 load all resource files inside a zip archive.
}
43 \docparam{flags
}{wxXRC
\_USE\_LOCALE: translatable strings will be translated via
\_().
44 wxXRC
\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
45 (useful for previews in XRC editors).
}
47 \func{}{wxXmlResource
}{\param{int
}{flags = wxXRC
\_USE\_LOCALE}}
51 \docparam{flags
}{wxXRC
\_USE\_LOCALE: translatable strings will be translated via
\_().
52 wxXRC
\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
53 (useful for previews in XRC editors).
}
55 \membersection{wxXmlResource::
\destruct{wxXmlResource
}}\label{wxxmlresourcedtor
}
57 \func{}{\destruct{wxXmlResource
}}{\void}
61 \membersection{wxXmlResource::AddHandler
}\label{wxxmlresourceaddhandler
}
63 \func{void
}{AddHandler
}{\param{wxXmlResourceHandler*
}{handler
}}
65 Initializes only a specific handler (or custom handler). Convention says
66 that the handler name is equal to the control's name plus 'XmlHandler', for example
67 wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource compiler
68 (wxxrc) can create include file that contains initialization code for
69 all controls used within the resource.
71 \membersection{wxXmlResource::AttachUnknownControl
}\label{wxxmlresourceattachunknowncontrol
}
73 \func{bool
}{AttachUnknownControl
}{\param{const wxString\&
}{name
},
\param{wxWindow*
}{control
},
\param{wxWindow*
}{parent = NULL
}}
75 Attaches an unknown control to the given panel/window/dialog.
76 Unknown controls are used in conjunction with <object class="unknown">.
78 \membersection{wxXmlResource::ClearHandlers
}\label{wxxmlresourceclearhandlers
}
80 \func{void
}{ClearHandlers
}{\void}
84 \membersection{wxXmlResource::CompareVersion
}\label{wxxmlresourcecompareversion
}
86 \constfunc{int
}{CompareVersion
}{\param{int
}{major
},
\param{int
}{minor
},
\param{int
}{release
},
\param{int
}{revision
}}
88 Compares the XRC version to the argument. Returns -
1 if the XRC version
89 is less than the argument, +
1 if greater, and
0 if they equal.
91 \membersection{wxXmlResource::CreateResFromNode
}\label{wxxmlresourcecreateresfromnode
}
93 \func{wxObject*
}{CreateResFromNode
}{\param{wxXmlNode*
}{node
},
\param{wxObject*
}{parent
},
\param{wxObject*
}{instance = NULL
}}
95 Creates a resource from information in the given node.
97 \membersection{wxXmlResource::DoFindResource
}\label{wxxmlresourcedofindresource
}
99 \func{wxXmlNode*
}{DoFindResource
}{\param{wxXmlNode*
}{parent
},
\param{const wxString\&
}{name
},
\param{const wxString\&
}{classname
},
\param{bool
}{recursive
}}
101 Helper function: finds a resource (calls UpdateResources) and returns a node containing it.
103 \membersection{wxXmlResource::FindResource
}\label{wxxmlresourcefindresource
}
105 \func{wxXmlNode*
}{FindResource
}{\param{const wxString\&
}{name
},
\param{const wxString\&
}{classname
},
\param{bool
}{recursive = false
}}
107 Finds a resource (calls UpdateResources) and returns a node containing it.
109 \membersection{wxXmlResource::Get
}\label{wxxmlresourceget
}
111 \func{wxXmlResource*
}{Get
}{\void}
113 Gets the global resources object or creates one if none exists.
115 \membersection{wxXmlResource::GetFlags
}\label{wxxmlresourcegetflags
}
117 \func{int
}{GetFlags
}{\void}
119 Returns flags, which may be a bitlist of wxXRC
\_USE\_LOCALE and wxXRC
\_NO\_SUBCLASSING.
121 \membersection{wxXmlResource::GetVersion
}\label{wxxmlresourcegetversion
}
123 \constfunc{long
}{GetVersion
}{\void}
125 Returns version information (a.b.c.d = d+
256*c +
256\textasciicircum2*b +
256\textasciitilde3*a).
127 \membersection{wxXmlResource::GetXRCID
}\label{wxxmlresourcegetxmlid
}
129 \func{int
}{GetXRCID
}{\param{const wxChar*
}{str
\_id}}
131 Returns a numeric ID that is equivalent to the string ID used in an XML
132 resource. To be used in event tables.
133 The macro
{\tt XRCID(name)
} is provided for convenience.
135 \membersection{wxXmlResource::InitAllHandlers
}\label{wxxmlresourceinitallhandlers
}
137 \func{void
}{InitAllHandlers
}{\void}
139 Initializes handlers for all supported controls/windows. This will
140 make the executable quite big because it forces linking against
141 most of the wxWidgets library.
143 \membersection{wxXmlResource::Load
}\label{wxxmlresourceload
}
145 \func{bool
}{Load
}{\param{const wxString\&
}{filemask
}}
147 Loads resources from XML files that match given filemask.
148 This method understands VFS (see filesys.h).
150 \membersection{wxXmlResource::LoadBitmap
}\label{wxxmlresourceloadbitmap
}
152 \func{wxBitmap
}{LoadBitmap
}{\param{const wxString\&
}{name
}}
154 Loads a bitmap resource from a file.
156 \membersection{wxXmlResource::LoadDialog
}\label{wxxmlresourceloaddialog
}
158 \func{wxDialog*
}{LoadDialog
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
160 Loads a dialog.
{\it dlg
} points to a parent window (if any).
162 \func{bool
}{LoadDialog
}{\param{wxDialog*
}{dlg
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
164 Loads a dialog.
{\it dlg
} points to parent window (if any).
166 This form is used to finish creation of an already existing instance (the main reason
167 for this is that you may want to use derived class with a new event table).
173 wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
177 \membersection{wxXmlResource::LoadFrame
}\label{wxxmlresourceloadframe
}
179 \func{bool
}{LoadFrame
}{\param{wxFrame*
}{frame
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
183 \membersection{wxXmlResource::LoadIcon
}\label{wxxmlresourceloadicon
}
185 \func{wxIcon
}{LoadIcon
}{\param{const wxString\&
}{name
}}
187 Loads an icon resource from a file.
189 \membersection{wxXmlResource::LoadMenu
}\label{wxxmlresourceloadmenu
}
191 \func{wxMenu*
}{LoadMenu
}{\param{const wxString\&
}{name
}}
193 Loads menu from resource. Returns NULL on failure.
195 \membersection{wxXmlResource::LoadMenuBar
}\label{wxxmlresourceloadmenubar
}
197 \func{wxMenuBar*
}{LoadMenuBar
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
199 Loads a menubar from resource. Returns NULL on failure.
201 \func{wxMenuBar*
}{LoadMenuBar
}{\param{const wxString\&
}{name
}}
203 Loads a menubar from resource. Returns NULL on failure.
205 \membersection{wxXmlResource::LoadPanel
}\label{wxxmlresourceloadpanel
}
207 \func{wxPanel*
}{LoadPanel
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
209 Loads a panel.
{\it panel
} points to parent window (if any).
211 \func{bool
}{LoadPanel
}{\param{wxPanel*
}{panel
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
213 Loads a panel.
{\it panel
} points to parent window (if any). This form
214 is used to finish creation of an already existing instance.
216 \membersection{wxXmlResource::LoadToolBar
}\label{wxxmlresourceloadtoolbar
}
218 \func{wxToolBar*
}{LoadToolBar
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
222 \membersection{wxXmlResource::Set
}\label{wxxmlresourceset
}
224 \func{wxXmlResource*
}{Set
}{\param{wxXmlResource*
}{res
}}
226 Sets the global resources object and returns a pointer to the previous one (may be NULL).
228 \membersection{wxXmlResource::SetFlags
}\label{wxxmlresourcesetflags
}
230 \func{int
}{SetFlags
}{\void}
232 Sets flags (bitlist of wxXRC
\_USE\_LOCALE and wxXRC
\_NO\_SUBCLASSING).
234 \membersection{wxXmlResource::UpdateResources
}\label{wxxmlresourceupdateresources
}
236 \func{void
}{UpdateResources
}{\void}
238 Scans the resources list for unloaded files and loads them. Also reloads
239 files that have been modified since the last load.