CHANGED: #1471 CGroupHeaderEntry fields can now we serialized.

This commit is contained in:
dfighter1985 2012-08-14 00:53:47 +02:00
parent fd10c90c53
commit 06eedc595b
3 changed files with 22 additions and 5 deletions

View file

@ -67,6 +67,7 @@ namespace NLGUI
{
public:
CGroupHeaderEntry(const TCtorParam &param);
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
// from CInterfaceGroup
virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup);
sint32 getMinSize() const { return _MinSize; }
@ -78,6 +79,7 @@ namespace NLGUI
private:
sint32 _MinSize;
sint32 _ResizerSize;
std::string _TargetColumnId;
std::string _AHOnResize;
std::string _AHOnResizeParams;

View file

@ -396,6 +396,23 @@ namespace NLGUI
CGroupHeaderEntry::CGroupHeaderEntry(const TCtorParam &param) : CInterfaceGroup(param)
{
_MinSize = 4;
_ResizerSize = 4;
}
xmlNodePtr CGroupHeaderEntry::serialize( xmlNodePtr parentNode, const char *type ) const
{
xmlNodePtr node = CInterfaceGroup::serialize( parentNode, type );
if( node == NULL )
return NULL;
xmlSetProp( node, BAD_CAST "wmin", BAD_CAST toString( _MinSize ).c_str() );
xmlSetProp( node, BAD_CAST "resizer_size", BAD_CAST toString( _ResizerSize ).c_str() );
xmlSetProp( node, BAD_CAST "target", BAD_CAST toString( _TargetColumnId ).c_str() );
xmlSetProp( node, BAD_CAST "on_resize", BAD_CAST _AHOnResize.c_str() );
xmlSetProp( node, BAD_CAST "on_resize_params", BAD_CAST _AHOnResizeParams.c_str() );
return node;
}
// *****************************************************************************************************************
@ -405,9 +422,8 @@ namespace NLGUI
// left mover
CXMLAutoPtr prop((const char*) xmlGetProp( cur, (xmlChar*)"wmin" ));
if (prop) fromString((const char*)prop, _MinSize);
sint32 resizerSize = 4;
prop = (char*) xmlGetProp( cur, (xmlChar*)"resizer_size" );
if (prop) fromString((const char*)prop, resizerSize);
if (prop) fromString((const char*)prop, _ResizerSize);
prop = (char*) xmlGetProp(cur, (xmlChar*) "target");
if (prop) _TargetColumnId = (const char *) prop;
@ -418,7 +434,7 @@ namespace NLGUI
CHeaderEntryResizer *hm = new CHeaderEntryResizer(false, _MinSize);
addCtrl(hm);
hm->setW(resizerSize);
hm->setW(_ResizerSize);
hm->setSizeRef(2);
hm->setParent(this);
hm->setParentPosRef(Hotspot_TL);
@ -426,7 +442,7 @@ namespace NLGUI
// right mover
hm = new CHeaderEntryResizer(true, _MinSize);
addCtrl(hm);
hm->setW(resizerSize);
hm->setW(_ResizerSize);
hm->setSizeRef(2);
hm->setParent(this);
hm->setParentPosRef(Hotspot_TR);

View file

@ -650,7 +650,6 @@ namespace NLGUI
xmlSetProp( node, BAD_CAST "col_over", BAD_CAST toString( _OverColor ).c_str() );
xmlSetProp( node, BAD_CAST "col_select", BAD_CAST toString( _SelectedColor ).c_str() );
xmlSetProp( node, BAD_CAST "col_over_back", BAD_CAST toString( _OverColorBack ).c_str() );
xmlSetProp( node, BAD_CAST "", BAD_CAST "" );
xmlSetProp( node, BAD_CAST "fontsize", BAD_CAST toString( _FontSize ).c_str() );
xmlSetProp( node, BAD_CAST "select_ancestor_on_close", BAD_CAST toString( _SelectAncestorOnClose ).c_str() );
xmlSetProp( node, BAD_CAST "navigate_one_branch", BAD_CAST toString( _NavigateOneBranch ).c_str() );