mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-05 14:59:01 +00:00
GUI Editor no longer depends on RTTI typename, instead it uses GetClassName() string provided by DECLARE_UI_CLASS().
This commit is contained in:
parent
668e34f996
commit
f55ab4e21e
39 changed files with 71 additions and 18 deletions
|
@ -35,6 +35,7 @@ namespace NLGUI
|
|||
class CCtrlButton : public CCtrlBaseButton
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CCtrlButton )
|
||||
|
||||
/// Constructor
|
||||
CCtrlButton(const TCtorParam ¶m) : CCtrlBaseButton(param)
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace NLGUI
|
|||
{
|
||||
|
||||
public:
|
||||
DECLARE_UI_CLASS( CCtrlColPick )
|
||||
|
||||
CCtrlColPick(const TCtorParam ¶m);
|
||||
~CCtrlColPick();
|
||||
|
|
|
@ -43,7 +43,8 @@ namespace NLGUI
|
|||
class CCtrlPolygon : public CCtrlBase
|
||||
{
|
||||
public:
|
||||
CCtrlPolygon();
|
||||
DECLARE_UI_CLASS( CCtrlPolygon )
|
||||
CCtrlPolygon( const TCtorParam ¶m );
|
||||
virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); }
|
||||
virtual void updateCoords();
|
||||
virtual void draw();
|
||||
|
|
|
@ -38,10 +38,12 @@ namespace NLGUI
|
|||
class CCtrlQuad : public CCtrlBase
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CCtrlQuad )
|
||||
|
||||
enum TWrapMode { Repeat = 0, Clamp, CustomUVs, WrapModeCount };
|
||||
|
||||
|
||||
CCtrlQuad();
|
||||
CCtrlQuad( const TCtorParam ¶m );
|
||||
|
||||
// from CInterfaceElement
|
||||
bool parse(xmlNodePtr cur,CInterfaceGroup *parentGroup);
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace NLGUI
|
|||
*/
|
||||
class CCtrlSheetSelection
|
||||
{
|
||||
public:
|
||||
public:
|
||||
// Add a group, and returns its index, or -1 if already created.
|
||||
sint addGroup(const std::string &name);
|
||||
// Get a group by its name (must exist)
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace NLGUI
|
|||
class CCtrlTextButton : public CCtrlBaseButton
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CCtrlTextButton )
|
||||
|
||||
/// Constructor
|
||||
CCtrlTextButton(const TCtorParam ¶m);
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace NLGUI
|
|||
class CDBGroupComboBox : public CInterfaceGroup
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CDBGroupComboBox )
|
||||
|
||||
/// Constructor
|
||||
CDBGroupComboBox(const TCtorParam ¶m);
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace NLGUI
|
|||
class CDBGroupSelectNumber : public CInterfaceGroup
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CDBGroupSelectNumber )
|
||||
|
||||
/// Constructor
|
||||
CDBGroupSelectNumber(const TCtorParam ¶m);
|
||||
|
|
|
@ -37,6 +37,7 @@ namespace NLGUI
|
|||
public:
|
||||
enum TViewBar { ViewBar_UltraMini, ViewBar_Mini, ViewBar_Normal, ViewBar_MiniThick };
|
||||
public:
|
||||
DECLARE_UI_CLASS( CDBViewBar )
|
||||
|
||||
/// Constructor
|
||||
CDBViewBar(const TCtorParam ¶m)
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace NLGUI
|
|||
class CDBViewBar3 : public CViewBitmap
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CDBViewBar3 )
|
||||
|
||||
/// Constructor
|
||||
CDBViewBar3(const TCtorParam ¶m);
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace NLGUI
|
|||
class CDBViewDigit : public CViewBase
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CDBViewDigit )
|
||||
|
||||
/// Constructor
|
||||
CDBViewDigit(const TCtorParam ¶m);
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace NLGUI
|
|||
class CDBViewNumber : public CViewText
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CDBViewNumber )
|
||||
|
||||
/// Constructor
|
||||
CDBViewNumber(const TCtorParam ¶m);
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace NLGUI
|
|||
class CDBViewQuantity : public CViewText
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CDBViewQuantity )
|
||||
|
||||
/// Constructor
|
||||
CDBViewQuantity(const TCtorParam ¶m);
|
||||
|
|
|
@ -48,6 +48,7 @@ namespace NLGUI
|
|||
{
|
||||
|
||||
public:
|
||||
DECLARE_UI_CLASS( CCtrlResizer )
|
||||
|
||||
CCtrlResizer(const TCtorParam ¶m);
|
||||
virtual void draw ();
|
||||
|
@ -98,8 +99,9 @@ namespace NLGUI
|
|||
class CCtrlMover : public CCtrlBase
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CCtrlMover )
|
||||
|
||||
CCtrlMover(const TCtorParam ¶m, bool canMove, bool canOpen);
|
||||
CCtrlMover(const TCtorParam ¶m, bool canMove = true, bool canOpen = true );
|
||||
~CCtrlMover();
|
||||
virtual void draw ();
|
||||
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
|
||||
|
@ -163,6 +165,7 @@ namespace NLGUI
|
|||
virtual void childrenMoved(uint srcIndex, uint destIndex, CGroupContainer *children) = 0;
|
||||
};
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupContainer )
|
||||
CGroupContainer(const TCtorParam ¶m);
|
||||
~CGroupContainer();
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace NLGUI
|
|||
class CGroupEditBox : public CGroupEditBoxBase
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupEditBox )
|
||||
|
||||
class IComboKeyHandler
|
||||
{
|
||||
|
@ -42,7 +43,6 @@ namespace NLGUI
|
|||
|
||||
enum TEntryType { Text, Integer, PositiveInteger, Float, PositiveFloat, Alpha, AlphaNum, AlphaNumSpace, Password, Filename, PlayerName }; // the type of entry this edit bot can deal with
|
||||
|
||||
DECLARE_UI_CLASS( CGroupEditBox )
|
||||
/// Constructor
|
||||
CGroupEditBox(const TCtorParam ¶m);
|
||||
/// Dtor
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace NLGUI
|
|||
class CGroupFrame : public CInterfaceGroup
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupFrame )
|
||||
|
||||
/// Constructor
|
||||
CGroupFrame(const TCtorParam ¶m);
|
||||
|
|
|
@ -35,6 +35,8 @@ namespace NLGUI
|
|||
class CGroupHeader : public CGroupList
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupHeader )
|
||||
|
||||
REFLECT_EXPORT_START(CGroupHeader, CGroupList)
|
||||
REFLECT_LUA_METHOD("enlargeColumns", luaEnlargeColumns);
|
||||
REFLECT_LUA_METHOD("resizeColumnsAndContainer", luaResizeColumnsAndContainer);
|
||||
|
@ -67,6 +69,8 @@ namespace NLGUI
|
|||
class CGroupHeaderEntry : public CInterfaceGroup
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupHeaderEntry )
|
||||
|
||||
CGroupHeaderEntry(const TCtorParam ¶m);
|
||||
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
|
||||
// from CInterfaceGroup
|
||||
|
|
|
@ -54,6 +54,8 @@ namespace NLGUI
|
|||
class CGroupHTML : public CGroupScrollText
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupHTML )
|
||||
|
||||
friend void TextAdd (struct _HText *me, const char * buf, int len);
|
||||
friend void TextBeginElement (_HText *me, int element_number, const BOOL *present, const char ** value);
|
||||
friend void TextEndElement (_HText *me, int element_number);
|
||||
|
@ -658,6 +660,8 @@ namespace NLGUI
|
|||
class CGroupHTMLInputOffset : public CInterfaceGroup
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupHTMLInputOffset )
|
||||
|
||||
sint32 Offset;
|
||||
CGroupHTMLInputOffset(const TCtorParam ¶m);
|
||||
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
|
||||
|
|
|
@ -30,6 +30,8 @@ namespace NLGUI
|
|||
class CGroupList : public CInterfaceGroup
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupList )
|
||||
|
||||
enum EAlign
|
||||
{
|
||||
Bottom = 0,
|
||||
|
|
|
@ -42,6 +42,7 @@ namespace NLGUI
|
|||
class CViewTextMenu : public CViewText
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CViewTextMenu )
|
||||
|
||||
CViewTextMenu(const TCtorParam ¶m) : CViewText(param)
|
||||
{
|
||||
|
@ -97,6 +98,7 @@ namespace NLGUI
|
|||
class CGroupSubMenu : public CGroupSubMenuBase
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupSubMenu )
|
||||
|
||||
CGroupSubMenu(const TCtorParam ¶m);
|
||||
virtual ~CGroupSubMenu();
|
||||
|
@ -290,6 +292,7 @@ namespace NLGUI
|
|||
{
|
||||
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupMenu )
|
||||
|
||||
CGroupMenu(const TCtorParam ¶m);
|
||||
virtual ~CGroupMenu();
|
||||
|
|
|
@ -35,6 +35,8 @@ namespace NLGUI
|
|||
class CGroupModal : public CGroupFrame
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupModal )
|
||||
|
||||
bool SpawnOnMousePos : 1;
|
||||
bool ExitClickOut : 1;
|
||||
bool ExitClickL : 1;
|
||||
|
|
|
@ -31,6 +31,8 @@ namespace NLGUI
|
|||
class CCtrlLink : public CCtrlButton
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CCtrlLink )
|
||||
|
||||
CCtrlLink (const TCtorParam ¶m) : CCtrlButton(param)
|
||||
{}
|
||||
};
|
||||
|
@ -39,6 +41,8 @@ namespace NLGUI
|
|||
class CGroupParagraph : public CInterfaceGroup
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupParagraph )
|
||||
|
||||
enum EAlign
|
||||
{
|
||||
Bottom = 0,
|
||||
|
|
|
@ -39,6 +39,8 @@ namespace NLGUI
|
|||
class CGroupScrollText : public CInterfaceGroup
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupScrollText )
|
||||
|
||||
/// Constructor
|
||||
CGroupScrollText(const TCtorParam ¶m);
|
||||
~CGroupScrollText();
|
||||
|
|
|
@ -43,6 +43,7 @@ namespace NLGUI
|
|||
class CGroupTab : public CInterfaceGroup
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupTab )
|
||||
|
||||
/// Constructor
|
||||
CGroupTab(const TCtorParam ¶m);
|
||||
|
@ -153,6 +154,7 @@ namespace NLGUI
|
|||
class CCtrlTabButton : public CCtrlTextButton
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CCtrlTabButton )
|
||||
|
||||
CCtrlTabButton(const TCtorParam ¶m);
|
||||
|
||||
|
|
|
@ -36,6 +36,8 @@ namespace NLGUI
|
|||
{
|
||||
friend class CGroupTable;
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupCell )
|
||||
|
||||
CGroupCell(const TCtorParam ¶m);
|
||||
|
||||
enum TAlign
|
||||
|
@ -121,6 +123,7 @@ namespace NLGUI
|
|||
class CGroupTable : public CInterfaceGroup
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupTable )
|
||||
|
||||
///constructor
|
||||
CGroupTable(const TCtorParam ¶m);
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace NLGUI
|
|||
{
|
||||
|
||||
public:
|
||||
DECLARE_UI_CLASS( CGroupTree )
|
||||
|
||||
struct SNode;
|
||||
// optional callback that is called when a node has been added
|
||||
|
|
|
@ -28,6 +28,8 @@ namespace NLGUI
|
|||
class CInterfaceGroupWheel : public CInterfaceGroup
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CInterfaceGroupWheel )
|
||||
|
||||
/// Constructor
|
||||
CInterfaceGroupWheel(const TCtorParam ¶m);
|
||||
|
||||
|
|
|
@ -99,6 +99,8 @@ namespace NLGUI
|
|||
class CViewBitmapCombo : public CViewBase, public NLMISC::ICDBNode::IPropertyObserver
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CViewBitmapCombo )
|
||||
|
||||
typedef std::vector<sint32> TIdArray;
|
||||
typedef std::vector<std::string> TStringArray;
|
||||
typedef std::vector<NLMISC::CRGBA> TColorArray;
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace NLGUI
|
|||
class CViewLink : public CViewText
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CViewLink )
|
||||
|
||||
// Default constructor
|
||||
CViewLink (const TCtorParam ¶m);
|
||||
|
|
|
@ -36,7 +36,9 @@ namespace NLGUI
|
|||
class CViewPolygon : public CViewBase
|
||||
{
|
||||
public:
|
||||
CViewPolygon();
|
||||
DECLARE_UI_CLASS( CViewPolygon )
|
||||
|
||||
CViewPolygon( const TCtorParam ¶m );
|
||||
virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); }
|
||||
virtual void updateCoords();
|
||||
virtual void draw();
|
||||
|
|
|
@ -36,10 +36,12 @@ namespace NLGUI
|
|||
class CViewQuad : public CViewBase
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CViewQuad )
|
||||
|
||||
enum TWrapMode { Repeat = 0, Clamp, WrapModeCount };
|
||||
|
||||
|
||||
CViewQuad();
|
||||
CViewQuad( const TCtorParam ¶m );
|
||||
|
||||
// from CInterfaceElement
|
||||
bool parse(xmlNodePtr cur,CInterfaceGroup *parentGroup);
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace NLGUI
|
|||
class CViewTextFormated : public CViewText
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CViewTextFormated )
|
||||
|
||||
/// Interface for classes which can format the text for this view.
|
||||
class IViewTextFormatter
|
||||
|
|
|
@ -48,6 +48,7 @@ namespace NLGUI
|
|||
class CViewTextID : public CViewText
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CViewTextID )
|
||||
|
||||
/// Interface for classes which can provide text to CViewTextId
|
||||
class IViewTextProvider
|
||||
|
|
|
@ -36,6 +36,8 @@ namespace NLGUI
|
|||
class CViewTextIDFormated : public CViewTextID
|
||||
{
|
||||
public:
|
||||
DECLARE_UI_CLASS( CViewTextIDFormated )
|
||||
|
||||
CViewTextIDFormated(const TCtorParam ¶m) : CViewTextID(param)
|
||||
{}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace NLGUI
|
|||
{
|
||||
|
||||
// *********************************************************************************
|
||||
CCtrlPolygon::CCtrlPolygon() : CCtrlBase(TCtorParam())
|
||||
CCtrlPolygon::CCtrlPolygon( const TCtorParam ¶m ) : CCtrlBase( param )
|
||||
{
|
||||
// Construct
|
||||
_Color = CRGBA::White;
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace NLGUI
|
|||
{
|
||||
|
||||
// *********************************************************************************
|
||||
CCtrlQuad::CCtrlQuad() : CCtrlBase(TCtorParam()), _Color(CRGBA::White),
|
||||
CCtrlQuad::CCtrlQuad( const TCtorParam ¶m ) : CCtrlBase( param ), _Color(CRGBA::White),
|
||||
_Additif(false),
|
||||
_Filtered(true),
|
||||
_UMin(0.f),
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace NLGUI
|
|||
{
|
||||
|
||||
// *********************************************************************************
|
||||
CViewPolygon::CViewPolygon() : CViewBase(TCtorParam())
|
||||
CViewPolygon::CViewPolygon( const TCtorParam ¶m ) : CViewBase( param )
|
||||
{
|
||||
// Construct
|
||||
_Color = CRGBA::White;
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace NLGUI
|
|||
{
|
||||
|
||||
// *********************************************************************************
|
||||
CViewQuad::CViewQuad() : CViewBase(TCtorParam()), _Color(CRGBA::White),
|
||||
CViewQuad::CViewQuad( const TCtorParam ¶m ) : CViewBase( param ), _Color(CRGBA::White),
|
||||
_Additif(false),
|
||||
_UMin(0.f),
|
||||
_UMax(1.f),
|
||||
|
|
|
@ -82,13 +82,9 @@ namespace GUIEditor
|
|||
|
||||
currentElement = id;
|
||||
|
||||
std::string n;
|
||||
n = typeid( *e ).name();
|
||||
std::string::size_type i = n.find_last_of( ':' );
|
||||
if( i != std::string::npos )
|
||||
n = n.substr( i + 1, n.size() - 1 );
|
||||
std::string n = e->getClassName();
|
||||
|
||||
setupProperties( n, e );
|
||||
setupProperties( n, e );
|
||||
connect( propertyMgr, SIGNAL( propertyChanged( QtProperty* ) ),
|
||||
this, SLOT( onPropertyChanged( QtProperty* ) ) );
|
||||
}
|
||||
|
@ -163,4 +159,4 @@ namespace GUIEditor
|
|||
p->setValue( v );
|
||||
browser->addProperty( p );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue