diff --git a/code/nel/include/nel/gui/interface_element.h b/code/nel/include/nel/gui/interface_element.h index 0be4c02e3..0f9b271ce 100644 --- a/code/nel/include/nel/gui/interface_element.h +++ b/code/nel/include/nel/gui/interface_element.h @@ -492,7 +492,9 @@ namespace NLGUI bool isEditorSelected() const{ return editorSelected; } void setPosParent( const std::string &id ); + void getPosParent( std::string &id ) const; void setSizeParent( const std::string &id ); + void getSizeParent( std::string &id ) const; void setSerializable( bool b ){ serializable = b; } bool IsSerializable() const{ return serializable; } diff --git a/code/nel/include/nel/gui/interface_parser.h b/code/nel/include/nel/gui/interface_parser.h index 2bf1df9a8..18ec9045a 100644 --- a/code/nel/include/nel/gui/interface_parser.h +++ b/code/nel/include/nel/gui/interface_parser.h @@ -28,6 +28,7 @@ #include "nel/gui/proc.h" #include "nel/gui/widget_manager.h" #include "nel/gui/link_data.h" +#include "nel/gui/variable_data.h" namespace NLGUI { @@ -100,20 +101,6 @@ namespace NLGUI virtual void setupOptions() = 0; }; - - struct VariableData - { - std::string entry; - std::string type; - std::string value; - uint32 size; - - VariableData() - { - size = 0; - } - }; - CInterfaceParser(); virtual ~CInterfaceParser(); @@ -353,7 +340,15 @@ namespace NLGUI std::map< std::string, std::string > pointerSettings; std::map< std::string, std::map< std::string, std::string > > keySettings; + std::string _WorkDir; + public: + /// Sets the working directory, where files should be looked for + void setWorkDir( const std::string &workdir ){ _WorkDir = workdir; } + + /// Looks up a file in either the working directory or using CPath::lookup + std::string lookup( const std::string &file ); + void initLUA(); void uninitLUA(); bool isLuaInitialized() const{ return luaInitialized; } @@ -378,6 +373,7 @@ namespace NLGUI void setEditorMode( bool b ){ editorMode = b; } + void setVariable( const VariableData &v ); bool serializeVariables( xmlNodePtr parentNode ) const; bool serializeProcs( xmlNodePtr parentNode ) const; bool serializePointerSettings( xmlNodePtr parentNode ) const; diff --git a/code/nel/include/nel/gui/parser.h b/code/nel/include/nel/gui/parser.h index db868f70d..bc53e402d 100644 --- a/code/nel/include/nel/gui/parser.h +++ b/code/nel/include/nel/gui/parser.h @@ -23,6 +23,7 @@ #include "nel/misc/types_nl.h" #include "nel/gui/proc.h" #include "nel/gui/link_data.h" +#include "nel/gui/variable_data.h" namespace NLGUI { @@ -83,11 +84,13 @@ namespace NLGUI virtual void removeLinkData( uint32 id ) = 0; virtual bool getLinkData( uint32 id, SLinkData &linkData ) = 0; virtual void updateLinkData( uint32 id, const SLinkData &linkData ) = 0; + virtual void setVariable( const VariableData &v ) = 0; virtual bool serializeVariables( xmlNodePtr parentNode ) const = 0; virtual bool serializeProcs( xmlNodePtr parentNode ) const = 0; virtual bool serializePointerSettings( xmlNodePtr parentNode ) const = 0; virtual bool serializeKeySettings( xmlNodePtr parentNode ) const = 0; virtual CViewBase* createClass( const std::string &name ) = 0; + virtual void setWorkDir( const std::string &workdir ) = 0; }; } diff --git a/code/nel/include/nel/gui/root_group.h b/code/nel/include/nel/gui/root_group.h new file mode 100644 index 000000000..58963a3b2 --- /dev/null +++ b/code/nel/include/nel/gui/root_group.h @@ -0,0 +1,46 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef ROOT_GROUP_H +#define ROOT_GROUP_H + +#include +#include + +#include "nel/gui/interface_group.h" + +namespace NLGUI +{ + + class CRootGroup : public CInterfaceGroup + { + public: + CRootGroup(const TCtorParam ¶m); + virtual ~CRootGroup(); + + virtual CInterfaceElement* getElement (const std::string &id); + virtual void addGroup (CInterfaceGroup *child, sint eltOrder = -1); + virtual bool delGroup (CInterfaceGroup *child, bool dontDelete = false); + + private: + std::map< std::string, CInterfaceGroup* > _Accel; + }; + +} + +#endif + diff --git a/code/nel/include/nel/gui/variable_data.h b/code/nel/include/nel/gui/variable_data.h new file mode 100644 index 000000000..cffba2bce --- /dev/null +++ b/code/nel/include/nel/gui/variable_data.h @@ -0,0 +1,41 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef VARIABLE_DATA_H +#define VARIABLE_DATA_H + +#include "nel/misc/types_nl.h" + +namespace NLGUI +{ + struct VariableData + { + std::string entry; + std::string type; + std::string value; + uint32 size; + + VariableData() + { + size = 0; + } + }; + +} + + +#endif + diff --git a/code/nel/include/nel/gui/widget_manager.h b/code/nel/include/nel/gui/widget_manager.h index d722a9165..6d2336047 100644 --- a/code/nel/include/nel/gui/widget_manager.h +++ b/code/nel/include/nel/gui/widget_manager.h @@ -528,6 +528,8 @@ namespace NLGUI bool groupSelection(); bool unGroupSelection(); void setMultiSelection( bool b ){ multiSelection = b; } + + bool createNewGUI( const std::string &project, const std::string &window ); private: CWidgetManager(); diff --git a/code/nel/src/gui/interface_element.cpp b/code/nel/src/gui/interface_element.cpp index c9b480516..620e7dbdb 100644 --- a/code/nel/src/gui/interface_element.cpp +++ b/code/nel/src/gui/interface_element.cpp @@ -147,12 +147,16 @@ namespace NLGUI } if( name == "posparent" ) { - return CWidgetManager::getInstance()->getParser()->getParentPosAssociation( (CInterfaceElement*)this ); + std::string pp; + getPosParent( pp ); + return pp; } else if( name == "sizeparent" ) { - return CWidgetManager::getInstance()->getParser()->getParentSizeAssociation( (CInterfaceElement*)this ); + std::string sp; + getSizeParent( sp ); + return sp; } else if( name == "global_color" ) @@ -294,11 +298,13 @@ namespace NLGUI xmlNewProp( node, BAD_CAST "w", BAD_CAST toString( _W ).c_str() ); xmlNewProp( node, BAD_CAST "h", BAD_CAST toString( _H ).c_str() ); xmlNewProp( node, BAD_CAST "posref", BAD_CAST HotSpotCoupleToString( _ParentPosRef, _PosRef ).c_str() ); - xmlNewProp( node, BAD_CAST "posparent", - BAD_CAST CWidgetManager::getInstance()->getParser()->getParentPosAssociation( (CInterfaceElement*)this ).c_str() ); + + std::string pp; + getPosParent( pp ); + xmlNewProp( node, BAD_CAST "posparent", BAD_CAST pp.c_str() ); xmlNewProp( node, BAD_CAST "sizeref", BAD_CAST getSizeRefAsString().c_str() ); - xmlNewProp( node, BAD_CAST "sizeparent", - BAD_CAST CWidgetManager::getInstance()->getParser()->getParentSizeAssociation( (CInterfaceElement*)this ).c_str() ); + getSizeParent( pp ); + xmlNewProp( node, BAD_CAST "sizeparent", BAD_CAST pp.c_str() ); xmlNewProp( node, BAD_CAST "global_color", BAD_CAST toString( _ModulateGlobalColor ).c_str() ); xmlNewProp( node, BAD_CAST "render_layer", BAD_CAST toString( _RenderLayer ).c_str() ); @@ -1528,40 +1534,128 @@ namespace NLGUI void CInterfaceElement::setPosParent( const std::string &id ) { - std::string Id = stripId( id ); + // Parent or empty id simply means the group parent + if( ( id == "parent" ) || ( id.empty() ) ) + { + setParentPos( getParent() ); + return; + } - if( Id != "parent" ) + CInterfaceElement *pp = NULL; + + // Check if it's a short Id + std::string::size_type idx = id.find( "ui:" ); + if( idx == std::string::npos ) { - std::string idParent; - if( _Parent != NULL ) - idParent = _Parent->getId() + ":"; - else - idParent = "ui:"; - CWidgetManager::getInstance()->getParser()->addParentPositionAssociation( this, idParent + Id ); + // If it is, find the widget in the parent group and set as posparent + CInterfaceGroup *p = getParent(); + if( p != NULL ) + { + pp = p->findFromShortId( id ); + } + } + else + { + // If it is not, find using the widgetmanager + // TODO: refactor, shouldn't use a singleton + pp = CWidgetManager::getInstance()->getElementFromId( id ); } + + if( pp != NULL ) + setParentPos( pp ); + } - void CInterfaceElement::setSizeParent( const std::string &id ) + void CInterfaceElement::getPosParent( std::string &id ) const { - std::string Id = stripId( id ); - std::string idParent; - if( Id != "parent" ) + // If there's no pos parent set, then the parent group is the pos parent + if( getParentPos() == NULL ) { - if( _Parent != NULL ) - idParent = _Parent->getId() + ":"; - else - idParent = "ui:"; - CWidgetManager::getInstance()->getParser()->addParentSizeAssociation( this, idParent + Id ); + id = "parent"; + return; } - else + + // If pos parent and parent are the same then ofc the parent group is the pos parent... + CInterfaceElement *p = getParent(); + if( getParentPos() == p ) { - if( _Parent != NULL ) + id = "parent"; + return; + } + + // If parent is in the same group, use the short id + p = getParentPos(); + if( p->isInGroup( getParent() ) ) + { + id = p->getShortId(); + return; + } + + // Otherwise use the full id + id = p->getId(); + } + + void CInterfaceElement::setSizeParent( const std::string &id ) + { + // Parent or empty id simply means the group parent + if( ( id == "parent" ) || ( id.empty() ) ) + { + setParentSize( getParent() ); + return; + } + + CInterfaceElement *pp = NULL; + + // Check if it's a short Id + std::string::size_type idx = id.find( "ui:" ); + if( idx == std::string::npos ) + { + // If it is, find the widget in the parent group and set as posparent + CInterfaceGroup *p = getParent(); + if( p != NULL ) { - idParent = _Parent->getId(); - CWidgetManager::getInstance()->getParser()->addParentSizeAssociation( this, idParent ); + pp = p->findFromShortId( id ); } } + else + { + // If it is not, find using the widgetmanager + // TODO: refactor, shouldn't use a singleton + pp = CWidgetManager::getInstance()->getElementFromId( id ); + } + + if( pp != NULL ) + setParentSize( pp ); + } + + void CInterfaceElement::getSizeParent( std::string &id ) const + { + CInterfaceElement *p = getParentSize(); + + // If there's no parent set then the size parent is the parent + if( p == NULL ) + { + id = "parent"; + return; + } + + // If the size parent is the same as the group parent, then the size parent is the parent ofc + if( p == getParent() ) + { + id = "parent"; + return; + } + + // If the size parent is in the parent group, use the short Id + if( p->isInGroup( getParent() ) ) + { + id = p->getShortId(); + return; + } + + // Otherwise use the full Id + id = p->getId(); } void CInterfaceElement::registerDeletionWatcher( IDeletionWatcher *watcher ) diff --git a/code/nel/src/gui/interface_parser.cpp b/code/nel/src/gui/interface_parser.cpp index b26a403c4..096c001ae 100644 --- a/code/nel/src/gui/interface_parser.cpp +++ b/code/nel/src/gui/interface_parser.cpp @@ -37,6 +37,7 @@ #include "nel/gui/lua_helper.h" #include "nel/gui/lua_ihm.h" #include "nel/gui/lua_manager.h" +#include "nel/gui/root_group.h" #ifdef LUA_NEVRAX_VERSION #include "lua_ide_dll_nevrax/include/lua_ide_dll/ide_interface.h" // external debugger @@ -113,86 +114,6 @@ namespace NLGUI return node; } - - - // ---------------------------------------------------------------------------- - // CRootGroup - // ---------------------------------------------------------------------------- - - class CRootGroup : public CInterfaceGroup - { - public: - CRootGroup(const TCtorParam ¶m) - : CInterfaceGroup(param) - { } - - /// Destructor - virtual ~CRootGroup() { } - - virtual CInterfaceElement* getElement (const std::string &id) - { - if (_Id == id) - return this; - - if (id.substr(0, _Id.size()) != _Id) - return NULL; - - vector::const_iterator itv; - for (itv = _Views.begin(); itv != _Views.end(); itv++) - { - CViewBase *pVB = *itv; - if (pVB->getId() == id) - return pVB; - } - - vector::const_iterator itc; - for (itc = _Controls.begin(); itc != _Controls.end(); itc++) - { - CCtrlBase* ctrl = *itc; - if (ctrl->getId() == id) - return ctrl; - } - - // Accelerate - string sTmp = id; - sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); - string::size_type pos = sTmp.find(':'); - if (pos != string::npos) - sTmp = sTmp.substr(0,pos); - - map::iterator it = _Accel.find(sTmp); - if (it != _Accel.end()) - { - CInterfaceGroup *pIG = it->second; - return pIG->getElement(id); - } - return NULL; - } - - virtual void addGroup (CInterfaceGroup *child, sint eltOrder = -1) - { - string sTmp = child->getId(); - sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); - _Accel.insert(pair(sTmp, child)); - CInterfaceGroup::addGroup(child,eltOrder); - } - - virtual bool delGroup (CInterfaceGroup *child, bool dontDelete = false) - { - string sTmp = child->getId(); - sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); - map::iterator it = _Accel.find(sTmp); - if (it != _Accel.end()) - { - _Accel.erase(it); - } - return CInterfaceGroup::delGroup(child,dontDelete); - } - - private: - map _Accel; - }; - // ---------------------------------------------------------------------------- // CInterfaceParser // ---------------------------------------------------------------------------- @@ -233,6 +154,22 @@ namespace NLGUI destStream.seek(0, NLMISC::IStream::begin); } + std::string CInterfaceParser::lookup( const std::string &file ) + { + std::string filename; + + if( editorMode && !_WorkDir.empty() ) + { + std::string wdpath = CPath::standardizePath( _WorkDir ) + file; + if( CFile::fileExists( wdpath ) ) + filename = wdpath; + } + if( filename.empty() ) + filename = CPath::lookup( file ); + + return filename; + } + // ---------------------------------------------------------------------------- bool CInterfaceParser::parseInterface (const std::vector & strings, bool reload, bool isFilename, bool checkInData) { @@ -270,7 +207,7 @@ namespace NLGUI { //get the first file document pointer firstFileName = *it; - string filename = CPath::lookup(firstFileName); + string filename = lookup( firstFileName ); bool isInData = false; string::size_type pos = filename.find ("@"); if (pos != string::npos) @@ -283,7 +220,7 @@ namespace NLGUI isInData = true; } - if ((needCheck && !isInData) || !file.open (CPath::lookup(firstFileName))) + if ((needCheck && !isInData) || !file.open (lookup(firstFileName))) { // todo hulud interface syntax error nlwarning ("could not open file %s, skipping xml parsing",firstFileName.c_str()); @@ -331,7 +268,7 @@ namespace NLGUI { saveParseResult = true; std::string archive = CPath::lookup(nextFileName + "_compressed", false, false); - std::string current = CPath::lookup(nextFileName, false, false); + std::string current = lookup(nextFileName); if (!archive.empty() && !current.empty()) { if (CFile::getFileModificationDate(current) <= CFile::getFileModificationDate(archive)) @@ -351,7 +288,7 @@ namespace NLGUI { if (isFilename) { - if (!file.open(CPath::lookup(nextFileName, false, false))) + if (!file.open(lookup(nextFileName))) { // todo hulud interface syntax error nlwarning ("could not open file %s, skipping xml parsing",nextFileName.c_str()); @@ -3014,6 +2951,34 @@ namespace NLGUI itr->second = linkData; } + void CInterfaceParser::setVariable( const VariableData &v ) + { + CInterfaceProperty prop; + const std::string &type = v.type; + const std::string &value = v.value; + const std::string &entry = v.entry; + + if( type == "sint64" ) + prop.readSInt64( value.c_str(), entry ); + else + if( type == "sint32" ) + prop.readSInt32( value.c_str(), entry ); + else + if( type == "float" || type == "double" ) + prop.readDouble( value.c_str(), entry ); + else + if( type == "bool" ) + prop.readBool( value.c_str(), entry ); + else + if( type == "rgba" ) + prop.readRGBA( value.c_str(), entry ); + else + if( type == "hotspot" ) + prop.readHotSpot( value.c_str(), entry ); + + variableCache[ entry ] = v; + } + bool CInterfaceParser::serializeVariables( xmlNodePtr parentNode ) const { diff --git a/code/nel/src/gui/root_group.cpp b/code/nel/src/gui/root_group.cpp new file mode 100644 index 000000000..bffdd5579 --- /dev/null +++ b/code/nel/src/gui/root_group.cpp @@ -0,0 +1,94 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#include "nel/gui/root_group.h" +#include + +namespace NLGUI +{ + + CRootGroup::CRootGroup(const TCtorParam ¶m) : + CInterfaceGroup(param) + { + } + + CRootGroup::~CRootGroup() + { + } + + CInterfaceElement* CRootGroup::getElement (const std::string &id) + { + if (_Id == id) + return this; + + if (id.substr(0, _Id.size()) != _Id) + return NULL; + + std::vector::const_iterator itv; + for (itv = _Views.begin(); itv != _Views.end(); itv++) + { + CViewBase *pVB = *itv; + if (pVB->getId() == id) + return pVB; + } + + std::vector::const_iterator itc; + for (itc = _Controls.begin(); itc != _Controls.end(); itc++) + { + CCtrlBase* ctrl = *itc; + if (ctrl->getId() == id) + return ctrl; + } + + // Accelerate + std::string sTmp = id; + sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); + std::string::size_type pos = sTmp.find(':'); + if (pos != std::string::npos) + sTmp = sTmp.substr(0,pos); + + std::map::iterator it = _Accel.find(sTmp); + if (it != _Accel.end()) + { + CInterfaceGroup *pIG = it->second; + return pIG->getElement(id); + } + return NULL; + } + + void CRootGroup::addGroup (CInterfaceGroup *child, sint eltOrder) + { + std::string sTmp = child->getId(); + sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); + _Accel.insert(std::pair(sTmp, child)); + CInterfaceGroup::addGroup(child,eltOrder); + } + + bool CRootGroup::delGroup (CInterfaceGroup *child, bool dontDelete) + { + std::string sTmp = child->getId(); + sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); + std::map::iterator it = _Accel.find(sTmp); + if (it != _Accel.end()) + { + _Accel.erase(it); + } + return CInterfaceGroup::delGroup(child,dontDelete); + } + +} + diff --git a/code/nel/src/gui/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp index c68a2c963..81fbaf28b 100644 --- a/code/nel/src/gui/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -35,6 +35,7 @@ #include "nel/gui/reflect_register.h" #include "nel/gui/editor_selection_watcher.h" #include "nel/misc/events.h" +#include "nel/gui/root_group.h" namespace NLGUI { @@ -1041,6 +1042,8 @@ namespace NLGUI resetGlobalAlphasProps(); activeAnims.clear(); + + editorSelection.clear(); } @@ -3604,6 +3607,68 @@ namespace NLGUI } + bool CWidgetManager::createNewGUI( const std::string &project, const std::string &window ) + { + reset(); + + for( int i = 0; i < _MasterGroups.size(); i++ ) + delete _MasterGroups[i].Group; + _MasterGroups.clear(); + + // First create the master group + CRootGroup *root = new CRootGroup( CViewBase::TCtorParam() ); + + SMasterGroup mg; + mg.Group = root; + + root->setIdRecurse( project ); + root->setW( 1024 ); + root->setH( 768 ); + root->setActive( true ); + + // Create the first / main window + CInterfaceGroup *wnd = new CInterfaceGroup( CViewBase::TCtorParam() ); + wnd->setW( 1024 ); + wnd->setH( 768 ); + wnd->setParent( root ); + wnd->setParentPos( root ); + wnd->setParentSize( root ); + wnd->setPosRef( Hotspot_MM ); + wnd->setParentPosRef( Hotspot_MM ); + wnd->setIdRecurse( window ); + wnd->setActive( true ); + + // Add the window + root->addElement( wnd ); + mg.addWindow( wnd, wnd->getPriority() ); + _MasterGroups.push_back( mg ); + + _Pointer = new CViewPointer( CViewBase::TCtorParam() ); + + IParser *parser = getParser(); + + + // Set base color to white + VariableData v; + v.type = "sint32"; + v.value = "255"; + + v.entry = "UI:SAVE:COLOR:R"; + parser->setVariable( v ); + + v.entry = "UI:SAVE:COLOR:G"; + parser->setVariable( v ); + + v.entry = "UI:SAVE:COLOR:B"; + parser->setVariable( v ); + + v.entry = "UI:SAVE:COLOR:A"; + parser->setVariable( v ); + + return true; + } + + CWidgetManager::CWidgetManager() { LinkHack(); diff --git a/code/studio/src/plugins/gui_editor/CMakeLists.txt b/code/studio/src/plugins/gui_editor/CMakeLists.txt index 2b46e2cdc..e1e8b38be 100644 --- a/code/studio/src/plugins/gui_editor/CMakeLists.txt +++ b/code/studio/src/plugins/gui_editor/CMakeLists.txt @@ -36,6 +36,7 @@ SET(OVQT_PLUGIN_GUI_EDITOR_HDR texture_property_manager.h expression_editor.h expr_link_dlg.h + new_gui_dlg.h ) SET(OVQT_PLUGIN_GUI_EDITOR_UIS @@ -55,6 +56,7 @@ SET(OVQT_PLUGIN_GUI_EDITOR_UIS texture_chooser.ui expression_editor.ui expr_link_dlg.ui + new_gui_dlg.ui ) SET(QT_USE_QTGUI TRUE) diff --git a/code/studio/src/plugins/gui_editor/gui_editor_window.cpp b/code/studio/src/plugins/gui_editor/gui_editor_window.cpp index ca5e240e7..002002abd 100644 --- a/code/studio/src/plugins/gui_editor/gui_editor_window.cpp +++ b/code/studio/src/plugins/gui_editor/gui_editor_window.cpp @@ -44,6 +44,7 @@ #include "editor_selection_watcher.h" #include "editor_message_processor.h" #include "add_widget_widget.h" +#include "new_gui_dlg.h" namespace GUIEditor { @@ -181,6 +182,8 @@ namespace GUIEditor currentProject = projectFiles.projectName.c_str(); currentProjectFile = fileName; projectWindow->setupFiles( projectFiles ); + GUICtrl->setWorkDir( _lastDir ); + if( GUICtrl->parse( projectFiles ) ) { hierarchyView->buildHierarchy( projectFiles.masterGroup ); @@ -197,13 +200,64 @@ namespace GUIEditor void GUIEditorWindow::newDocument() { - } + NewGUIDlg d; + int result = d.exec(); + + if( result == QDialog::Rejected ) + return; - void GUIEditorWindow::save() - { - if( currentProject.isEmpty() ) + close(); + + std::string proj = d.getProjectName().toUtf8().constData(); + std::string wnd = d.getWindowName().toUtf8().constData(); + std::string mg = std::string( "ui:" ) + proj; + std::string dir = d.getProjectDirectory().toUtf8().constData(); + _lastDir = dir.c_str(); + std::string uiFile = "ui_" + proj + ".xml"; + + QList< QString > mapList; + d.getMapList( mapList ); + + bool b = GUICtrl->createNewGUI( proj, wnd ); + if( !b ) + { + QMessageBox::information( this, + tr( "Creating new GUI project" ), + tr( "Failed to create new GUI project :(" ) ); + reset(); return; + } + + hierarchyView->buildHierarchy( mg ); + + projectFiles.projectName = proj; + projectFiles.masterGroup = mg; + projectFiles.activeGroup = std::string( "ui:" ) + proj + ":" + wnd; + projectFiles.version = SProjectFiles::NEW; + projectFiles.guiFiles.push_back( uiFile ); + + for( int i = 0; i < mapList.size(); i++ ) + { + projectFiles.mapFiles.push_back( mapList[ i ].toUtf8().constData() ); + } + + b = GUICtrl->loadMapFiles( projectFiles.mapFiles ); + if( !b ) + { + QMessageBox::information( this, + tr( "Creating new GUI project" ), + tr( "Failed to create new GUI project: Couldn't load map files. " ) ); + reset(); + return; + } + + projectWindow->setupFiles( projectFiles ); + currentProject = proj.c_str(); + currentProjectFile = std::string( dir + "/" + proj + ".xml" ).c_str(); + + + // Save the project file CProjectFileSerializer serializer; serializer.setFile( currentProjectFile.toUtf8().constData() ); if( !serializer.serialize( projectFiles ) ) @@ -214,33 +268,26 @@ namespace GUIEditor return; } - // Can't save old projects any further, since the widgets are in multiple files in them - // using templates, styles and whatnot. There's no way to restore the original XML structure - // after it's loaded - if( projectParser.getProjectVersion() == OLD ) + // Save the GUI file + WidgetSerializer widgetSerializer; + widgetSerializer.setFile( dir + "/" + uiFile ); + widgetSerializer.setActiveGroup( projectFiles.activeGroup ); + if( !widgetSerializer.serialize( projectFiles.masterGroup ) ) + { + QMessageBox::critical( this, + tr( "Failed to save project" ), + tr( "There was an error while trying to save the project." ) ); return; + } } - void GUIEditorWindow::saveAs() + void GUIEditorWindow::save() { if( currentProject.isEmpty() ) return; - QString dir = - QFileDialog::getExistingDirectory( this, tr( "Save project as..." ) ); - - if( dir.isEmpty() ) - return; - - projectFiles.guiFiles.clear(); - projectFiles.guiFiles.push_back( "ui_" + projectFiles.projectName + ".xml" ); - projectFiles.version = NEW; - - QString newFile = - dir + "/" + projectFiles.projectName.c_str() + ".xml"; - CProjectFileSerializer serializer; - serializer.setFile( newFile.toUtf8().constData() ); + serializer.setFile( currentProjectFile.toUtf8().constData() ); if( !serializer.serialize( projectFiles ) ) { QMessageBox::critical( this, @@ -249,11 +296,18 @@ namespace GUIEditor return; } - std::string guiFile = - std::string( dir.toUtf8().constData() ) + "/" + "ui_" + projectFiles.projectName + ".xml"; + // Can't save old projects any further, since the widgets are in multiple files in them + // using templates, styles and whatnot. There's no way to restore the original XML structure + // after it's loaded + if( projectFiles.version == SProjectFiles::OLD ) + return; + + std::string f = _lastDir.toUtf8().constData(); + f += "/"; + f += projectFiles.guiFiles[ 0 ]; WidgetSerializer widgetSerializer; - widgetSerializer.setFile( guiFile ); + widgetSerializer.setFile( f ); widgetSerializer.setActiveGroup( projectFiles.activeGroup ); if( !widgetSerializer.serialize( projectFiles.masterGroup ) ) { @@ -262,11 +316,48 @@ namespace GUIEditor tr( "There was an error while trying to save the project." ) ); return; } + } - QMessageBox::information( this, - tr( "Save successful" ), - tr( "Project saved successfully!" ) ); + void GUIEditorWindow::saveAs() + { + if( currentProject.isEmpty() ) + return; + QString dir = + QFileDialog::getExistingDirectory( this, tr( "Save project as..." ) ); + + if( dir.isEmpty() ) + return; + _lastDir = dir; + + if( projectFiles.version == SProjectFiles::OLD ) + { + projectFiles.guiFiles.clear(); + projectFiles.guiFiles.push_back( "ui_" + projectFiles.projectName + ".xml" ); + projectFiles.version = SProjectFiles::NEW; + + } + + currentProjectFile = _lastDir; + currentProjectFile += "/"; + currentProjectFile += projectFiles.projectName.c_str(); + currentProjectFile += ".xml"; + + save(); + } + + void GUIEditorWindow::reset() + { + projectFiles.clearAll(); + projectWindow->clear(); + hierarchyView->clearHierarchy(); + GUICtrl->reset(); + browserCtrl.clear(); + linkList->clear(); + procList->clear(); + currentProject = ""; + currentProjectFile = ""; + projectParser.clear(); } bool GUIEditorWindow::close() @@ -286,16 +377,7 @@ namespace GUIEditor disconnect( w, SIGNAL( sgnSelectionChanged() ), hierarchyView, SLOT( onSelectionChanged() ) ); disconnect( w, SIGNAL( sgnSelectionChanged() ), &browserCtrl, SLOT( onSelectionChanged() ) ); - projectFiles.clearAll(); - projectWindow->clear(); - hierarchyView->clearHierarchy(); - GUICtrl->reset(); - browserCtrl.clear(); - linkList->clear(); - procList->clear(); - currentProject = ""; - currentProjectFile = ""; - projectParser.clear(); + reset(); return true; } @@ -356,14 +438,14 @@ namespace GUIEditor void GUIEditorWindow::createMenus() { Core::MenuManager *mm = Core::ICore::instance()->menuManager(); - //QAction *newAction = mm->action( Core::Constants::NEW ); + QAction *newAction = mm->action( Core::Constants::NEW ); QAction *saveAction = mm->action( Core::Constants::SAVE ); QAction *saveAsAction = mm->action( Core::Constants::SAVE_AS ); QAction *closeAction = mm->action( Core::Constants::CLOSE ); QAction *delAction = mm->action( Core::Constants::DEL ); - //if( newAction != NULL ) - // newAction->setEnabled( true ); + if( newAction != NULL ) + newAction->setEnabled( true ); if( saveAction != NULL ) saveAction->setEnabled( true ); if( saveAsAction != NULL ) diff --git a/code/studio/src/plugins/gui_editor/gui_editor_window.h b/code/studio/src/plugins/gui_editor/gui_editor_window.h index cc2dfbc65..4a0a919a4 100644 --- a/code/studio/src/plugins/gui_editor/gui_editor_window.h +++ b/code/studio/src/plugins/gui_editor/gui_editor_window.h @@ -70,6 +70,7 @@ protected: void showEvent( QShowEvent *evnt ); private: + void reset(); void createMenus(); void removeMenus(); diff --git a/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp b/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp index 03f784944..e9712ce4e 100644 --- a/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp +++ b/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp @@ -89,10 +89,30 @@ namespace GUIEditor reset(); IParser *parser = CWidgetManager::getInstance()->getParser(); - std::vector< std::string >::iterator itr; - for( itr = files.mapFiles.begin(); itr != files.mapFiles.end(); ++itr ) + if( !loadMapFiles( files.mapFiles ) ) + return false; + + if( !parser->parseInterface( files.guiFiles, false ) ) + return false; + + CWidgetManager::getInstance()->updateAllLocalisedElements(); + CWidgetManager::getInstance()->activateMasterGroup( files.masterGroup, true ); + + CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( files.activeGroup ); + if( e != NULL ) + e->setActive( true ); + + onGUILoaded(); + + return true; + } + + bool NelGUICtrl::loadMapFiles( const std::vector< std::string > &v ) + { + std::vector< std::string >::const_iterator itr; + for( itr = v.begin(); itr != v.end(); ++itr ) { - std::string &file = *itr; + const std::string &file = *itr; std::string::size_type i = file.find_last_of( '.' ); std::string mapFile = file.substr( 0, i ); mapFile.append( ".txt" ); @@ -104,21 +124,27 @@ namespace GUIEditor } } - if( !parser->parseInterface( files.guiFiles, false ) ) + return true; + } + + bool NelGUICtrl::createNewGUI( const std::string &project, const std::string &window ) + { + reset(); + bool ok = CWidgetManager::getInstance()->createNewGUI( project, window ); + if( !ok ) return false; + std::string mg = std::string( "ui:" ) + project; + std::string ag = mg + ":" + window; + CWidgetManager::getInstance()->updateAllLocalisedElements(); - CWidgetManager::getInstance()->activateMasterGroup( files.masterGroup, true ); + CWidgetManager::getInstance()->activateMasterGroup( mg, true ); - CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( files.activeGroup ); + CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( ag ); if( e != NULL ) e->setActive( true ); - timerID = startTimer( 200 ); - guiLoaded = true; - Q_EMIT guiLoadComplete(); - - CWidgetManager::getInstance()->registerSelectionWatcher( watcher ); + onGUILoaded(); return true; } @@ -160,6 +186,15 @@ namespace GUIEditor } } + void NelGUICtrl::onGUILoaded() + { + timerID = startTimer( 200 ); + guiLoaded = true; + Q_EMIT guiLoadComplete(); + + CWidgetManager::getInstance()->registerSelectionWatcher( watcher ); + } + void NelGUICtrl::show() { if( timerID == 0 ) @@ -187,6 +222,12 @@ namespace GUIEditor } } + void NelGUICtrl::setWorkDir( const QString &dir ) + { + IParser *parser = CWidgetManager::getInstance()->getParser(); + parser->setWorkDir( std::string( dir.toUtf8().constData() ) ); + } + QWidget* NelGUICtrl::getViewPort() { return w; diff --git a/code/studio/src/plugins/gui_editor/nelgui_ctrl.h b/code/studio/src/plugins/gui_editor/nelgui_ctrl.h index b3c68ff32..d54c78c7a 100644 --- a/code/studio/src/plugins/gui_editor/nelgui_ctrl.h +++ b/code/studio/src/plugins/gui_editor/nelgui_ctrl.h @@ -43,6 +43,8 @@ namespace GUIEditor void init(); bool parse( SProjectFiles &files ); + bool loadMapFiles( const std::vector< std::string > &v ); + bool createNewGUI( const std::string &project, const std::string &window ); void draw(); void reset(); CEditorSelectionWatcher* getWatcher(){ return watcher; } @@ -52,6 +54,8 @@ namespace GUIEditor void show(); void hide(); + void setWorkDir( const QString &dir ); + Q_SIGNALS: void guiLoadComplete(); @@ -59,6 +63,8 @@ Q_SIGNALS: void timerEvent( QTimerEvent *evnt ); private: + void onGUILoaded(); + int timerID; bool guiLoaded; CEditorSelectionWatcher *watcher; diff --git a/code/studio/src/plugins/gui_editor/new_gui_dlg.cpp b/code/studio/src/plugins/gui_editor/new_gui_dlg.cpp new file mode 100644 index 000000000..3c9208dfc --- /dev/null +++ b/code/studio/src/plugins/gui_editor/new_gui_dlg.cpp @@ -0,0 +1,135 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "new_gui_dlg.h" +#include +#include + +NewGUIDlg::NewGUIDlg( QWidget *parent ) : +QDialog( parent ) +{ + m_ui.setupUi( this ); + + connect( m_ui.okButton, SIGNAL( clicked( bool ) ), this, SLOT( onOKClicked() ) ); + connect( m_ui.cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( onCancelClicked() ) ); + connect( m_ui.projectDirTB, SIGNAL( clicked( bool ) ), this, SLOT( onProjectDirTBClicked() ) ); + connect( m_ui.addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) ); + connect( m_ui.removeButton, SIGNAL( clicked( bool ) ), this, SLOT( onRemoveClicked() ) ); + +} + +NewGUIDlg::~NewGUIDlg() +{ +} + +QString NewGUIDlg::getProjectName() const +{ + return m_ui.projectEdit->text(); +} + +QString NewGUIDlg::getWindowName() const +{ + return m_ui.windowEdit->text(); +} + +QString NewGUIDlg::getProjectDirectory() const +{ + return m_ui.projectDirEdit->text(); +} + +void NewGUIDlg::getMapList( QList< QString > &l ) +{ + l.clear(); + + for( int i = 0; i < m_ui.mapList->count(); i++ ) + { + l.push_back( m_ui.mapList->item( i )->text() ); + } +} + +void NewGUIDlg::onOKClicked() +{ + if( m_ui.projectEdit->text().isEmpty() ) + { + QMessageBox::information( this, + tr( "New project" ), + tr( "You must specify a project name!" ) ); + return; + } + + if( m_ui.windowEdit->text().isEmpty() ) + { + QMessageBox::information( this, + tr( "New project" ), + tr( "You must specify a window name!" ) ); + return; + } + + if( m_ui.projectDirEdit->text().isEmpty() ) + { + QMessageBox::information( this, + tr( "New project" ), + tr( "You must specify a project directory!" ) ); + return; + } + + accept(); +} + +void NewGUIDlg::onCancelClicked() +{ + reject(); +} + +void NewGUIDlg::onProjectDirTBClicked() +{ + QString dir = QFileDialog::getExistingDirectory( this, + tr( "Specify project directory" ), + "." ); + if( dir.isEmpty() ) + return; + + m_ui.projectDirEdit->setText( dir ); +} + +void NewGUIDlg::onAddClicked() +{ + if( m_ui.mapEdit->text().isEmpty() ) + return; + + QList< QListWidgetItem* > l = m_ui.mapList->findItems( m_ui.mapEdit->text(), Qt::MatchContains ); + if( !l.isEmpty() ) + { + return; + } + + m_ui.mapList->addItem( m_ui.mapEdit->text() ); + m_ui.mapEdit->clear(); +} + +void NewGUIDlg::onRemoveClicked() +{ + QListWidgetItem *item = m_ui.mapList->currentItem(); + if( item == NULL ) + return; + + delete item; +} + + + diff --git a/code/studio/src/plugins/gui_editor/new_gui_dlg.h b/code/studio/src/plugins/gui_editor/new_gui_dlg.h new file mode 100644 index 000000000..0d878461c --- /dev/null +++ b/code/studio/src/plugins/gui_editor/new_gui_dlg.h @@ -0,0 +1,50 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef NEW_GUI_DLG_H +#define NEW_GUI_DLG_H + +#include "ui_new_gui_dlg.h" +#include + +class NewGUIDlg : public QDialog +{ + Q_OBJECT + +public: + NewGUIDlg( QWidget *parent = NULL ); + ~NewGUIDlg(); + + QString getProjectName() const; + QString getWindowName() const; + QString getProjectDirectory() const; + void getMapList( QList< QString > &l ); + +private Q_SLOTS: + void onOKClicked(); + void onCancelClicked(); + void onProjectDirTBClicked(); + void onAddClicked(); + void onRemoveClicked(); + +private: + Ui::NewGUIDialog m_ui; +}; + +#endif + diff --git a/code/studio/src/plugins/gui_editor/new_gui_dlg.ui b/code/studio/src/plugins/gui_editor/new_gui_dlg.ui new file mode 100644 index 000000000..bf22e8c6b --- /dev/null +++ b/code/studio/src/plugins/gui_editor/new_gui_dlg.ui @@ -0,0 +1,130 @@ + + + NewGUIDialog + + + + 0 + 0 + 399 + 354 + + + + New GUI + + + + + + Project name + + + + + + + + + + Window name + + + + + + + + + + Project directory + + + + + + + + + + ... + + + + + + + Map files + + + + + + Add + + + + + + + + + + Remove + + + + + + + + + + + + + Qt::Horizontal + + + + 107 + 20 + + + + + + + + + + + 0 + 0 + + + + OK + + + + + + + + 0 + 0 + + + + Cancel + + + + + + + + + + diff --git a/code/studio/src/plugins/gui_editor/project_file_parser.cpp b/code/studio/src/plugins/gui_editor/project_file_parser.cpp index 7213b332a..856b3c164 100644 --- a/code/studio/src/plugins/gui_editor/project_file_parser.cpp +++ b/code/studio/src/plugins/gui_editor/project_file_parser.cpp @@ -16,6 +16,7 @@ #include "project_file_parser.h" +#include "nel/misc/debug.h" namespace GUIEditor { @@ -57,12 +58,13 @@ namespace GUIEditor projectFiles.projectName = files.projectName; projectFiles.masterGroup = files.masterGroup; projectFiles.activeGroup = files.activeGroup; + projectFiles.version = files.version; } unsigned long CProjectFileParser::getProjectVersion() const { if( !loaded ) - return OLD; + return SProjectFiles::OLD; return files.version; } @@ -70,7 +72,7 @@ namespace GUIEditor void CProjectFileParser::clear() { files.projectName = ""; - files.version = OLD; + files.version = SProjectFiles::OLD; files.activeGroup = ""; files.guiFiles.clear(); files.mapFiles.clear(); @@ -208,7 +210,9 @@ namespace GUIEditor reader.readNext(); } if( files.mapFiles.empty() ) - return false; + { + nlinfo( "No map file(s) specified in project file." ); + } return true; } diff --git a/code/studio/src/plugins/gui_editor/project_file_serializer.cpp b/code/studio/src/plugins/gui_editor/project_file_serializer.cpp index 4eb442d3f..0b34f511b 100644 --- a/code/studio/src/plugins/gui_editor/project_file_serializer.cpp +++ b/code/studio/src/plugins/gui_editor/project_file_serializer.cpp @@ -25,7 +25,7 @@ namespace GUIEditor if( fileName.empty() ) return false; - if( project.version >= MAX_PROJECTFILE_VERSION ) + if( project.version >= SProjectFiles::MAX_PROJECTFILE_VERSION ) return false; out.open( fileName.c_str() ); diff --git a/code/studio/src/plugins/gui_editor/project_files.h b/code/studio/src/plugins/gui_editor/project_files.h index 4ae58493b..786bd22e4 100644 --- a/code/studio/src/plugins/gui_editor/project_files.h +++ b/code/studio/src/plugins/gui_editor/project_files.h @@ -23,16 +23,17 @@ namespace GUIEditor { - enum ProjectVersion - { - OLD = 0, - NEW = 1, - MAX_PROJECTFILE_VERSION - }; - struct SProjectFiles { public: + + enum ProjectVersion + { + OLD = 0, + NEW = 1, + MAX_PROJECTFILE_VERSION + }; + std::string projectName; unsigned long version; std::string masterGroup; diff --git a/code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp b/code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp index 84302bcf0..c518d7acc 100644 --- a/code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp +++ b/code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp @@ -728,9 +728,6 @@ namespace GUIEditor { std::string j = element->getProperty( prop.propName ); - if( j.empty() ) - return; - QtProperty *pp = actionMgr->addProperty( prop.propName.c_str() ); if( pp == NULL ) return; diff --git a/code/studio/src/plugins/gui_editor/widget_serializer.cpp b/code/studio/src/plugins/gui_editor/widget_serializer.cpp index fd4e7cfbe..8006a6b50 100644 --- a/code/studio/src/plugins/gui_editor/widget_serializer.cpp +++ b/code/studio/src/plugins/gui_editor/widget_serializer.cpp @@ -93,8 +93,6 @@ namespace GUIEditor return false; } - ag->setActive( false ); - if( mg->serializeSubGroups( root ) == NULL ) { ag->setActive( true ); @@ -103,8 +101,6 @@ namespace GUIEditor return false; } - ag->setActive( true ); - if( !mg->serializeLinks( root ) ) { xmlFreeNode( root ); diff --git a/code/studio/src/plugins/gui_editor/widgets/CtrlButton.xml b/code/studio/src/plugins/gui_editor/widgets/CtrlButton.xml index 12b82e7f6..c081f3dae 100644 --- a/code/studio/src/plugins/gui_editor/widgets/CtrlButton.xml +++ b/code/studio/src/plugins/gui_editor/widgets/CtrlButton.xml @@ -2,6 +2,7 @@
CtrlButton CCtrlButton + button CtrlBaseButton false diff --git a/code/studio/src/plugins/gui_editor/widgets/CtrlColPick.xml b/code/studio/src/plugins/gui_editor/widgets/CtrlColPick.xml index ea2ba6171..7ab3e2f48 100644 --- a/code/studio/src/plugins/gui_editor/widgets/CtrlColPick.xml +++ b/code/studio/src/plugins/gui_editor/widgets/CtrlColPick.xml @@ -2,6 +2,7 @@
CtrlColPick CCtrlColPick + colpick CtrlBase false diff --git a/code/studio/src/plugins/gui_editor/widgets/CtrlScroll.xml b/code/studio/src/plugins/gui_editor/widgets/CtrlScroll.xml index 1ad970f31..9f5fcfc60 100644 --- a/code/studio/src/plugins/gui_editor/widgets/CtrlScroll.xml +++ b/code/studio/src/plugins/gui_editor/widgets/CtrlScroll.xml @@ -2,6 +2,7 @@
CtrlScroll CCtrlScroll + scroll CtrlBase false diff --git a/code/studio/src/plugins/gui_editor/widgets/CtrlTextButton.xml b/code/studio/src/plugins/gui_editor/widgets/CtrlTextButton.xml index ca66dbd62..6afd06cdf 100644 --- a/code/studio/src/plugins/gui_editor/widgets/CtrlTextButton.xml +++ b/code/studio/src/plugins/gui_editor/widgets/CtrlTextButton.xml @@ -2,6 +2,7 @@
CtrlTextButton CCtrlTextButton + text_button CtrlBaseButton false @@ -11,22 +12,22 @@ tx_normal string - + but tx_pushed string - + but tx_over string - + but_over hardtext string - + push me wmargin @@ -156,7 +157,7 @@ line_maxw int - 0 + 100 multi_line_space diff --git a/code/studio/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml b/code/studio/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml index 624ded887..7d78fc6b9 100644 --- a/code/studio/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml @@ -2,6 +2,7 @@
DBGroupSelectNumber CDBGroupSelectNumber + select_number InterfaceGroup false diff --git a/code/studio/src/plugins/gui_editor/widgets/DBViewBar.xml b/code/studio/src/plugins/gui_editor/widgets/DBViewBar.xml index c7f644fa4..878f9b563 100644 --- a/code/studio/src/plugins/gui_editor/widgets/DBViewBar.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBViewBar.xml @@ -2,6 +2,7 @@
DBViewBar CDBViewBar + bar ViewBitmap false diff --git a/code/studio/src/plugins/gui_editor/widgets/DBViewBar3.xml b/code/studio/src/plugins/gui_editor/widgets/DBViewBar3.xml index 8295c5f30..db635eb27 100644 --- a/code/studio/src/plugins/gui_editor/widgets/DBViewBar3.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBViewBar3.xml @@ -2,6 +2,7 @@
DBViewBar3 CDBViewBar3 + bar3 ViewBitmap false diff --git a/code/studio/src/plugins/gui_editor/widgets/DBViewDigit.xml b/code/studio/src/plugins/gui_editor/widgets/DBViewDigit.xml index 0c12445f9..1a659fd91 100644 --- a/code/studio/src/plugins/gui_editor/widgets/DBViewDigit.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBViewDigit.xml @@ -2,6 +2,7 @@
DBViewDigit CDBViewDigit + digit CtrlBase false diff --git a/code/studio/src/plugins/gui_editor/widgets/DBViewNumber.xml b/code/studio/src/plugins/gui_editor/widgets/DBViewNumber.xml index c1861df61..36a7d23ce 100644 --- a/code/studio/src/plugins/gui_editor/widgets/DBViewNumber.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBViewNumber.xml @@ -2,6 +2,7 @@
DBViewNumber CDBViewNumber + text_number ViewText false diff --git a/code/studio/src/plugins/gui_editor/widgets/DBViewQuantity.xml b/code/studio/src/plugins/gui_editor/widgets/DBViewQuantity.xml index c24379c96..c11c1a4cc 100644 --- a/code/studio/src/plugins/gui_editor/widgets/DBViewQuantity.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBViewQuantity.xml @@ -2,6 +2,7 @@
DBViewQuantity CDBViewQuantity + text_quantity ViewText false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupContainer.xml b/code/studio/src/plugins/gui_editor/widgets/GroupContainer.xml index 3d879a150..a3c9aade7 100644 --- a/code/studio/src/plugins/gui_editor/widgets/GroupContainer.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupContainer.xml @@ -2,6 +2,7 @@
GroupContainer CGroupContainer + container InterfaceGroup false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupEditBox.xml b/code/studio/src/plugins/gui_editor/widgets/GroupEditBox.xml index 31ca205c7..578262a20 100644 --- a/code/studio/src/plugins/gui_editor/widgets/GroupEditBox.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupEditBox.xml @@ -2,6 +2,7 @@
GroupEditBox CGroupEditBox + edit_box InterfaceGroup false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupHTML.xml b/code/studio/src/plugins/gui_editor/widgets/GroupHTML.xml index 5f0521be8..894580734 100644 --- a/code/studio/src/plugins/gui_editor/widgets/GroupHTML.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupHTML.xml @@ -2,6 +2,7 @@
GroupHTML CGroupHTML + html GroupScrollText false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupHeader.xml b/code/studio/src/plugins/gui_editor/widgets/GroupHeader.xml index cc96fd742..91dd73e36 100644 --- a/code/studio/src/plugins/gui_editor/widgets/GroupHeader.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupHeader.xml @@ -2,6 +2,7 @@
GroupHeader CGroupHeader + header GroupList false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupList.xml b/code/studio/src/plugins/gui_editor/widgets/GroupList.xml index 3ca2db95c..569aa8d9d 100644 --- a/code/studio/src/plugins/gui_editor/widgets/GroupList.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupList.xml @@ -2,6 +2,7 @@
GroupList CGroupList + list InterfaceGroup false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupMenu.xml b/code/studio/src/plugins/gui_editor/widgets/GroupMenu.xml index cdd42ba95..3bd0c5506 100644 --- a/code/studio/src/plugins/gui_editor/widgets/GroupMenu.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupMenu.xml @@ -2,6 +2,7 @@
GroupMenu CGroupMenu + menu GroupModal false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupModal.xml b/code/studio/src/plugins/gui_editor/widgets/GroupModal.xml index 034e3025e..33bd6fd08 100644 --- a/code/studio/src/plugins/gui_editor/widgets/GroupModal.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupModal.xml @@ -2,6 +2,7 @@
GroupModal CGroupModal + modal GroupFrame false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupScrollText.xml b/code/studio/src/plugins/gui_editor/widgets/GroupScrollText.xml index 95719398d..53092a456 100644 --- a/code/studio/src/plugins/gui_editor/widgets/GroupScrollText.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupScrollText.xml @@ -2,6 +2,7 @@
GroupScrollText CGroupScrollText + scroll_text InterfaceGroup false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupTab.xml b/code/studio/src/plugins/gui_editor/widgets/GroupTab.xml index df148a0a3..e2e1a8bf1 100644 --- a/code/studio/src/plugins/gui_editor/widgets/GroupTab.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupTab.xml @@ -2,6 +2,7 @@
GroupTab CGroupTab + tab InterfaceGroup false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupTable.xml b/code/studio/src/plugins/gui_editor/widgets/GroupTable.xml index 9fa957741..dfbc4e2a8 100644 --- a/code/studio/src/plugins/gui_editor/widgets/GroupTable.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupTable.xml @@ -2,6 +2,7 @@
GroupTable CGroupTable + table InterfaceGroup false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupTree.xml b/code/studio/src/plugins/gui_editor/widgets/GroupTree.xml index 73b1dea3b..b20c74733 100644 --- a/code/studio/src/plugins/gui_editor/widgets/GroupTree.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupTree.xml @@ -2,6 +2,7 @@
GroupTree CGroupTree + tree InterfaceGroup false diff --git a/code/studio/src/plugins/gui_editor/widgets/InterfaceGroup.xml b/code/studio/src/plugins/gui_editor/widgets/InterfaceGroup.xml index ddcdf01e6..50f7c3e83 100644 --- a/code/studio/src/plugins/gui_editor/widgets/InterfaceGroup.xml +++ b/code/studio/src/plugins/gui_editor/widgets/InterfaceGroup.xml @@ -2,6 +2,7 @@
InterfaceGroup CInterfaceGroup + interface_group CtrlBase false diff --git a/code/studio/src/plugins/gui_editor/widgets/InterfaceGroupWheel.xml b/code/studio/src/plugins/gui_editor/widgets/InterfaceGroupWheel.xml index b095ecac5..6a35671cd 100644 --- a/code/studio/src/plugins/gui_editor/widgets/InterfaceGroupWheel.xml +++ b/code/studio/src/plugins/gui_editor/widgets/InterfaceGroupWheel.xml @@ -2,6 +2,7 @@
InterfaceGroupWheel CInterfaceGroupWheel + group_wheel InterfaceGroup false diff --git a/code/studio/src/plugins/gui_editor/widgets/ViewBitmap.xml b/code/studio/src/plugins/gui_editor/widgets/ViewBitmap.xml index 21ef7daff..7d78f6c40 100644 --- a/code/studio/src/plugins/gui_editor/widgets/ViewBitmap.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewBitmap.xml @@ -2,6 +2,7 @@
ViewBitmap CViewBitmap + bitmap CtrlBase false diff --git a/code/studio/src/plugins/gui_editor/widgets/ViewBitmapCombo.xml b/code/studio/src/plugins/gui_editor/widgets/ViewBitmapCombo.xml index 8fc579675..461f69c55 100644 --- a/code/studio/src/plugins/gui_editor/widgets/ViewBitmapCombo.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewBitmapCombo.xml @@ -2,6 +2,7 @@
ViewBitmapCombo CViewBitmapCombo + bitmap_combo CtrlBase false diff --git a/code/studio/src/plugins/gui_editor/widgets/ViewText.xml b/code/studio/src/plugins/gui_editor/widgets/ViewText.xml index 415c3167e..4862517aa 100644 --- a/code/studio/src/plugins/gui_editor/widgets/ViewText.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewText.xml @@ -2,6 +2,7 @@
ViewText CViewText + text InterfaceElement false @@ -46,7 +47,7 @@ line_maxw int - 0 + 100 multi_line_space @@ -101,7 +102,7 @@ hardtext string - + Some text hardtext_format diff --git a/code/studio/src/plugins/gui_editor/widgets/ViewTextFormated.xml b/code/studio/src/plugins/gui_editor/widgets/ViewTextFormated.xml index cabd081f0..36aa68102 100644 --- a/code/studio/src/plugins/gui_editor/widgets/ViewTextFormated.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewTextFormated.xml @@ -2,6 +2,7 @@
ViewTextFormated CViewTextFormated + text_formated ViewText false diff --git a/code/studio/src/plugins/gui_editor/widgets/ViewTextID.xml b/code/studio/src/plugins/gui_editor/widgets/ViewTextID.xml index 52e010ec6..43ac442c0 100644 --- a/code/studio/src/plugins/gui_editor/widgets/ViewTextID.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewTextID.xml @@ -2,6 +2,7 @@
ViewTextID CViewTextID + text_id ViewText false diff --git a/code/studio/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml b/code/studio/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml index af8dd54eb..32b08f156 100644 --- a/code/studio/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml @@ -2,6 +2,7 @@
ViewTextIDFormated CViewTextIDFormated + text_id_formated ViewTextID false