#include </home/zeitlin/src/wx/github/interface/wx/xrc/xh_sizer.h>
Public Member Functions | |
wxSizerXmlHandler () | |
Constructor. | |
virtual wxObject * | DoCreateResource () |
Creates a sizer, sizeritem or spacer object, depending on the current handled node. | |
virtual bool | CanHandle (wxXmlNode *node) |
Returns true if the given node can be handled by this class. | |
Protected Member Functions | |
virtual wxSizer * | DoCreateSizer (const wxString &name) |
Creates an object of type wxSizer from the XML node content. | |
virtual bool | IsSizerNode (wxXmlNode *node) const |
Used by CanHandle() to know if the given node contains a sizer supported by this class. |
wxSizerXmlHandler::wxSizerXmlHandler | ( | ) |
Constructor.
Initializes the attributes and adds the supported styles.
virtual bool wxSizerXmlHandler::CanHandle | ( | wxXmlNode * | node | ) | [virtual] |
Returns true if the given node can be handled by this class.
If the node concerns a sizer object, the method IsSizerNode is called to know if the class is managed or not. If the node concerns a sizer item or a spacer, true is returned. Otherwise false is returned.
Implements wxXmlResourceHandler.
virtual wxObject* wxSizerXmlHandler::DoCreateResource | ( | ) | [virtual] |
Creates a sizer, sizeritem or spacer object, depending on the current handled node.
Implements wxXmlResourceHandler.
Creates an object of type wxSizer from the XML node content.
This virtual method can be overridden to add support for custom sizer classes to the derived handler.
Notice that if you override this method you would typically overload IsSizerNode() as well.
Example of use of this method:
class MySizerXmlHandler : public wxSizerXmlHandler { ... protected: bool IsSizerNode(wxXmlNode *node) const { return IsOfClass(node, "MySizer") || wxSizerXmlHandler::IsSizerNode(node)); } void DoCreateSizer(const wxString& name) { if ( name == "MySizer" ) return Handle_MySizer(); else return wxSizerXmlHandler::DoCreateSizer(name); } private: wxSizer* Handle_MySizer() { // Create your own sizer here from XRC content (see // wxXmlResource methods) and return the instance. } };
virtual bool wxSizerXmlHandler::IsSizerNode | ( | wxXmlNode * | node | ) | const [protected, virtual] |
Used by CanHandle() to know if the given node contains a sizer supported by this class.
This method should be overridden to allow this handler to be used for the custom sizer types.
See the example in DoCreateSizer() description for how it can be used.