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 {\bf NOTE:
} XRC is not yet a part of the core wxWindows library, so
15 please see the overview for how to compile and link it. Otherwise if you
16 try to use it, you will get link errors.
18 \wxheading{Derived from
}
20 \helpref{wxObject
}{wxobject
}
22 \wxheading{Include files
}
26 \wxheading{Data structures
}
29 enum wxXmlResourceFlags
31 wxXRC
\_USE\_LOCALE =
1,
32 wxXRC
\_NO\_SUBCLASSING =
2
36 \latexignore{\rtfignore{\wxheading{Members
}}}
38 \membersection{wxXmlResource::wxXmlResource
}\label{wxxmlresourcewxxmlresource
}
40 \func{}{wxXmlResource
}{\param{const wxString\&
}{filemask
},
\param{int
}{flags = wxXRC
\_USE\_LOCALE}}
44 \docparam{filemask
}{The XRC file, archive file, or wildcard specification that will be used to
45 load all resource files inside a zip archive.
}
47 \docparam{flags
}{wxXRC
\_USE\_LOCALE: translatable strings will be translated via
\_().
48 wxXRC
\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
49 (useful for previews in XRC editors).
}
51 \func{}{wxXmlResource
}{\param{int
}{flags = wxXRC
\_USE\_LOCALE}}
55 \docparam{flags
}{wxXRC
\_USE\_LOCALE: translatable strings will be translated via
\_().
56 wxXRC
\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
57 (useful for previews in XRC editors).
}
59 \membersection{wxXmlResource::
\destruct{wxXmlResource
}}\label{wxxmlresourcedtor
}
61 \func{}{\destruct{wxXmlResource
}}{\void}
65 \membersection{wxXmlResource::AddHandler
}\label{wxxmlresourceaddhandler
}
67 \func{void
}{AddHandler
}{\param{wxXmlResourceHandler*
}{handler
}}
69 Initializes only a specific handler (or custom handler). Convention says
70 that the handler name is equal to the control's name plus 'XmlHandler', for example
71 wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource compiler
72 (wxxrc) can create include file that contains initialization code for
73 all controls used within the resource.
75 \membersection{wxXmlResource::AttachUnknownControl
}\label{wxxmlresourceattachunknowncontrol
}
77 \func{bool
}{AttachUnknownControl
}{\param{const wxString\&
}{name
},
\param{wxWindow*
}{control
},
\param{wxWindow*
}{parent = NULL
}}
79 Attaches an unknown control to the given panel/window/dialog.
80 Unknown controls are used in conjunction with <object class="unknown">.
82 \membersection{wxXmlResource::ClearHandlers
}\label{wxxmlresourceclearhandlers
}
84 \func{void
}{ClearHandlers
}{\void}
88 \membersection{wxXmlResource::CompareVersion
}\label{wxxmlresourcecompareversion
}
90 \constfunc{int
}{CompareVersion
}{\param{int
}{major
},
\param{int
}{minor
},
\param{int
}{release
},
\param{int
}{revision
}}
92 Compares the XRC version to the argument. Returns -
1 if the XRC version
93 is less than the argument, +
1 if greater, and
0 if they equal.
95 \membersection{wxXmlResource::CreateResFromNode
}\label{wxxmlresourcecreateresfromnode
}
97 \func{wxObject*
}{CreateResFromNode
}{\param{wxXmlNode*
}{node
},
\param{wxObject*
}{parent
},
\param{wxObject*
}{instance = NULL
}}
99 Creates a resource from information in the given node.
101 \membersection{wxXmlResource::DoFindResource
}\label{wxxmlresourcedofindresource
}
103 \func{wxXmlNode*
}{DoFindResource
}{\param{wxXmlNode*
}{parent
},
\param{const wxString\&
}{name
},
\param{const wxString\&
}{classname
},
\param{bool
}{recursive
}}
105 Helper function: finds a resource (calls UpdateResources) and returns a node containing it.
107 \membersection{wxXmlResource::FindResource
}\label{wxxmlresourcefindresource
}
109 \func{wxXmlNode*
}{FindResource
}{\param{const wxString\&
}{name
},
\param{const wxString\&
}{classname
},
\param{bool
}{recursive = FALSE
}}
111 Finds a resource (calls UpdateResources) and returns a node containing it.
113 \membersection{wxXmlResource::Get
}\label{wxxmlresourceget
}
115 \func{wxXmlResource*
}{Get
}{\void}
117 Gets the global resources object or creates one if none exists.
119 \membersection{wxXmlResource::GetFlags
}\label{wxxmlresourcegetflags
}
121 \func{int
}{GetFlags
}{\void}
123 Returns flags, which may be a bitlist of wxXRC
\_USE\_LOCALE and wxXRC
\_NO\_SUBCLASSING.
125 \membersection{wxXmlResource::GetVersion
}\label{wxxmlresourcegetversion
}
127 \constfunc{long
}{GetVersion
}{\void}
129 Returns version information (a.b.c.d = d+
256*c +
256\textasciicircum2*b +
256\textasciitilde3*a).
131 \membersection{wxXmlResource::GetXRCID
}\label{wxxmlresourcegetxmlid
}
133 \func{int
}{GetXRCID
}{\param{const wxChar*
}{str
\_id}}
135 Returns a numeric ID that is equivalent to the string ID used in an XML
136 resource. To be used in event tables.
137 The macro
{\tt XRCID(name)
} is provided for convenience.
139 \membersection{wxXmlResource::InitAllHandlers
}\label{wxxmlresourceinitallhandlers
}
141 \func{void
}{InitAllHandlers
}{\void}
143 Initializes handlers for all supported controls/windows. This will
144 make the executable quite big because it forces linking against
145 most of the wxWindows library.
147 \membersection{wxXmlResource::Load
}\label{wxxmlresourceload
}
149 \func{bool
}{Load
}{\param{const wxString\&
}{filemask
}}
151 Loads resources from XML files that match given filemask.
152 This method understands VFS (see filesys.h).
154 \membersection{wxXmlResource::LoadBitmap
}\label{wxxmlresourceloadbitmap
}
156 \func{wxBitmap
}{LoadBitmap
}{\param{const wxString\&
}{name
}}
158 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");
181 \membersection{wxXmlResource::LoadFrame
}\label{wxxmlresourceloadframe
}
183 \func{bool
}{LoadFrame
}{\param{wxFrame*
}{frame
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
187 \membersection{wxXmlResource::LoadIcon
}\label{wxxmlresourceloadicon
}
189 \func{wxIcon
}{LoadIcon
}{\param{const wxString\&
}{name
}}
191 Loads an icon resource from a file.
193 \membersection{wxXmlResource::LoadMenu
}\label{wxxmlresourceloadmenu
}
195 \func{wxMenu*
}{LoadMenu
}{\param{const wxString\&
}{name
}}
197 Loads menu from resource. Returns NULL on failure.
199 \membersection{wxXmlResource::LoadMenuBar
}\label{wxxmlresourceloadmenubar
}
201 \func{wxMenuBar*
}{LoadMenuBar
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
203 Loads a menubar from resource. Returns NULL on failure.
205 \func{wxMenuBar*
}{LoadMenuBar
}{\param{const wxString\&
}{name
}}
207 Loads a menubar from resource. Returns NULL on failure.
209 \membersection{wxXmlResource::LoadPanel
}\label{wxxmlresourceloadpanel
}
211 \func{wxPanel*
}{LoadPanel
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
213 Loads a panel.
{\it panel
} points to parent window (if any).
215 \func{bool
}{LoadPanel
}{\param{wxPanel*
}{panel
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
217 Loads a panel.
{\it panel
} points to parent window (if any). This form
218 is used to finish creation of an already existing instance.
220 \membersection{wxXmlResource::LoadToolBar
}\label{wxxmlresourceloadtoolbar
}
222 \func{wxToolBar*
}{LoadToolBar
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{name
}}
226 \membersection{wxXmlResource::Set
}\label{wxxmlresourceset
}
228 \func{wxXmlResource*
}{Set
}{\param{wxXmlResource*
}{res
}}
230 Sets the global resources object and returns a pointer to the previous one (may be NULL).
232 \membersection{wxXmlResource::UpdateResources
}\label{wxxmlresourceupdateresources
}
234 \func{void
}{UpdateResources
}{\void}
236 Scans the resources list for unloaded files and loads them. Also reloads
237 files that have been modified since the last load.