diff --git a/code/nel/include/nel/gui/group_editbox.h b/code/nel/include/nel/gui/group_editbox.h index 38d362589..6d85043c7 100644 --- a/code/nel/include/nel/gui/group_editbox.h +++ b/code/nel/include/nel/gui/group_editbox.h @@ -48,6 +48,8 @@ namespace NLGUI /// Dtor ~CGroupEditBox(); + std::string getProperty( const std::string &name ) const; + bool parse(xmlNodePtr cur,CInterfaceGroup * parentGroup); virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } diff --git a/code/nel/include/nel/gui/group_editbox_base.h b/code/nel/include/nel/gui/group_editbox_base.h index fa7b6e236..b84fa29dc 100644 --- a/code/nel/include/nel/gui/group_editbox_base.h +++ b/code/nel/include/nel/gui/group_editbox_base.h @@ -59,8 +59,6 @@ namespace NLGUI static CGroupEditBoxBase *_CurrSelection; // the edit box for which the selection is currently active, or NULL if there's none - private: - }; } diff --git a/code/nel/include/nel/gui/group_table.h b/code/nel/include/nel/gui/group_table.h index 4fd0f86e0..4fe063344 100644 --- a/code/nel/include/nel/gui/group_table.h +++ b/code/nel/include/nel/gui/group_table.h @@ -57,6 +57,8 @@ namespace NLGUI virtual sint32 getMaxUsedW() const; virtual sint32 getMinUsedW() const; + std::string getProperty( const std::string &name ) const; + // to be called by CGroupTable bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup, uint columnIndex, uint rowIndex); diff --git a/code/nel/src/gui/group_editbox.cpp b/code/nel/src/gui/group_editbox.cpp index e24649f3c..691c06902 100644 --- a/code/nel/src/gui/group_editbox.cpp +++ b/code/nel/src/gui/group_editbox.cpp @@ -100,6 +100,161 @@ namespace NLGUI } } + std::string CGroupEditBox::getProperty( const stlpx_std::string &name ) const + { + if( name == "onchange" ) + { + return _AHOnChange; + } + else + if( name == "onchange_params" ) + { + return _ParamsOnChange; + } + else + if( name == "on_focus_lost" ) + { + return _AHOnFocusLost; + } + else + if( name == "on_focus_lost_params" ) + { + return _AHOnFocusLostParams; + } + else + if( name == "on_focus" ) + { + return _AHOnFocus; + } + else + if( name == "on_focus_params" ) + { + return _AHOnFocusParams; + } + else + if( name == "max_num_chars" ) + { + return toString( _MaxNumChar ); + } + else + if( name == "max_num_return" ) + { + return toString( _MaxNumReturn ); + } + else + if( name == "max_chars_size" ) + { + return toString( _MaxCharsSize ); + } + else + if( name == "enter_loose_focus" ) + { + return toString( _LooseFocusOnEnter ); + } + else + if( name == "enter_recover_focus" ) + { + return toString( _RecoverFocusOnEnter ); + } + else + if( name == "prompt" ) + { + return _Prompt.toString(); + } + else + if( name == "enter_type" ) + { + switch( _EntryType ) + { + case Integer: + return "integer"; + break; + + case PositiveInteger: + return "positive_integer"; + break; + + case Float: + return "float"; + break; + + case PositiveFloat: + return "positive_float"; + break; + + case Alpha: + return "alpha"; + break; + + case AlphaNum: + return "alpha_num"; + break; + + case AlphaNumSpace: + return "alpha_num_space"; + break; + + case Password: + return "password"; + break; + + case Filename: + return "filename"; + break; + + case PlayerName: + return "playername"; + break; + } + + return "text"; + } + else + if( name == "menu_r" ) + { + return _ListMenuRight; + } + else + if( name == "max_historic" ) + { + return toString( _MaxHistoric ); + } + else + if( name == "backup_father_container_pos" ) + { + return toString( _BackupFatherContainerPos ); + } + else + if( name == "want_return" ) + { + return toString( _WantReturn ); + } + else + if( name == "savable" ) + { + return toString( _Savable ); + } + else + if( name == "max_float_prec" ) + { + return toString( _MaxFloatPrec ); + } + else + if( name == "negative_filter" ) + { + std::string s; + s.reserve( _NegativeFilter.size() ); + + std::vector< char >::const_iterator itr; + for( itr = _NegativeFilter.begin(); itr != _NegativeFilter.end(); ++itr ) + s.push_back( *itr ); + + return s; + } + else + return CInterfaceGroup::getProperty( name ); + } + // ---------------------------------------------------------------------------- bool CGroupEditBox::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) { @@ -168,7 +323,8 @@ namespace NLGUI else if (stricmp(prop, "password") == 0) _EntryType = Password; else if (stricmp(prop, "filename") == 0) _EntryType = Filename; else if (stricmp(prop, "playername") == 0) _EntryType = PlayerName; - else nlwarning(" Unknown entry type %s", (const char *) prop); + else + nlwarning(" Unknown entry type %s", (const char *) prop); } prop = (char*) xmlGetProp( cur, (xmlChar*)"menu_r" ); diff --git a/code/nel/src/gui/group_table.cpp b/code/nel/src/gui/group_table.cpp index 3257e3160..25c19752d 100644 --- a/code/nel/src/gui/group_table.cpp +++ b/code/nel/src/gui/group_table.cpp @@ -71,6 +71,87 @@ namespace NLGUI Group->setResizeFromChildH(true); } + std::string CGroupCell::getProperty( const std::string &name ) const + { + if( name == "align" ) + { + switch( Align ) + { + case Right: + return "right"; + break; + + case Center: + return "center"; + break; + } + + return "left"; + + } + else + if( name == "valign" ) + { + switch( VAlign ) + { + case Middle: + return "middle"; + break; + + case Bottom: + return "bottom"; + break; + } + + return "top"; + } + else + if( name == "left_margin" ) + { + return toString( LeftMargin ); + } + else + if( name == "nowrap" ) + { + return toString( NoWrap ); + } + else + if( name == "bgcolor" ) + { + return toString( BgColor ); + } + else + if( name == "width" ) + { + if( WidthWanted != 0 ) + return toString( WidthWanted ); + else + return toString( TableRatio * 100.0f ); + } + else + if( name == "height" ) + { + return toString( Height ); + } + else + if( name == "ignore_max_width" ) + { + return toString( IgnoreMaxWidth ); + } + else + if( name == "ignore_min_width" ) + { + return toString( IgnoreMinWidth ); + } + else + if( name == "add_child_w" ) + { + return toString( AddChildW ); + } + else + return CInterfaceGroup::getProperty( name ); + } + // ---------------------------------------------------------------------------- bool CGroupCell::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup, uint columnIndex, uint rowIndex) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupCell.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupCell.xml new file mode 100644 index 000000000..919dbd980 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupCell.xml @@ -0,0 +1,62 @@ + +
+ GroupCell + CGroupCell + InterfaceGroup + + false + +
+ + + align + string + left + + + valign + string + top + + + left_margin + int + 0 + + + nowrap + bool + false + + + bgcolor + string + 0 0 0 0 + + + width + string + 0 + + + height + int + 0 + + + ignore_max_width + bool + false + + + ignore_min_width + bool + false + + + add_child_w + bool + false + + +
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupEditBox.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupEditBox.xml new file mode 100644 index 000000000..b9dee989f --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupEditBox.xml @@ -0,0 +1,112 @@ + +
+ GroupEditBox + CGroupEditBox + InterfaceGroup + + false + +
+ + + onchange + string + + + + onchange_params + string + + + + on_focus_lost + string + + + + on_focus_lost_params + string + + + + on_focus + string + + + + on_focus_params + string + + + + max_num_chars + int + 2000000000 + + + max_num_return + int + 2000000000 + + + max_chars_size + int + 32768 + + + enter_loose_focus + bool + true + + + enter_recover_focus + bool + true + + + prompt + string + + + + enter_type + string + text + + + menu_r + string + + + + max_historic + int + 0 + + + backup_father_container_pos + bool + false + + + want_return + bool + false + + + savable + bool + true + + + max_float_prec + int + 20 + + + negative_filter + string + + + +