added insert_at property for the object nodes (patch 1185138)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -86,7 +86,7 @@ The <resource> node is only allowed to have <object> and <object_ref>
|
|||||||
subnodes, all of which must have the "name" property.
|
subnodes, all of which must have the "name" property.
|
||||||
|
|
||||||
The <object> node represents a single object (GUI element) and it usually maps
|
The <object> node represents a single object (GUI element) and it usually maps
|
||||||
directly to a wxWidgets class instance. It three properties: "name", "class"
|
directly to a wxWidgets class instance. It has the properties: "name", "class"
|
||||||
and "subclass". "class" must always be present, it tells XRC what wxWidgets
|
and "subclass". "class" must always be present, it tells XRC what wxWidgets
|
||||||
object should be created in this place. The other two are optional. "name" is
|
object should be created in this place. The other two are optional. "name" is
|
||||||
ID used to identify the object. It is the value passed to the XRCID() macro and
|
ID used to identify the object. It is the value passed to the XRCID() macro and
|
||||||
@@ -99,6 +99,11 @@ constructor for "class". Subclass must be available in the program that loads
|
|||||||
the resource, must be derived from "class" and must be registered within
|
the resource, must be derived from "class" and must be registered within
|
||||||
wxWidgets' RTTI system.
|
wxWidgets' RTTI system.
|
||||||
|
|
||||||
|
Finally, an optional "insert_at" property may be present. Currently only the
|
||||||
|
values "begin" and "end" are supported, meaning to insert the object in the
|
||||||
|
beginning of the parent node objects list or to append it at the end (which is
|
||||||
|
the default if this property is absent).
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
<object name="MyList1" class="wxListCtrl" subclass="MyListCtrlClass">
|
<object name="MyList1" class="wxListCtrl" subclass="MyListCtrlClass">
|
||||||
|
@@ -625,8 +625,19 @@ static void MergeNodes(wxXmlNode& dest, wxXmlNode& with)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !dnode )
|
if ( !dnode )
|
||||||
|
{
|
||||||
|
static const wxChar *AT_END = wxT("end");
|
||||||
|
wxString insert_pos = node->GetPropVal(wxT("insert_at"), AT_END);
|
||||||
|
if ( insert_pos == AT_END )
|
||||||
|
{
|
||||||
dest.AddChild(new wxXmlNode(*node));
|
dest.AddChild(new wxXmlNode(*node));
|
||||||
}
|
}
|
||||||
|
else if ( insert_pos == wxT("begin") )
|
||||||
|
{
|
||||||
|
dest.InsertChild(new wxXmlNode(*node), dest.GetChildren());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( dest.GetType() == wxXML_TEXT_NODE && with.GetContent().Length() )
|
if ( dest.GetType() == wxXML_TEXT_NODE && with.GetContent().Length() )
|
||||||
dest.SetContent(with.GetContent());
|
dest.SetContent(with.GetContent());
|
||||||
|
Reference in New Issue
Block a user