wxXmlResourceHandler is an abstract base class for resource handlers capable of creating a control from an XML node.
See XML-based resource system overview for details.
Derived from
Include files
<wx/xrc/xmlres.h>
Members
wxXmlResourceHandler::wxXmlResourceHandler
wxXmlResourceHandler::~wxXmlResourceHandler
wxXmlResourceHandler::AddStyle
wxXmlResourceHandler::AddWindowStyles
wxXmlResourceHandler::CanHandle
wxXmlResourceHandler::CreateChildren
wxXmlResourceHandler::CreateChildrenPrivately
wxXmlResourceHandler::CreateResFromNode
wxXmlResourceHandler::CreateResource
wxXmlResourceHandler::DoCreateResource
wxXmlResourceHandler::GetBitmap
wxXmlResourceHandler::GetBool
wxXmlResourceHandler::GetColour
wxXmlResourceHandler::GetCurFileSystem
wxXmlResourceHandler::GetDimension
wxXmlResourceHandler::GetFont
wxXmlResourceHandler::GetID
wxXmlResourceHandler::GetIcon
wxXmlResourceHandler::GetLong
wxXmlResourceHandler::GetName
wxXmlResourceHandler::GetNodeContent
wxXmlResourceHandler::GetParamNode
wxXmlResourceHandler::GetParamValue
wxXmlResourceHandler::GetPosition
wxXmlResourceHandler::GetSize
wxXmlResourceHandler::GetStyle
wxXmlResourceHandler::GetText
wxXmlResourceHandler::HasParam
wxXmlResourceHandler::IsOfClass
wxXmlResourceHandler::SetParentResource
wxXmlResourceHandler::SetupWindow
wxXmlResourceHandler()
Default constructor.
~wxXmlResourceHandler()
Destructor.
void AddStyle(const wxString& name, int value)
Add a style flag (e.g. wxMB_DOCKABLE) to the list of flags understood by this handler.
void AddWindowStyles()
Add styles common to all wxWindow-derived classes.
bool CanHandle(wxXmlNode* node)
Returns true if it understands this node and can create a resource from it, false otherwise.
Note
You must not call any wxXmlResourceHandler methods except IsOfClass 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 node directly or to call IsOfClass.
void CreateChildren(wxObject* parent, bool this_hnd_only = false)
Creates children.
void CreateChildrenPrivately(wxObject* parent, wxXmlNode* rootnode = NULL)
Helper function.
wxObject* CreateResFromNode(wxXmlNode* node, wxObject* parent, wxObject* instance = NULL)
Creates a resource from a node.
wxObject* CreateResource(wxXmlNode* node, wxObject* parent, 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 necessary to create the resource. If instance is non-NULL it should not create a new instance via 'new' but should rather use this one, and call its Create method.
wxObject* DoCreateResource()
Called from CreateResource after variables were filled.
wxBitmap GetBitmap(const wxString& param = wxT("bitmap"), wxSize size = wxDefaultSize)
Gets a bitmap.
bool GetBool(const wxString& param, bool defaultv = false)
Gets a bool flag (1, t, yes, on, true are true, everything else is false).
wxColour GetColour(const wxString& param)
Gets colour in HTML syntax (#RRGGBB).
wxFileSystem& GetCurFileSystem()
Returns the current file system.
wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0)
Gets a dimension (may be in dialog units).
wxFont GetFont(const wxString& param = wxT("font"))
Gets a font.
int GetID()
Returns the XRCID.
wxIcon GetIcon(const wxString& param = wxT("icon"), wxSize size = wxDefaultSize)
Returns an icon.
long GetLong(const wxString& param, long defaultv = 0)
Gets the integer value from the parameter.
wxString GetName()
Returns the resource name.
wxString GetNodeContent(wxXmlNode* node)
Gets node content from wxXML_ENTITY_NODE.
wxXmlNode* GetParamNode(const wxString& param)
Finds the node or returns NULL.
wxString GetParamValue(const wxString& param)
Finds the parameter value or returns the empty string.
wxPoint GetPosition(const wxString& param = wxT("pos"))
Gets the position (may be in dialog units).
wxSize GetSize(const wxString& param = wxT("size"))
Gets the size (may be in dialog units).
int GetStyle(const wxString& param = wxT("style"), int defaults = 0)
Gets style flags from text in form "flag | flag2| flag3 |..." Only understands flags added with AddStyle.
wxString GetText(const wxString& param)
Gets text from param and does some conversions:
bool HasParam(const wxString& param)
Check to see if a parameter exists.
bool IsOfClass(wxXmlNode* node, const wxString& classname)
Convenience function. Returns true if the node has a property class equal to classname, e.g. <object class="wxDialog">.
void SetParentResource(wxXmlResource* res)
Sets the parent resource.
void SetupWindow(wxWindow* wnd)
Sets common window options.