Version: 2.9.4
Public Member Functions | Protected Member Functions
wxSizerXmlHandler Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/xrc/xh_sizer.h>

Inheritance diagram for wxSizerXmlHandler:

Public Member Functions

 wxSizerXmlHandler ()
 Constructor.
virtual wxObjectDoCreateResource ()
 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 wxSizerDoCreateSizer (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.

List of all members.


Constructor & Destructor Documentation

wxSizerXmlHandler::wxSizerXmlHandler ( )

Constructor.

Initializes the attributes and adds the supported styles.


Member Function Documentation

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.

参照:
wxXmlResourceHandler::CanHandle().

Implements wxXmlResourceHandler.

virtual wxObject* wxSizerXmlHandler::DoCreateResource ( ) [virtual]

Creates a sizer, sizeritem or spacer object, depending on the current handled node.

参照:
wxXmlResourceHandler::DoCreateResource().

Implements wxXmlResourceHandler.

virtual wxSizer* wxSizerXmlHandler::DoCreateSizer ( const wxString name) [protected, virtual]

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.
            }
        };
Since:
2.9.2
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.

Since:
2.9.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines