namespace NLGUI
{
@@ -24,7 +25,7 @@ namespace NLGUI
public:
/// Notifies the watcher about the change
- virtual void selectionChanged( std::string &newSelection ) = 0;
+ virtual void selectionChanged() = 0;
};
}
diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h
index 3f5526197..21d609af3 100644
--- a/code/nel/include/nel/gui/group_html.h
+++ b/code/nel/include/nel/gui/group_html.h
@@ -285,7 +285,7 @@ namespace NLGUI
void addImage(const char *image, bool globalColor, bool reloadImg=false);
// Add a text area in the current paragraph
- CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const ucstring &content);
+ CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const ucstring &content, uint maxlength);
// Add a combo box in the current paragraph
CDBGroupComboBox *addComboBox(const std::string &templateName, const char *name);
@@ -528,7 +528,7 @@ namespace NLGUI
CCellParams () : BgColor(0,0,0,0)
{
Align = CGroupCell::Left;
- VAlign = CGroupCell::Top;
+ VAlign = CGroupCell::Middle;
LeftMargin = 0;
NoWrap = false;
}
@@ -557,6 +557,7 @@ namespace NLGUI
std::string _TextAreaName;
uint _TextAreaRow;
uint _TextAreaCols;
+ uint _TextAreaMaxLength;
// current mode is in select option
bool _SelectOption;
diff --git a/code/nel/include/nel/gui/group_menu.h b/code/nel/include/nel/gui/group_menu.h
index 56b9fb0e3..420967347 100644
--- a/code/nel/include/nel/gui/group_menu.h
+++ b/code/nel/include/nel/gui/group_menu.h
@@ -381,6 +381,7 @@ namespace NLGUI
bool _CloseSubMenuUsingPopModal;
bool _Shadow;
+ bool _ShadowOutline;
bool _Formatted;
uint8 _Space;
sint32 _FontSize;
diff --git a/code/nel/include/nel/gui/group_table.h b/code/nel/include/nel/gui/group_table.h
index 60d3d9e63..746078908 100644
--- a/code/nel/include/nel/gui/group_table.h
+++ b/code/nel/include/nel/gui/group_table.h
@@ -78,6 +78,9 @@ namespace NLGUI
// The Width you want in pixel. This is the parameter
sint32 WidthWanted;
+ sint32 ColSpan;
+ sint32 RowSpan;
+ sint32 TableColumnIndex;
// The min height of the cell
sint32 Height;
@@ -142,6 +145,7 @@ namespace NLGUI
// Table borders
sint32 Border;
+ NLMISC::CRGBA BorderColor;
sint32 CellPadding;
sint32 CellSpacing;
@@ -191,13 +195,14 @@ namespace NLGUI
WidthMax = 0;
WidthWanted = 0;
TableRatio = 0;
- Height = 0;
+ RowSpan = 1;
}
sint32 Width;
sint32 Height;
sint32 WidthWanted;
sint32 WidthMax;
float TableRatio;
+ sint32 RowSpan;
};
// Table row
diff --git a/code/nel/include/nel/gui/interface_element.h b/code/nel/include/nel/gui/interface_element.h
index db7a499c8..c1f6d20e7 100644
--- a/code/nel/include/nel/gui/interface_element.h
+++ b/code/nel/include/nel/gui/interface_element.h
@@ -491,8 +491,12 @@ namespace NLGUI
void setEditorSelected( bool b ){ editorSelected = b; }
bool isEditorSelected() const{ return editorSelected; }
+ void parsePosParent( const std::string &id );
void setPosParent( const std::string &id );
+ void getPosParent( std::string &id ) const;
+ void parseSizeParent( const std::string &id );
void setSizeParent( const std::string &id );
+ void getSizeParent( std::string &id ) const;
void setSerializable( bool b ){ serializable = b; }
bool IsSerializable() const{ return serializable; }
@@ -508,7 +512,24 @@ namespace NLGUI
/// Called when the widget is deleted,
/// so other widgets in the group can check if it belongs to them
- virtual void onWidgetDeleted( CInterfaceElement *e ){}
+ virtual void onWidgetDeleted( CInterfaceElement *e );
+
+ /// Move the element by x in the X direction and y in the Y direction
+ // Uses real coordinates
+ virtual void moveBy( sint32 x, sint32 y )
+ {
+ _XReal += x;
+ _YReal += y;
+ }
+
+ /// Retrieves the coordinates of the specified hotspot
+ void getHSCoords( const THotSpot &hs, sint32 &x, sint32 &y ) const;
+
+ /// Tells which hotspot is the closest to the specified element
+ void getClosestHotSpot( const CInterfaceElement *other, THotSpot &hs );
+
+ /// Aligns the element to the other element specified
+ void alignTo( CInterfaceElement *other );
protected:
diff --git a/code/nel/include/nel/gui/widget_addition_watcher.h b/code/nel/include/nel/gui/interface_factory.h
similarity index 81%
rename from code/nel/include/nel/gui/widget_addition_watcher.h
rename to code/nel/include/nel/gui/interface_factory.h
index a2717e398..bd7f8352a 100644
--- a/code/nel/include/nel/gui/widget_addition_watcher.h
+++ b/code/nel/include/nel/gui/interface_factory.h
@@ -14,19 +14,22 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
-#ifndef WIDGET_ADD_WATCHER
-#define WIDGET_ADD_WATCHER
+#ifndef IFACE_FACTORY
+#define IFACE_FACTORY
#include
namespace NLGUI
{
- class IWidgetAdditionWatcher
+ class CViewBase;
+
+ /// Simple interface element ( widget ) factory
+ class CInterfaceFactory
{
public:
- virtual void widgetAdded( const std::string &name ) = 0;
+ static CViewBase* createClass( const std::string &name );
};
}
-#endif
+#endif
diff --git a/code/nel/include/nel/gui/interface_group.h b/code/nel/include/nel/gui/interface_group.h
index ff0efac3b..b9efd3357 100644
--- a/code/nel/include/nel/gui/interface_group.h
+++ b/code/nel/include/nel/gui/interface_group.h
@@ -57,6 +57,7 @@ namespace NLGUI
CInterfaceElement* findFromShortId(const std::string &id);
/// Dynamic creation
+ virtual void addElement (CInterfaceElement *child, sint eltOrder = -1 );
virtual void addView (CViewBase *child , sint eltOrder = -1);
virtual void addCtrl (CCtrlBase *child, sint eltOrder = -1);
virtual void addGroup (CInterfaceGroup *child, sint eltOrder = -1);
@@ -327,6 +328,17 @@ namespace NLGUI
void onWidgetDeleted( CInterfaceElement *e );
+ void moveBy( sint32 x, sint32 y );
+
+ // Blows up the group, moves it's children to it's parent
+ bool explode();
+
+ /// Adjusts the group's size so that all elements are fully inside the borders
+ void spanElements();
+
+ /// Aligns the elements - used for forming groups
+ void alignElements();
+
protected:
void makeNewClip (sint32 &oldClipX, sint32 &oldClipY, sint32 &oldClipW, sint32 &oldClipH);
diff --git a/code/nel/include/nel/gui/interface_options.h b/code/nel/include/nel/gui/interface_options.h
index f52b9479a..da0ea7de8 100644
--- a/code/nel/include/nel/gui/interface_options.h
+++ b/code/nel/include/nel/gui/interface_options.h
@@ -150,16 +150,17 @@ namespace NLGUI
sint32 TxId_E_Open, W_E_Open, H_E_Open;
sint32 TxId_M_Open, W_M_Open, H_M_Open;
- sint32 TxId_TL_HighLight;
- sint32 TxId_T_HighLight;
- sint32 TxId_TR_HighLight;
- sint32 TxId_L_HighLight;
- sint32 TxId_R_HighLight;
- sint32 TxId_BL_HighLight;
- sint32 TxId_B_HighLight;
- sint32 TxId_BR_HighLight;
-
- sint32 HeaderH;
+ sint32 TxId_TL_HighLight, W_TL_HighLight, H_TL_HighLight;
+ sint32 TxId_T_HighLight, W_T_HighLight, H_T_HighLight;
+ sint32 TxId_TR_HighLight, W_TR_HighLight, H_TR_HighLight;
+ sint32 TxId_L_HighLight, W_L_HighLight, H_L_HighLight;
+ sint32 TxId_R_HighLight, W_R_HighLight, H_R_HighLight;
+ sint32 TxId_BL_HighLight, W_BL_HighLight, H_BL_HighLight;
+ sint32 TxId_B_HighLight, W_B_HighLight, H_B_HighLight;
+ sint32 TxId_BR_HighLight, W_BR_HighLight, H_BR_HighLight;
+
+ sint32 HeaderH;
+ sint32 InsetT; // Offset height of top texture
};
// ***************************************************************************
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/libwww.h b/code/nel/include/nel/gui/libwww.h
index 8da217382..6a744b8c0 100644
--- a/code/nel/include/nel/gui/libwww.h
+++ b/code/nel/include/nel/gui/libwww.h
@@ -79,6 +79,7 @@ namespace NLGUI
HTML_ATTR(TABLE,ALIGN) = 0,
HTML_ATTR(TABLE,BGCOLOR),
HTML_ATTR(TABLE,BORDER),
+ HTML_ATTR(TABLE,BORDERCOLOR),
HTML_ATTR(TABLE,CELLPADDING),
HTML_ATTR(TABLE,CELLSPACING),
HTML_ATTR(TABLE,CLASS),
@@ -189,6 +190,7 @@ namespace NLGUI
HTML_ATTR(TEXTAREA,DISABLED),
HTML_ATTR(TEXTAREA,ID),
HTML_ATTR(TEXTAREA,LANG),
+ HTML_ATTR(TEXTAREA,MAXLENGTH),
HTML_ATTR(TEXTAREA,NAME),
HTML_ATTR(TEXTAREA,READONLY),
HTML_ATTR(TEXTAREA,ROWS),
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 |