X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d958c9bd1754393a2b2e35a95df4df4e74bcd3c4..a607d8d633e055fc5cea22c0b829cd65b5c3dbfb:/docs/latex/wx/xmlresh.tex?ds=inline diff --git a/docs/latex/wx/xmlresh.tex b/docs/latex/wx/xmlresh.tex index 518e558bf1..3ae6789bf7 100644 --- a/docs/latex/wx/xmlresh.tex +++ b/docs/latex/wx/xmlresh.tex @@ -8,6 +8,8 @@ wxXmlResourceHandler is an abstract base class for resource handlers capable of creating a control from an XML node. +See \helpref{XML-based resource system overview}{xrcoverview} for details. + \wxheading{Derived from} \helpref{wxObject}{wxobject} @@ -16,17 +18,17 @@ capable of creating a control from an XML node. -\wxheading{Data structures} +\wxheading{Library} -\latexignore{\rtfignore{\wxheading{Members}}} +\helpref{wxXrc}{librarieslist} +\latexignore{\rtfignore{\wxheading{Members}}} -\membersection{wxXmlResourceHandler::wxXmlResourceHandler}\label{wxxmlresourcehandlerwxxmlresourcehandler} +\membersection{wxXmlResourceHandler::wxXmlResourceHandler}\label{wxxmlresourcehandlerctor} \func{}{wxXmlResourceHandler}{\void} -Constructor. - +Default constructor. \membersection{wxXmlResourceHandler::\destruct{wxXmlResourceHandler}}\label{wxxmlresourcehandlerdtor} @@ -34,7 +36,6 @@ Constructor. Destructor. - \membersection{wxXmlResourceHandler::AddStyle}\label{wxxmlresourcehandleraddstyle} \func{void}{AddStyle}{\param{const wxString\& }{name}, \param{int }{value}} @@ -42,62 +43,66 @@ Destructor. Add a style flag (e.g. wxMB\_DOCKABLE) to the list of flags understood by this handler. - \membersection{wxXmlResourceHandler::AddWindowStyles}\label{wxxmlresourcehandleraddwindowstyles} \func{void}{AddWindowStyles}{\void} Add styles common to all wxWindow-derived classes. - \membersection{wxXmlResourceHandler::CanHandle}\label{wxxmlresourcehandlercanhandle} \func{bool}{CanHandle}{\param{wxXmlNode* }{node}} -Returns TRUE if it understands this node and can create -a resource from it, FALSE otherwise. +Returns true if it understands this node and can create +a resource from it, false otherwise. + +\wxheading{Note} +You must {\bf not} call any wxXmlResourceHandler methods except +\helpref{IsOfClass}{wxxmlresourcehandlerisofclass} from this method! The instance +is not yet initialized with node data at the time CanHandle is called and it is only +safe to operate on {\it node} directly or to call IsOfClass. \membersection{wxXmlResourceHandler::CreateChildren}\label{wxxmlresourcehandlercreatechildren} -\func{void}{CreateChildren}{\param{wxObject* }{parent}, \param{bool }{this\_hnd\_only = FALSE}} +\func{void}{CreateChildren}{\param{wxObject* }{parent}, \param{bool }{this\_hnd\_only = false}} Creates children. - \membersection{wxXmlResourceHandler::CreateChildrenPrivately}\label{wxxmlresourcehandlercreatechildrenprivately} \func{void}{CreateChildrenPrivately}{\param{wxObject* }{parent}, \param{wxXmlNode* }{rootnode = NULL}} Helper function. - \membersection{wxXmlResourceHandler::CreateResFromNode}\label{wxxmlresourcehandlercreateresfromnode} \func{wxObject*}{CreateResFromNode}{\param{wxXmlNode* }{node}, \param{wxObject* }{parent}, \param{wxObject* }{instance = NULL}} Creates a resource from a node. - \membersection{wxXmlResourceHandler::CreateResource}\label{wxxmlresourcehandlercreateresource} \func{wxObject*}{CreateResource}{\param{wxXmlNode* }{node}, \param{wxObject* }{parent}, \param{wxObject* }{instance}} Creates an object (menu, dialog, control, ...) from an XML node. -Should check for validity. -parent is a higher-level object (usually window, dialog or panel) -that is often neccessary to create the resource. -If instance is non-NULL it should not create a new instance via 'new' but +Should check for validity. {\it parent} is a higher-level object (usually window, dialog or panel) +that is often necessary to create the resource. +If {\bf instance} is non-NULL it should not create a new instance via 'new' but should rather use this one, and call its Create method. - \membersection{wxXmlResourceHandler::DoCreateResource}\label{wxxmlresourcehandlerdocreateresource} \func{wxObject*}{DoCreateResource}{\void} -This one is called from CreateResource after variables +Called from CreateResource after variables were filled. +\membersection{wxXmlResourceHandler::GetAnimation}\label{wxxmlresourcehandlergetanimation} + +\func{wxAnimation}{GetAnimation}{\param{const wxString\& }{param = wxT("animation")}} + +Creates a \helpref{animation}{wxanimation} from the filename specified in \arg{param}. \membersection{wxXmlResourceHandler::GetBitmap}\label{wxxmlresourcehandlergetbitmap} @@ -105,25 +110,23 @@ were filled. Gets a bitmap. - \membersection{wxXmlResourceHandler::GetBool}\label{wxxmlresourcehandlergetbool} -\func{bool}{GetBool}{\param{const wxString\& }{param}, \param{bool }{defaultv = FALSE}} - -Gets a bool flag (1, t, yes, on, true are TRUE, everything else is FALSE). +\func{bool}{GetBool}{\param{const wxString\& }{param}, \param{bool }{defaultv = false}} +Gets a bool flag (1, t, yes, on, true are true, everything else is false). \membersection{wxXmlResourceHandler::GetColour}\label{wxxmlresourcehandlergetcolour} -\func{wxColour}{GetColour}{\param{const wxString\& }{param}} +\func{wxColour}{GetColour}{\param{const wxString\& }{param}, \param{const wxColour\& }{default = wxNullColour}} Gets colour in HTML syntax (\#RRGGBB). - \membersection{wxXmlResourceHandler::GetCurFileSystem}\label{wxxmlresourcehandlergetcurfilesystem} \func{wxFileSystem\&}{GetCurFileSystem}{\void} +Returns the current file system. \membersection{wxXmlResourceHandler::GetDimension}\label{wxxmlresourcehandlergetdimension} @@ -131,27 +134,23 @@ Gets colour in HTML syntax (\#RRGGBB). Gets a dimension (may be in dialog units). - \membersection{wxXmlResourceHandler::GetFont}\label{wxxmlresourcehandlergetfont} \func{wxFont}{GetFont}{\param{const wxString\& }{param = wxT("font")}} Gets a font. - \membersection{wxXmlResourceHandler::GetID}\label{wxxmlresourcehandlergetid} \func{int}{GetID}{\void} -Returns the XMLID. - +Returns the XRCID. \membersection{wxXmlResourceHandler::GetIcon}\label{wxxmlresourcehandlergeticon} \func{wxIcon}{GetIcon}{\param{const wxString\& }{param = wxT("icon")}, \param{wxSize }{size = wxDefaultSize}} -Gets an icon. - +Returns an icon. \membersection{wxXmlResourceHandler::GetLong}\label{wxxmlresourcehandlergetlong} @@ -159,24 +158,17 @@ Gets an icon. Gets the integer value from the parameter. - \membersection{wxXmlResourceHandler::GetName}\label{wxxmlresourcehandlergetname} \func{wxString}{GetName}{\void} Returns the resource name. - \membersection{wxXmlResourceHandler::GetNodeContent}\label{wxxmlresourcehandlergetnodecontent} \func{wxString}{GetNodeContent}{\param{wxXmlNode* }{node}} -Gets node content from wxXML\_ENTITY\_NODE -The problem is, content is represented as -wxXML\_ENTITY\_NODE name="tag", content="" -|-- wxXML\_TEXT\_NODE or -wxXML\_CDATA\_SECTION\_NODE name="" content="content" - +Gets node content from wxXML\_ENTITY\_NODE. \membersection{wxXmlResourceHandler::GetParamNode}\label{wxxmlresourcehandlergetparamnode} @@ -184,35 +176,30 @@ wxXML\_CDATA\_SECTION\_NODE name="" content="content" Finds the node or returns NULL. - \membersection{wxXmlResourceHandler::GetParamValue}\label{wxxmlresourcehandlergetparamvalue} \func{wxString}{GetParamValue}{\param{const wxString\& }{param}} Finds the parameter value or returns the empty string. - \membersection{wxXmlResourceHandler::GetPosition}\label{wxxmlresourcehandlergetposition} \func{wxPoint}{GetPosition}{\param{const wxString\& }{param = wxT("pos")}} Gets the position (may be in dialog units). - \membersection{wxXmlResourceHandler::GetSize}\label{wxxmlresourcehandlergetsize} \func{wxSize}{GetSize}{\param{const wxString\& }{param = wxT("size")}} Gets the size (may be in dialog units). - \membersection{wxXmlResourceHandler::GetStyle}\label{wxxmlresourcehandlergetstyle} \func{int}{GetStyle}{\param{const wxString\& }{param = wxT("style")}, \param{int }{defaults = 0}} Gets style flags from text in form "flag | flag2| flag3 |..." -Only understads flags added with AddStyle - +Only understands flags added with AddStyle. \membersection{wxXmlResourceHandler::GetText}\label{wxxmlresourcehandlergettext} @@ -222,7 +209,7 @@ Gets text from param and does some conversions: \begin{itemize}\itemsep=0pt \item replaces $\backslash$n, $\backslash$r, $\backslash$t by respective characters (according to C syntax) -\item replaces \verb+$+ by \verb+\&+ and \verb+\$\$+ by \verb+\$+ (needed for \verb+\$File+ to \verb+\&File+ +\item replaces {\tt\$} by {\tt\&} and {\tt\$\$} by {\tt\$} (needed for {\tt\_File} to {\tt\&File} translation because of XML syntax) \item calls wxGetTranslations (unless disabled in wxXmlResource) \end{itemize} @@ -233,7 +220,6 @@ translation because of XML syntax) Check to see if a parameter exists. - \membersection{wxXmlResourceHandler::IsOfClass}\label{wxxmlresourcehandlerisofclass} \func{bool}{IsOfClass}{\param{wxXmlNode* }{node}, \param{const wxString\& }{classname}} @@ -241,14 +227,12 @@ Check to see if a parameter exists. Convenience function. Returns true if the node has a property class equal to classname, e.g. . - \membersection{wxXmlResourceHandler::SetParentResource}\label{wxxmlresourcehandlersetparentresource} \func{void}{SetParentResource}{\param{wxXmlResource* }{res}} Sets the parent resource. - \membersection{wxXmlResourceHandler::SetupWindow}\label{wxxmlresourcehandlersetupwindow} \func{void}{SetupWindow}{\param{wxWindow* }{wnd}}