Fusion avec default
This commit is contained in:
commit
22374fb124
256 changed files with 9581 additions and 2208 deletions
|
@ -71,11 +71,14 @@ SET(WINSDKENV_DIR $ENV{WINSDK_DIR})
|
||||||
MACRO(FIND_WINSDK_VERSION_HEADERS)
|
MACRO(FIND_WINSDK_VERSION_HEADERS)
|
||||||
IF(WINSDK_DIR AND NOT WINSDK_VERSION)
|
IF(WINSDK_DIR AND NOT WINSDK_VERSION)
|
||||||
# Search version in headers
|
# Search version in headers
|
||||||
IF(EXISTS ${WINSDK_DIR}/include/Msi.h)
|
FIND_FILE(_MSI_FILE Msi.h
|
||||||
SET(_MSI_FILE ${WINSDK_DIR}/include/Msi.h)
|
PATHS
|
||||||
ENDIF(EXISTS ${WINSDK_DIR}/include/Msi.h)
|
${WINSDK_DIR}/Include/um
|
||||||
|
${WINSDK_DIR}/Include
|
||||||
|
)
|
||||||
|
|
||||||
IF(_MSI_FILE)
|
IF(_MSI_FILE)
|
||||||
|
|
||||||
# Look for Windows SDK 8.0
|
# Look for Windows SDK 8.0
|
||||||
FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN8")
|
FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN8")
|
||||||
|
|
||||||
|
@ -88,11 +91,11 @@ MACRO(FIND_WINSDK_VERSION_HEADERS)
|
||||||
FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN7")
|
FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN7")
|
||||||
|
|
||||||
IF(_CONTENT)
|
IF(_CONTENT)
|
||||||
IF(EXISTS ${WINSDK_DIR}/include/winsdkver.h)
|
FIND_FILE(_WINSDKVER_FILE winsdkver.h WinSDKVer.h
|
||||||
SET(_WINSDKVER_FILE ${WINSDK_DIR}/include/winsdkver.h)
|
PATHS
|
||||||
ELSEIF(EXISTS ${WINSDK_DIR}/include/WinSDKVer.h)
|
${WINSDK_DIR}/Include/um
|
||||||
SET(_WINSDKVER_FILE ${WINSDK_DIR}/include/WinSDKVer.h)
|
${WINSDK_DIR}/Include
|
||||||
ENDIF(EXISTS ${WINSDK_DIR}/include/winsdkver.h)
|
)
|
||||||
|
|
||||||
IF(_WINSDKVER_FILE)
|
IF(_WINSDKVER_FILE)
|
||||||
# Load WinSDKVer.h content
|
# Load WinSDKVer.h content
|
||||||
|
@ -162,9 +165,13 @@ MACRO(USE_CURRENT_WINSDK)
|
||||||
SET(WINSDK_VERSION_FULL "")
|
SET(WINSDK_VERSION_FULL "")
|
||||||
|
|
||||||
# Use WINSDK environment variable
|
# Use WINSDK environment variable
|
||||||
IF(WINSDKENV_DIR AND EXISTS ${WINSDKENV_DIR}/include/Windows.h)
|
IF(WINSDKENV_DIR)
|
||||||
SET(WINSDK_DIR ${WINSDKENV_DIR})
|
FIND_PATH(WINSDK_DIR Windows.h
|
||||||
ENDIF(WINSDKENV_DIR AND EXISTS ${WINSDKENV_DIR}/include/Windows.h)
|
HINTS
|
||||||
|
${WINSDKENV_DIR}/Include/um
|
||||||
|
${WINSDKENV_DIR}/Include
|
||||||
|
)
|
||||||
|
ENDIF(WINSDKENV_DIR)
|
||||||
|
|
||||||
# Use INCLUDE environment variable
|
# Use INCLUDE environment variable
|
||||||
IF(NOT WINSDK_DIR AND WINSDKCURRENT_VERSION_INCLUDE)
|
IF(NOT WINSDK_DIR AND WINSDKCURRENT_VERSION_INCLUDE)
|
||||||
|
@ -173,8 +180,8 @@ MACRO(USE_CURRENT_WINSDK)
|
||||||
|
|
||||||
# Look for Windows.h because there are several paths
|
# Look for Windows.h because there are several paths
|
||||||
IF(EXISTS ${_INCLUDE}/Windows.h)
|
IF(EXISTS ${_INCLUDE}/Windows.h)
|
||||||
STRING(REGEX REPLACE "/(include|INCLUDE|Include)" "" WINSDK_DIR ${_INCLUDE})
|
STRING(REGEX REPLACE "/(include|INCLUDE|Include)(.*)" "" WINSDK_DIR ${_INCLUDE})
|
||||||
MESSAGE(STATUS "Found Windows SDK environment variable in ${WINSDK_DIR}")
|
MESSAGE(STATUS "Found Windows SDK from include environment variable in ${WINSDK_DIR}")
|
||||||
BREAK()
|
BREAK()
|
||||||
ENDIF(EXISTS ${_INCLUDE}/Windows.h)
|
ENDIF(EXISTS ${_INCLUDE}/Windows.h)
|
||||||
ENDFOREACH(_INCLUDE)
|
ENDFOREACH(_INCLUDE)
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
{
|
{
|
||||||
StereoDisplay,
|
StereoDisplay,
|
||||||
StereoHMD,
|
StereoHMD,
|
||||||
|
StereoNGHMD,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TStereoDeviceLibrary
|
enum TStereoDeviceLibrary
|
||||||
|
|
62
code/nel/include/nel/3d/stereo_ng_hmd.h
Normal file
62
code/nel/include/nel/3d/stereo_ng_hmd.h
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
/**
|
||||||
|
* \file stereo_ng_hmd.h
|
||||||
|
* \brief IStereoNGHMD
|
||||||
|
* \date 2014-04-01 10:53GMT
|
||||||
|
* \author Jan Boon (Kaetemi)
|
||||||
|
* IStereoNGHMD
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2014 by authors
|
||||||
|
*
|
||||||
|
* This file is part of NL3D.
|
||||||
|
* NL3D 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.
|
||||||
|
*
|
||||||
|
* NL3D 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 NL3D. If not, see
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NL3D_STEREO_NG_HMD_H
|
||||||
|
#define NL3D_STEREO_NG_HMD_H
|
||||||
|
#include <nel/misc/types_nl.h>
|
||||||
|
|
||||||
|
// STL includes
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include <nel/3d/stereo_hmd.h>
|
||||||
|
|
||||||
|
namespace NL3D {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief IStereoNGHMD
|
||||||
|
* \date 2014-04-01 10:53GMT
|
||||||
|
* \author Jan Boon (Kaetemi)
|
||||||
|
* IStereoNGHMD
|
||||||
|
*/
|
||||||
|
class IStereoNGHMD : public IStereoHMD
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IStereoNGHMD();
|
||||||
|
virtual ~IStereoNGHMD();
|
||||||
|
|
||||||
|
/// Kill the player
|
||||||
|
virtual void killUser() const = 0;
|
||||||
|
|
||||||
|
}; /* class IStereoNGHMD */
|
||||||
|
|
||||||
|
} /* namespace NL3D */
|
||||||
|
|
||||||
|
#endif /* #ifndef NL3D_STEREO_NG_HMD_H */
|
||||||
|
|
||||||
|
/* end of file */
|
|
@ -68,9 +68,7 @@ namespace NLGUI
|
||||||
// special parse
|
// special parse
|
||||||
virtual bool parse(xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
virtual bool parse(xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
||||||
|
|
||||||
|
bool handleEvent (const NLGUI::CEventDescriptor &event);
|
||||||
/// Handle all events (implemented by derived classes) (return true to signal event handled)
|
|
||||||
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
|
|
||||||
|
|
||||||
virtual CCtrlBase *getSubCtrl (sint32 /* x */, sint32 /* y */) { return this; }
|
virtual CCtrlBase *getSubCtrl (sint32 /* x */, sint32 /* y */) { return this; }
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ namespace NLGUI
|
||||||
|
|
||||||
/// Constructor
|
/// Constructor
|
||||||
CCtrlTextButton(const TCtorParam ¶m);
|
CCtrlTextButton(const TCtorParam ¶m);
|
||||||
|
~CCtrlTextButton();
|
||||||
|
|
||||||
std::string getProperty( const std::string &name ) const;
|
std::string getProperty( const std::string &name ) const;
|
||||||
void setProperty( const std::string &name, const std::string &value );
|
void setProperty( const std::string &name, const std::string &value );
|
||||||
|
@ -123,6 +124,9 @@ namespace NLGUI
|
||||||
REFLECT_LUA_METHOD("getViewText", luaGetViewText)
|
REFLECT_LUA_METHOD("getViewText", luaGetViewText)
|
||||||
REFLECT_EXPORT_END
|
REFLECT_EXPORT_END
|
||||||
|
|
||||||
|
void onRemoved();
|
||||||
|
void onWidgetDeleted( CInterfaceElement *e );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
enum {NumTexture= 3};
|
enum {NumTexture= 3};
|
||||||
|
|
30
code/nel/include/nel/gui/editor_selection_watcher.h
Normal file
30
code/nel/include/nel/gui/editor_selection_watcher.h
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace NLGUI
|
||||||
|
{
|
||||||
|
/// Watches the currently selected GUI widget
|
||||||
|
class IEditorSelectionWatcher
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/// Notifies the watcher about the change
|
||||||
|
virtual void selectionChanged( std::string &newSelection ) = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -70,6 +70,14 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/// Watches CInterfaceElement deletions
|
||||||
|
class IDeletionWatcher
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IDeletionWatcher(){}
|
||||||
|
virtual ~IDeletionWatcher(){}
|
||||||
|
virtual void onDeleted( const std::string &name ){}
|
||||||
|
};
|
||||||
|
|
||||||
enum EStrech
|
enum EStrech
|
||||||
{
|
{
|
||||||
|
@ -424,6 +432,8 @@ namespace NLGUI
|
||||||
|
|
||||||
void drawHotSpot(THotSpot hs, NLMISC::CRGBA col);
|
void drawHotSpot(THotSpot hs, NLMISC::CRGBA col);
|
||||||
|
|
||||||
|
void drawHighlight();
|
||||||
|
|
||||||
// Returns 'true' if that element can be downcasted to a view
|
// Returns 'true' if that element can be downcasted to a view
|
||||||
virtual bool isView() const { return false; }
|
virtual bool isView() const { return false; }
|
||||||
|
|
||||||
|
@ -473,6 +483,7 @@ namespace NLGUI
|
||||||
bool isInGroup( CInterfaceGroup *group );
|
bool isInGroup( CInterfaceGroup *group );
|
||||||
|
|
||||||
static void setEditorMode( bool b ){ editorMode = b; }
|
static void setEditorMode( bool b ){ editorMode = b; }
|
||||||
|
static bool getEditorMode(){ return editorMode; }
|
||||||
|
|
||||||
void setEditorSelected( bool b ){ editorSelected = b; }
|
void setEditorSelected( bool b ){ editorSelected = b; }
|
||||||
bool isEditorSelected() const{ return editorSelected; }
|
bool isEditorSelected() const{ return editorSelected; }
|
||||||
|
@ -483,6 +494,19 @@ namespace NLGUI
|
||||||
void setSerializable( bool b ){ serializable = b; }
|
void setSerializable( bool b ){ serializable = b; }
|
||||||
bool IsSerializable() const{ return serializable; }
|
bool IsSerializable() const{ return serializable; }
|
||||||
|
|
||||||
|
/// Called when the widget is removed from it's parent group
|
||||||
|
virtual void onRemoved(){}
|
||||||
|
|
||||||
|
/// Registers a deletion watcher
|
||||||
|
static void registerDeletionWatcher( IDeletionWatcher *watcher );
|
||||||
|
|
||||||
|
/// Unregisters a deletion watcher
|
||||||
|
static void unregisterDeletionWatcher( IDeletionWatcher *watcher );
|
||||||
|
|
||||||
|
/// Called when the widget is deleted,
|
||||||
|
/// so other widgets in the group can check if it belongs to them
|
||||||
|
virtual void onWidgetDeleted( CInterfaceElement *e ){}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
bool editorSelected;
|
bool editorSelected;
|
||||||
|
@ -543,6 +567,11 @@ namespace NLGUI
|
||||||
void parseSizeRef(const char *sizeRefStr, sint32 &sizeref, sint32 &sizeDivW, sint32 &sizeDivH);
|
void parseSizeRef(const char *sizeRefStr, sint32 &sizeref, sint32 &sizeDivW, sint32 &sizeDivH);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// Notifies the deletion watchers that this interface element is being deleted
|
||||||
|
void notifyDeletionWatchers();
|
||||||
|
|
||||||
|
static std::vector< IDeletionWatcher* > deletionWatchers;
|
||||||
|
|
||||||
//void snapSize();
|
//void snapSize();
|
||||||
bool serializable;
|
bool serializable;
|
||||||
|
|
||||||
|
|
|
@ -322,6 +322,8 @@ namespace NLGUI
|
||||||
// Return the current Depth, with no ZBias applied.
|
// Return the current Depth, with no ZBias applied.
|
||||||
float getDepthForZSort() const { return _DepthForZSort; }
|
float getDepthForZSort() const { return _DepthForZSort; }
|
||||||
|
|
||||||
|
void onWidgetDeleted( CInterfaceElement *e );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void makeNewClip (sint32 &oldClipX, sint32 &oldClipY, sint32 &oldClipW, sint32 &oldClipH);
|
void makeNewClip (sint32 &oldClipX, sint32 &oldClipY, sint32 &oldClipW, sint32 &oldClipH);
|
||||||
|
|
|
@ -382,6 +382,7 @@ namespace NLGUI
|
||||||
bool serializeProcs( xmlNodePtr parentNode ) const;
|
bool serializeProcs( xmlNodePtr parentNode ) const;
|
||||||
bool serializePointerSettings( xmlNodePtr parentNode ) const;
|
bool serializePointerSettings( xmlNodePtr parentNode ) const;
|
||||||
bool serializeKeySettings( xmlNodePtr parentNode ) const;
|
bool serializeKeySettings( xmlNodePtr parentNode ) const;
|
||||||
|
CViewBase* createClass( const std::string &name );
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
namespace NLGUI
|
namespace NLGUI
|
||||||
{
|
{
|
||||||
class CInterfaceElement;
|
class CInterfaceElement;
|
||||||
|
class CViewBase;
|
||||||
class CInterfaceGroup;
|
class CInterfaceGroup;
|
||||||
class CInterfaceAnim;
|
class CInterfaceAnim;
|
||||||
class CCtrlSheetSelection;
|
class CCtrlSheetSelection;
|
||||||
|
@ -86,6 +87,7 @@ namespace NLGUI
|
||||||
virtual bool serializeProcs( xmlNodePtr parentNode ) const = 0;
|
virtual bool serializeProcs( xmlNodePtr parentNode ) const = 0;
|
||||||
virtual bool serializePointerSettings( xmlNodePtr parentNode ) const = 0;
|
virtual bool serializePointerSettings( xmlNodePtr parentNode ) const = 0;
|
||||||
virtual bool serializeKeySettings( xmlNodePtr parentNode ) const = 0;
|
virtual bool serializeKeySettings( xmlNodePtr parentNode ) const = 0;
|
||||||
|
virtual CViewBase* createClass( const std::string &name ) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
namespace NLGUI
|
namespace NLGUI
|
||||||
{
|
{
|
||||||
|
class CEventDescriptor;
|
||||||
|
|
||||||
class CViewBase : public CInterfaceElement
|
class CViewBase : public CInterfaceElement
|
||||||
{
|
{
|
||||||
|
@ -77,6 +78,9 @@ namespace NLGUI
|
||||||
// special for mouse over : return true and fill the name of the cursor to display
|
// special for mouse over : return true and fill the name of the cursor to display
|
||||||
virtual bool getMouseOverShape(std::string &/* texName */, uint8 &/* rot */, NLMISC::CRGBA &/* col */) { return false; }
|
virtual bool getMouseOverShape(std::string &/* texName */, uint8 &/* rot */, NLMISC::CRGBA &/* col */) { return false; }
|
||||||
|
|
||||||
|
/// Handle all events (implemented by derived classes) (return true to signal event handled)
|
||||||
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &evnt);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
32
code/nel/include/nel/gui/widget_addition_watcher.h
Normal file
32
code/nel/include/nel/gui/widget_addition_watcher.h
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#ifndef WIDGET_ADD_WATCHER
|
||||||
|
#define WIDGET_ADD_WATCHER
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace NLGUI
|
||||||
|
{
|
||||||
|
class IWidgetAdditionWatcher
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void widgetAdded( const std::string &name ) = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -47,6 +47,8 @@ namespace NLGUI
|
||||||
class CInterfaceOptions;
|
class CInterfaceOptions;
|
||||||
class CInterfaceAnim;
|
class CInterfaceAnim;
|
||||||
class CProcedure;
|
class CProcedure;
|
||||||
|
class IEditorSelectionWatcher;
|
||||||
|
class IWidgetAdditionWatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
GUI Widget Manager
|
GUI Widget Manager
|
||||||
|
@ -341,6 +343,7 @@ namespace NLGUI
|
||||||
/**
|
/**
|
||||||
* Capture
|
* Capture
|
||||||
*/
|
*/
|
||||||
|
CViewBase *getCapturedView(){ return _CapturedView; }
|
||||||
CCtrlBase *getCapturePointerLeft() { return _CapturePointerLeft; }
|
CCtrlBase *getCapturePointerLeft() { return _CapturePointerLeft; }
|
||||||
CCtrlBase *getCapturePointerRight() { return _CapturePointerRight; }
|
CCtrlBase *getCapturePointerRight() { return _CapturePointerRight; }
|
||||||
CCtrlBase *getCaptureKeyboard() { return _CaptureKeyboard; }
|
CCtrlBase *getCaptureKeyboard() { return _CaptureKeyboard; }
|
||||||
|
@ -484,7 +487,17 @@ namespace NLGUI
|
||||||
|
|
||||||
IParser* getParser() const{ return parser; }
|
IParser* getParser() const{ return parser; }
|
||||||
|
|
||||||
|
std::string& getCurrentEditorSelection(){ return currentEditorSelection; }
|
||||||
void setCurrentEditorSelection( const std::string &name );
|
void setCurrentEditorSelection( const std::string &name );
|
||||||
|
void notifySelectionWatchers();
|
||||||
|
void registerSelectionWatcher( IEditorSelectionWatcher *watcher );
|
||||||
|
void unregisterSelectionWatcher( IEditorSelectionWatcher *watcher );
|
||||||
|
|
||||||
|
void notifyAdditionWatchers( const std::string &widgetName );
|
||||||
|
void registerAdditionWatcher( IWidgetAdditionWatcher *watcher );
|
||||||
|
void unregisterAdditionWatcher( IWidgetAdditionWatcher *watcher );
|
||||||
|
|
||||||
|
CInterfaceElement* addWidgetToGroup( std::string &group, std::string &widgetClass, std::string &widgetName );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CWidgetManager();
|
CWidgetManager();
|
||||||
|
@ -511,6 +524,8 @@ namespace NLGUI
|
||||||
NLMISC::CRefPtr<CCtrlBase> _CapturePointerLeft;
|
NLMISC::CRefPtr<CCtrlBase> _CapturePointerLeft;
|
||||||
NLMISC::CRefPtr<CCtrlBase> _CapturePointerRight;
|
NLMISC::CRefPtr<CCtrlBase> _CapturePointerRight;
|
||||||
|
|
||||||
|
NLMISC::CRefPtr< CViewBase > _CapturedView;
|
||||||
|
|
||||||
// What is under pointer
|
// What is under pointer
|
||||||
std::vector< CViewBase* > _ViewsUnderPointer;
|
std::vector< CViewBase* > _ViewsUnderPointer;
|
||||||
std::vector< CCtrlBase* > _CtrlsUnderPointer;
|
std::vector< CCtrlBase* > _CtrlsUnderPointer;
|
||||||
|
@ -567,6 +582,9 @@ namespace NLGUI
|
||||||
|
|
||||||
std::vector< INewScreenSizeHandler* > newScreenSizeHandlers;
|
std::vector< INewScreenSizeHandler* > newScreenSizeHandlers;
|
||||||
std::vector< IOnWidgetsDrawnHandler* > onWidgetsDrawnHandlers;
|
std::vector< IOnWidgetsDrawnHandler* > onWidgetsDrawnHandlers;
|
||||||
|
std::vector< IEditorSelectionWatcher* > selectionWatchers;
|
||||||
|
std::vector< IWidgetAdditionWatcher* > additionWatchers;
|
||||||
|
|
||||||
|
|
||||||
std::string currentEditorSelection;
|
std::string currentEditorSelection;
|
||||||
};
|
};
|
||||||
|
|
|
@ -697,6 +697,8 @@ SOURCE_GROUP(Stereo FILES
|
||||||
../../include/nel/3d/stereo_display.h
|
../../include/nel/3d/stereo_display.h
|
||||||
stereo_hmd.cpp
|
stereo_hmd.cpp
|
||||||
../../include/nel/3d/stereo_hmd.h
|
../../include/nel/3d/stereo_hmd.h
|
||||||
|
stereo_ng_hmd.cpp
|
||||||
|
../../include/nel/3d/stereo_ng_hmd.h
|
||||||
stereo_ovr.cpp
|
stereo_ovr.cpp
|
||||||
stereo_ovr_fp.cpp
|
stereo_ovr_fp.cpp
|
||||||
../../include/nel/3d/stereo_ovr.h
|
../../include/nel/3d/stereo_ovr.h
|
||||||
|
|
|
@ -791,17 +791,20 @@ void CMeshMultiLod::compileCoarseMeshes()
|
||||||
{
|
{
|
||||||
slotRef.CoarseTriangles.resize(slotRef.CoarseNumTris * 3);
|
slotRef.CoarseTriangles.resize(slotRef.CoarseNumTris * 3);
|
||||||
TCoarseMeshIndexType *dstPtr= &slotRef.CoarseTriangles[0];
|
TCoarseMeshIndexType *dstPtr= &slotRef.CoarseTriangles[0];
|
||||||
|
uint totalTris = 0;
|
||||||
for(uint i=0;i<meshGeom->getNbRdrPass(0);i++)
|
for(uint i=0;i<meshGeom->getNbRdrPass(0);i++)
|
||||||
{
|
{
|
||||||
const CIndexBuffer &pb= meshGeom->getRdrPassPrimitiveBlock(0, i);
|
const CIndexBuffer &pb= meshGeom->getRdrPassPrimitiveBlock(0, i);
|
||||||
CIndexBufferRead ibaRead;
|
CIndexBufferRead ibaRead;
|
||||||
pb.lock (ibaRead);
|
pb.lock (ibaRead);
|
||||||
uint numTris= pb.getNumIndexes()/3;
|
uint numTris= pb.getNumIndexes()/3;
|
||||||
|
totalTris += numTris;
|
||||||
if (pb.getFormat() == CIndexBuffer::Indices16)
|
if (pb.getFormat() == CIndexBuffer::Indices16)
|
||||||
{
|
{
|
||||||
if (sizeof(TCoarseMeshIndexType) == sizeof(uint16))
|
if (sizeof(TCoarseMeshIndexType) == sizeof(uint16))
|
||||||
{
|
{
|
||||||
memcpy(dstPtr, (uint16 *) ibaRead.getPtr(), numTris*3*sizeof(uint16));
|
memcpy(dstPtr, (uint16 *) ibaRead.getPtr(), numTris*3*sizeof(uint16));
|
||||||
|
dstPtr+= numTris*3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -820,6 +823,7 @@ void CMeshMultiLod::compileCoarseMeshes()
|
||||||
if (sizeof(TCoarseMeshIndexType) == sizeof(uint32))
|
if (sizeof(TCoarseMeshIndexType) == sizeof(uint32))
|
||||||
{
|
{
|
||||||
memcpy(dstPtr, (uint32 *) ibaRead.getPtr(), numTris*3*sizeof(uint32));
|
memcpy(dstPtr, (uint32 *) ibaRead.getPtr(), numTris*3*sizeof(uint32));
|
||||||
|
dstPtr+= numTris*3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -836,8 +840,8 @@ void CMeshMultiLod::compileCoarseMeshes()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dstPtr+= numTris*3;
|
|
||||||
}
|
}
|
||||||
|
nlassert(totalTris == slotRef.CoarseNumTris);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
55
code/nel/src/3d/stereo_ng_hmd.cpp
Normal file
55
code/nel/src/3d/stereo_ng_hmd.cpp
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
/**
|
||||||
|
* \file stereo_hmd.cpp
|
||||||
|
* \brief IStereoNGHMD
|
||||||
|
* \date 2014-04-01 10:53GMT
|
||||||
|
* \author Jan Boon (Kaetemi)
|
||||||
|
* IStereoNGHMD
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2014 by authors
|
||||||
|
*
|
||||||
|
* This file is part of NL3D.
|
||||||
|
* NL3D 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.
|
||||||
|
*
|
||||||
|
* NL3D 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 NL3D. If not, see
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <nel/misc/types_nl.h>
|
||||||
|
#include <nel/3d/stereo_ng_hmd.h>
|
||||||
|
|
||||||
|
// STL includes
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
// #include <nel/misc/debug.h>
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
// using namespace NLMISC;
|
||||||
|
|
||||||
|
namespace NL3D {
|
||||||
|
|
||||||
|
IStereoNGHMD::IStereoNGHMD()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
IStereoNGHMD::~IStereoNGHMD()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace NL3D */
|
||||||
|
|
||||||
|
/* end of file */
|
|
@ -39,6 +39,9 @@ namespace NLGUI
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
bool CCtrlBase::handleEvent(const NLGUI::CEventDescriptor &event)
|
bool CCtrlBase::handleEvent(const NLGUI::CEventDescriptor &event)
|
||||||
{
|
{
|
||||||
|
if( CViewBase::handleEvent( event ) )
|
||||||
|
return true;
|
||||||
|
|
||||||
if (event.getType() == NLGUI::CEventDescriptor::system)
|
if (event.getType() == NLGUI::CEventDescriptor::system)
|
||||||
{
|
{
|
||||||
NLGUI::CEventDescriptorSystem &eds = (NLGUI::CEventDescriptorSystem&)event;
|
NLGUI::CEventDescriptorSystem &eds = (NLGUI::CEventDescriptorSystem&)event;
|
||||||
|
|
|
@ -669,12 +669,6 @@ namespace NLGUI
|
||||||
if (CWidgetManager::getInstance()->getCapturePointerLeft() != this)
|
if (CWidgetManager::getInstance()->getCapturePointerLeft() != this)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( editorMode )
|
|
||||||
{
|
|
||||||
CWidgetManager::getInstance()->setCurrentEditorSelection( getId() );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_LeftDblClickHandled) // no effect on mouse up after double click has been handled
|
if (_LeftDblClickHandled) // no effect on mouse up after double click has been handled
|
||||||
{
|
{
|
||||||
_LeftDblClickHandled = false;
|
_LeftDblClickHandled = false;
|
||||||
|
|
|
@ -356,7 +356,7 @@ namespace NLGUI
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ( ( _Over && !editorMode ) || editorSelected )
|
if ( ( _Over && !editorMode ) )
|
||||||
{
|
{
|
||||||
|
|
||||||
if( !editorMode && (lastOver == false) && (_AHOnOver != NULL))
|
if( !editorMode && (lastOver == false) && (_AHOnOver != NULL))
|
||||||
|
|
|
@ -62,6 +62,17 @@ namespace NLGUI
|
||||||
_ForceTextOver = false;
|
_ForceTextOver = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CCtrlTextButton::~CCtrlTextButton()
|
||||||
|
{
|
||||||
|
if( _ViewText != NULL )
|
||||||
|
{
|
||||||
|
if( _Parent != NULL )
|
||||||
|
_Parent->delView( _ViewText, true );
|
||||||
|
delete _ViewText;
|
||||||
|
_ViewText = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string CCtrlTextButton::getProperty( const std::string &name ) const
|
std::string CCtrlTextButton::getProperty( const std::string &name ) const
|
||||||
{
|
{
|
||||||
std::string prop;
|
std::string prop;
|
||||||
|
@ -113,7 +124,10 @@ namespace NLGUI
|
||||||
else
|
else
|
||||||
if( name == "hardtext" )
|
if( name == "hardtext" )
|
||||||
{
|
{
|
||||||
return _ViewText->getText().toString();
|
if( _ViewText != NULL )
|
||||||
|
return _ViewText->getText().toString();
|
||||||
|
else
|
||||||
|
return std::string( "" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if( name == "text_y" )
|
if( name == "text_y" )
|
||||||
|
@ -128,7 +142,10 @@ namespace NLGUI
|
||||||
else
|
else
|
||||||
if( name == "text_underlined" )
|
if( name == "text_underlined" )
|
||||||
{
|
{
|
||||||
return toString( _ViewText->getUnderlined() );
|
if( _ViewText != NULL )
|
||||||
|
return toString( _ViewText->getUnderlined() );
|
||||||
|
else
|
||||||
|
return std::string( "" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if( name == "text_posref" )
|
if( name == "text_posref" )
|
||||||
|
@ -220,6 +237,11 @@ namespace NLGUI
|
||||||
_TextureIdNormal[ 0 ].setTexture( std::string( value + "_l.tga" ).c_str() );
|
_TextureIdNormal[ 0 ].setTexture( std::string( value + "_l.tga" ).c_str() );
|
||||||
_TextureIdNormal[ 1 ].setTexture( std::string( value + "_m.tga" ).c_str() );
|
_TextureIdNormal[ 1 ].setTexture( std::string( value + "_m.tga" ).c_str() );
|
||||||
_TextureIdNormal[ 2 ].setTexture( std::string( value + "_r.tga" ).c_str() );
|
_TextureIdNormal[ 2 ].setTexture( std::string( value + "_r.tga" ).c_str() );
|
||||||
|
|
||||||
|
CViewRenderer &rVR = *CViewRenderer::getInstance();
|
||||||
|
rVR.getTextureSizeFromId(_TextureIdNormal[0], _BmpLeftW, _BmpH);
|
||||||
|
rVR.getTextureSizeFromId(_TextureIdNormal[1], _BmpMiddleW, _BmpH);
|
||||||
|
rVR.getTextureSizeFromId(_TextureIdNormal[2], _BmpRightW, _BmpH);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -269,7 +291,8 @@ namespace NLGUI
|
||||||
else
|
else
|
||||||
if( name == "hardtext" )
|
if( name == "hardtext" )
|
||||||
{
|
{
|
||||||
_ViewText->setText( value );
|
if( _ViewText != NULL )
|
||||||
|
_ViewText->setText( value );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -292,8 +315,10 @@ namespace NLGUI
|
||||||
if( name == "text_underlined" )
|
if( name == "text_underlined" )
|
||||||
{
|
{
|
||||||
bool b;
|
bool b;
|
||||||
if( fromString( value, b ) )
|
if( _ViewText != NULL )
|
||||||
_ViewText->setUnderlined( b );
|
if( fromString( value, b ) )
|
||||||
|
_ViewText->setUnderlined( b );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -766,8 +791,7 @@ namespace NLGUI
|
||||||
CCtrlBase *capturePointerLeft = CWidgetManager::getInstance()->getCapturePointerLeft();
|
CCtrlBase *capturePointerLeft = CWidgetManager::getInstance()->getCapturePointerLeft();
|
||||||
|
|
||||||
// *** Draw Over
|
// *** Draw Over
|
||||||
if( editorSelected ||
|
if( ( !editorMode && _Over && (_OverWhenPushed || !(_Pushed || capturePointerLeft == this ) ) )
|
||||||
( !editorMode && _Over && (_OverWhenPushed || !(_Pushed || capturePointerLeft == this ) ) )
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if( !editorMode && (lastOver == false) && (_AHOnOver != NULL) )
|
if( !editorMode && (lastOver == false) && (_AHOnOver != NULL) )
|
||||||
|
@ -803,32 +827,35 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Setup ViewText color
|
// Setup ViewText color
|
||||||
if ( pTxId==_TextureIdNormal || editorMode )
|
if( _ViewText != NULL )
|
||||||
{
|
{
|
||||||
if(_TextHeaderColor) viewTextColor.A= _TextColorNormal.A;
|
if ( pTxId==_TextureIdNormal || editorMode )
|
||||||
else viewTextColor= _TextColorNormal;
|
{
|
||||||
_ViewText->setColor(viewTextColor);
|
if(_TextHeaderColor) viewTextColor.A= _TextColorNormal.A;
|
||||||
_ViewText->setShadowColor(_TextShadowColorNormal);
|
else viewTextColor= _TextColorNormal;
|
||||||
_ViewText->setModulateGlobalColor(_TextModulateGlobalColorNormal);
|
_ViewText->setColor(viewTextColor);
|
||||||
|
_ViewText->setShadowColor(_TextShadowColorNormal);
|
||||||
|
_ViewText->setModulateGlobalColor(_TextModulateGlobalColorNormal);
|
||||||
|
}
|
||||||
|
else if ( pTxId==_TextureIdPushed )
|
||||||
|
{
|
||||||
|
if(_TextHeaderColor) viewTextColor.A= _TextColorPushed.A;
|
||||||
|
else viewTextColor= _TextColorPushed;
|
||||||
|
_ViewText->setColor(viewTextColor);
|
||||||
|
_ViewText->setShadowColor(_TextShadowColorPushed);
|
||||||
|
_ViewText->setModulateGlobalColor(_TextModulateGlobalColorPushed);
|
||||||
|
}
|
||||||
|
else if ( pTxId==_TextureIdOver )
|
||||||
|
{
|
||||||
|
if(_TextHeaderColor) viewTextColor.A= _TextColorOver.A;
|
||||||
|
else viewTextColor= _TextColorOver;
|
||||||
|
_ViewText->setColor(viewTextColor);
|
||||||
|
_ViewText->setShadowColor(_TextShadowColorOver);
|
||||||
|
_ViewText->setModulateGlobalColor(_TextModulateGlobalColorOver);
|
||||||
|
}
|
||||||
|
if(getFrozen() && getFrozenHalfTone())
|
||||||
|
_ViewText->setAlpha(_ViewText->getAlpha()>>2);
|
||||||
}
|
}
|
||||||
else if ( pTxId==_TextureIdPushed )
|
|
||||||
{
|
|
||||||
if(_TextHeaderColor) viewTextColor.A= _TextColorPushed.A;
|
|
||||||
else viewTextColor= _TextColorPushed;
|
|
||||||
_ViewText->setColor(viewTextColor);
|
|
||||||
_ViewText->setShadowColor(_TextShadowColorPushed);
|
|
||||||
_ViewText->setModulateGlobalColor(_TextModulateGlobalColorPushed);
|
|
||||||
}
|
|
||||||
else if ( pTxId==_TextureIdOver )
|
|
||||||
{
|
|
||||||
if(_TextHeaderColor) viewTextColor.A= _TextColorOver.A;
|
|
||||||
else viewTextColor= _TextColorOver;
|
|
||||||
_ViewText->setColor(viewTextColor);
|
|
||||||
_ViewText->setShadowColor(_TextShadowColorOver);
|
|
||||||
_ViewText->setModulateGlobalColor(_TextModulateGlobalColorOver);
|
|
||||||
}
|
|
||||||
if(getFrozen() && getFrozenHalfTone())
|
|
||||||
_ViewText->setAlpha(_ViewText->getAlpha()>>2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -864,6 +891,16 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
_Setuped= true;
|
_Setuped= true;
|
||||||
|
|
||||||
|
if( _ViewText == NULL )
|
||||||
|
{
|
||||||
|
CViewBase *v = CWidgetManager::getInstance()->getParser()->createClass( "text" );
|
||||||
|
nlassert( v != NULL );
|
||||||
|
_ViewText = dynamic_cast< CViewText* >( v );
|
||||||
|
_ViewText->setId( _Id + "_text" );
|
||||||
|
_ViewText->setText( ucstring( "text" ) );
|
||||||
|
_ViewText->setSerializable( false );
|
||||||
|
}
|
||||||
|
|
||||||
// setup the viewText and add to parent
|
// setup the viewText and add to parent
|
||||||
_ViewText->setParent (getParent());
|
_ViewText->setParent (getParent());
|
||||||
_ViewText->setParentPos (this);
|
_ViewText->setParentPos (this);
|
||||||
|
@ -960,6 +997,19 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
|
void CCtrlTextButton::onRemoved()
|
||||||
|
{
|
||||||
|
if( _ViewText != NULL )
|
||||||
|
{
|
||||||
|
if( _Parent != NULL )
|
||||||
|
_Parent->delView( _ViewText, true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCtrlTextButton::onWidgetDeleted( CInterfaceElement *e )
|
||||||
|
{
|
||||||
|
if( e == _ViewText )
|
||||||
|
_ViewText = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1417,7 +1417,8 @@ namespace NLGUI
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
void CGroupEditBox::checkCoords()
|
void CGroupEditBox::checkCoords()
|
||||||
{
|
{
|
||||||
setupDisplayText();
|
if( !editorMode )
|
||||||
|
setupDisplayText();
|
||||||
|
|
||||||
CInterfaceGroup::checkCoords();
|
CInterfaceGroup::checkCoords();
|
||||||
}
|
}
|
||||||
|
@ -1536,7 +1537,29 @@ namespace NLGUI
|
||||||
_ViewText = dynamic_cast<CViewText *>(CInterfaceGroup::getView("edit_text"));
|
_ViewText = dynamic_cast<CViewText *>(CInterfaceGroup::getView("edit_text"));
|
||||||
|
|
||||||
if(_ViewText == NULL)
|
if(_ViewText == NULL)
|
||||||
|
{
|
||||||
nlwarning("Interface: CGroupEditBox: text 'edit_text' missing or bad type");
|
nlwarning("Interface: CGroupEditBox: text 'edit_text' missing or bad type");
|
||||||
|
if( editorMode )
|
||||||
|
{
|
||||||
|
nlwarning( "Trying to create a new 'edit_text' for %s", getId().c_str() );
|
||||||
|
_ViewText = dynamic_cast< CViewText* >( CWidgetManager::getInstance()->getParser()->createClass( "text" ) );
|
||||||
|
if( _ViewText != NULL )
|
||||||
|
{
|
||||||
|
_ViewText->setParent( this );
|
||||||
|
_ViewText->setIdRecurse( "edit_text" );
|
||||||
|
_ViewText->setHardText( "sometext" );
|
||||||
|
_ViewText->setPosRef( Hotspot_TL );
|
||||||
|
_ViewText->setParentPosRef( Hotspot_TL );
|
||||||
|
addView( _ViewText );
|
||||||
|
|
||||||
|
setH( _ViewText->getFontHeight() );
|
||||||
|
setW( _ViewText->getFontWidth() * _ViewText->getText().size() );
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
nlwarning( "Failed to create new 'edit_text' for %s", getId().c_str() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// For MultiLine editbox, clip the end space, else weird when edit space at end of line (nothing happens)
|
// For MultiLine editbox, clip the end space, else weird when edit space at end of line (nothing happens)
|
||||||
if(_ViewText)
|
if(_ViewText)
|
||||||
|
|
|
@ -34,6 +34,7 @@ using namespace NLMISC;
|
||||||
namespace NLGUI
|
namespace NLGUI
|
||||||
{
|
{
|
||||||
bool CInterfaceElement::editorMode = false;
|
bool CInterfaceElement::editorMode = false;
|
||||||
|
std::vector< CInterfaceElement::IDeletionWatcher* > CInterfaceElement::deletionWatchers;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
CInterfaceElement::~CInterfaceElement()
|
CInterfaceElement::~CInterfaceElement()
|
||||||
|
@ -46,6 +47,13 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
delete _Links;
|
delete _Links;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( editorMode )
|
||||||
|
{
|
||||||
|
notifyDeletionWatchers();
|
||||||
|
if( _Parent != NULL )
|
||||||
|
_Parent->onWidgetDeleted( this );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -1295,6 +1303,11 @@ namespace NLGUI
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CInterfaceElement::drawHighlight()
|
||||||
|
{
|
||||||
|
CViewRenderer::getInstance()->drawWiredQuad( _XReal, _YReal, _WReal, _HReal );
|
||||||
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CInterfaceElement::invalidateContent()
|
void CInterfaceElement::invalidateContent()
|
||||||
{
|
{
|
||||||
|
@ -1541,6 +1554,36 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CInterfaceElement::registerDeletionWatcher( IDeletionWatcher *watcher )
|
||||||
|
{
|
||||||
|
std::vector< IDeletionWatcher* >::iterator itr
|
||||||
|
= std::find( deletionWatchers.begin(), deletionWatchers.end(), watcher );
|
||||||
|
// Already registered
|
||||||
|
if( itr != deletionWatchers.end() )
|
||||||
|
return;
|
||||||
|
deletionWatchers.push_back( watcher );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CInterfaceElement::unregisterDeletionWatcher( IDeletionWatcher *watcher )
|
||||||
|
{
|
||||||
|
std::vector< IDeletionWatcher* >::iterator itr
|
||||||
|
= std::find( deletionWatchers.begin(), deletionWatchers.end(), watcher );
|
||||||
|
// Not registered
|
||||||
|
if( itr == deletionWatchers.end() )
|
||||||
|
return;
|
||||||
|
deletionWatchers.erase( itr );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CInterfaceElement::notifyDeletionWatchers()
|
||||||
|
{
|
||||||
|
std::vector< IDeletionWatcher* >::iterator itr = deletionWatchers.begin();
|
||||||
|
while( itr != deletionWatchers.end() )
|
||||||
|
{
|
||||||
|
(*itr)->onDeleted( _Id );
|
||||||
|
++itr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CStringMapper* CStringShared::_UIStringMapper = NULL;
|
CStringMapper* CStringShared::_UIStringMapper = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -143,12 +143,12 @@ namespace NLGUI
|
||||||
// initStart = ryzomGetLocalTime ();
|
// initStart = ryzomGetLocalTime ();
|
||||||
clearGroups();
|
clearGroups();
|
||||||
// nlinfo ("%d seconds for clearGroups '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str());
|
// nlinfo ("%d seconds for clearGroups '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str());
|
||||||
// initStart = ryzomGetLocalTime ();
|
|
||||||
clearViews();
|
|
||||||
// nlinfo ("%d seconds for clearViews '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str());
|
|
||||||
// initStart = ryzomGetLocalTime ();
|
// initStart = ryzomGetLocalTime ();
|
||||||
clearControls();
|
clearControls();
|
||||||
// nlinfo ("%d seconds for clearControls '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str());
|
// nlinfo ("%d seconds for clearControls '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str());
|
||||||
|
// initStart = ryzomGetLocalTime ();
|
||||||
|
clearViews();
|
||||||
|
// nlinfo ("%d seconds for clearViews '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str());
|
||||||
CWidgetManager::getInstance()->removeRefOnGroup (this);
|
CWidgetManager::getInstance()->removeRefOnGroup (this);
|
||||||
|
|
||||||
#ifdef AJM_DEBUG_TRACK_INTERFACE_GROUPS
|
#ifdef AJM_DEBUG_TRACK_INTERFACE_GROUPS
|
||||||
|
@ -1086,9 +1086,11 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
if (_Views[i] == child)
|
if (_Views[i] == child)
|
||||||
{
|
{
|
||||||
if (!dontDelete) delete _Views[i];
|
CViewBase *v = _Views[i];
|
||||||
_Views.erase(_Views.begin()+i);
|
_Views.erase(_Views.begin()+i);
|
||||||
delEltOrder (child);
|
delEltOrder (child);
|
||||||
|
child->onRemoved();
|
||||||
|
if (!dontDelete) delete v;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1102,9 +1104,11 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
if (_Controls[i] == child)
|
if (_Controls[i] == child)
|
||||||
{
|
{
|
||||||
if (!dontDelete) delete _Controls[i];
|
CCtrlBase *c = _Controls[i];
|
||||||
_Controls.erase(_Controls.begin()+i);
|
_Controls.erase(_Controls.begin()+i);
|
||||||
delEltOrder (child);
|
delEltOrder (child);
|
||||||
|
child->onRemoved();
|
||||||
|
if (!dontDelete) delete c;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1118,9 +1122,11 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
if (_ChildrenGroups[i] == child)
|
if (_ChildrenGroups[i] == child)
|
||||||
{
|
{
|
||||||
if (!dontDelete) delete _ChildrenGroups[i];
|
CInterfaceGroup *g = _ChildrenGroups[i];
|
||||||
_ChildrenGroups.erase(_ChildrenGroups.begin()+i);
|
_ChildrenGroups.erase(_ChildrenGroups.begin()+i);
|
||||||
delEltOrder (child);
|
delEltOrder (child);
|
||||||
|
child->onRemoved();
|
||||||
|
if (!dontDelete) delete g;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2471,4 +2477,16 @@ namespace NLGUI
|
||||||
return "IMPLEMENT ME!";
|
return "IMPLEMENT ME!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CInterfaceGroup::onWidgetDeleted( CInterfaceElement *e )
|
||||||
|
{
|
||||||
|
for( std::vector< CViewBase* >::iterator itr = _Views.begin(); itr != _Views.end(); ++itr )
|
||||||
|
(*itr)->onWidgetDeleted( e );
|
||||||
|
|
||||||
|
for( std::vector< CCtrlBase* >::iterator itr = _Controls.begin(); itr != _Controls.end(); ++itr )
|
||||||
|
(*itr)->onWidgetDeleted( e );
|
||||||
|
|
||||||
|
for( std::vector< CInterfaceGroup* >::iterator itr = _ChildrenGroups.begin(); itr != _ChildrenGroups.end(); ++itr )
|
||||||
|
(*itr)->onWidgetDeleted( e );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3149,5 +3149,10 @@ namespace NLGUI
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CViewBase* CInterfaceParser::createClass( const std::string &name )
|
||||||
|
{
|
||||||
|
return NLMISC_GET_FACTORY( CViewBase, std::string ).createObject( std::string( name ) , CViewBase::TCtorParam() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,5 +47,23 @@ namespace NLGUI
|
||||||
CInterfaceElement::visit(visitor);
|
CInterfaceElement::visit(visitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool CViewBase::handleEvent( const NLGUI::CEventDescriptor &evnt )
|
||||||
|
{
|
||||||
|
if( evnt.getType() == NLGUI::CEventDescriptor::mouse )
|
||||||
|
{
|
||||||
|
const NLGUI::CEventDescriptorMouse &eventDesc = ( const NLGUI::CEventDescriptorMouse& )evnt;
|
||||||
|
if( eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown )
|
||||||
|
{
|
||||||
|
if( editorMode )
|
||||||
|
{
|
||||||
|
CWidgetManager::getInstance()->setCurrentEditorSelection( getId() );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include "nel/gui/proc.h"
|
#include "nel/gui/proc.h"
|
||||||
#include "nel/gui/interface_expr.h"
|
#include "nel/gui/interface_expr.h"
|
||||||
#include "nel/gui/reflect_register.h"
|
#include "nel/gui/reflect_register.h"
|
||||||
|
#include "nel/gui/editor_selection_watcher.h"
|
||||||
|
#include "nel/gui/widget_addition_watcher.h"
|
||||||
#include "nel/misc/events.h"
|
#include "nel/misc/events.h"
|
||||||
|
|
||||||
namespace NLGUI
|
namespace NLGUI
|
||||||
|
@ -1033,6 +1035,7 @@ namespace NLGUI
|
||||||
_OldCaptureKeyboard = NULL;
|
_OldCaptureKeyboard = NULL;
|
||||||
setCapturePointerLeft(NULL);
|
setCapturePointerLeft(NULL);
|
||||||
setCapturePointerRight(NULL);
|
setCapturePointerRight(NULL);
|
||||||
|
_CapturedView = NULL;
|
||||||
|
|
||||||
resetColorProps();
|
resetColorProps();
|
||||||
resetAlphaRolloverSpeedProps();
|
resetAlphaRolloverSpeedProps();
|
||||||
|
@ -2067,6 +2070,16 @@ namespace NLGUI
|
||||||
getPointer()->draw ();
|
getPointer()->draw ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( CInterfaceElement::getEditorMode() )
|
||||||
|
{
|
||||||
|
if( !currentEditorSelection.empty() )
|
||||||
|
{
|
||||||
|
CInterfaceElement *e = getElementFromId( currentEditorSelection );
|
||||||
|
if( e != NULL )
|
||||||
|
e->drawHighlight();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// flush layers
|
// flush layers
|
||||||
CViewRenderer::getInstance()->flush();
|
CViewRenderer::getInstance()->flush();
|
||||||
|
|
||||||
|
@ -2099,6 +2112,12 @@ namespace NLGUI
|
||||||
getCapturePointerRight()->handleEvent( evnt );
|
getCapturePointerRight()->handleEvent( evnt );
|
||||||
setCapturePointerRight( NULL );
|
setCapturePointerRight( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( _CapturedView != NULL )
|
||||||
|
{
|
||||||
|
_CapturedView->handleEvent( evnt );
|
||||||
|
_CapturedView = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2262,6 +2281,9 @@ namespace NLGUI
|
||||||
getCapturePointerLeft() != getCapturePointerRight() )
|
getCapturePointerLeft() != getCapturePointerRight() )
|
||||||
handled|= getCapturePointerRight()->handleEvent(evnt);
|
handled|= getCapturePointerRight()->handleEvent(evnt);
|
||||||
|
|
||||||
|
if( _CapturedView != NULL )
|
||||||
|
_CapturedView->handleEvent( evnt );
|
||||||
|
|
||||||
CInterfaceGroup *ptr = getWindowUnder (eventDesc.getX(), eventDesc.getY());
|
CInterfaceGroup *ptr = getWindowUnder (eventDesc.getX(), eventDesc.getY());
|
||||||
setCurrentWindowUnder( ptr );
|
setCurrentWindowUnder( ptr );
|
||||||
|
|
||||||
|
@ -2339,6 +2361,8 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool captured = false;
|
||||||
|
|
||||||
// must not capture a new element if a sheet is currentlty being dragged.
|
// must not capture a new element if a sheet is currentlty being dragged.
|
||||||
// This may happen when alt-tab has been used => the sheet is dragged but the left button is up
|
// This may happen when alt-tab has been used => the sheet is dragged but the left button is up
|
||||||
if (!CCtrlDraggable::getDraggedSheet())
|
if (!CCtrlDraggable::getDraggedSheet())
|
||||||
|
@ -2356,9 +2380,25 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
nMaxDepth = d;
|
nMaxDepth = d;
|
||||||
setCapturePointerLeft( ctrl );
|
setCapturePointerLeft( ctrl );
|
||||||
|
captured = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( CInterfaceElement::getEditorMode() && !captured )
|
||||||
|
{
|
||||||
|
for( sint32 i = _ViewsUnderPointer.size()-1; i >= 0; i-- )
|
||||||
|
{
|
||||||
|
CViewBase *v = _ViewsUnderPointer[i];
|
||||||
|
if( ( v != NULL ) && v->isInGroup( pNewCurrentWnd ) )
|
||||||
|
{
|
||||||
|
_CapturedView = v;
|
||||||
|
captured = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
notifyElementCaptured( getCapturePointerLeft() );
|
notifyElementCaptured( getCapturePointerLeft() );
|
||||||
if (clickedOutModalWindow && !clickedOutModalWindow->OnPostClickOut.empty())
|
if (clickedOutModalWindow && !clickedOutModalWindow->OnPostClickOut.empty())
|
||||||
{
|
{
|
||||||
|
@ -2366,13 +2406,16 @@ namespace NLGUI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if found
|
//if found
|
||||||
if ( getCapturePointerLeft() != NULL)
|
if ( captured )
|
||||||
{
|
{
|
||||||
// consider clicking on a control implies handling of the event.
|
// consider clicking on a control implies handling of the event.
|
||||||
handled= true;
|
handled= true;
|
||||||
|
|
||||||
// handle the capture
|
// handle the capture
|
||||||
getCapturePointerLeft()->handleEvent(evnt);
|
if( getCapturePointerLeft() != NULL )
|
||||||
|
getCapturePointerLeft()->handleEvent(evnt);
|
||||||
|
else
|
||||||
|
_CapturedView->handleEvent( evnt );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2601,6 +2644,8 @@ namespace NLGUI
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CWidgetManager::setCapturePointerLeft(CCtrlBase *c)
|
void CWidgetManager::setCapturePointerLeft(CCtrlBase *c)
|
||||||
{
|
{
|
||||||
|
_CapturedView = NULL;
|
||||||
|
|
||||||
// additionally, abort any dragging
|
// additionally, abort any dragging
|
||||||
if( CCtrlDraggable::getDraggedSheet() != NULL )
|
if( CCtrlDraggable::getDraggedSheet() != NULL )
|
||||||
CCtrlDraggable::getDraggedSheet()->abortDragging();
|
CCtrlDraggable::getDraggedSheet()->abortDragging();
|
||||||
|
@ -3179,8 +3224,114 @@ namespace NLGUI
|
||||||
prev->setEditorSelected( false );
|
prev->setEditorSelected( false );
|
||||||
}
|
}
|
||||||
e->setEditorSelected( true );
|
e->setEditorSelected( true );
|
||||||
currentEditorSelection = name;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if( !name.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
currentEditorSelection = name;
|
||||||
|
notifySelectionWatchers();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWidgetManager::notifySelectionWatchers()
|
||||||
|
{
|
||||||
|
std::vector< IEditorSelectionWatcher* >::iterator itr = selectionWatchers.begin();
|
||||||
|
while( itr != selectionWatchers.end() )
|
||||||
|
{
|
||||||
|
(*itr)->selectionChanged( currentEditorSelection );
|
||||||
|
++itr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWidgetManager::registerSelectionWatcher( IEditorSelectionWatcher *watcher )
|
||||||
|
{
|
||||||
|
std::vector< IEditorSelectionWatcher* >::iterator itr =
|
||||||
|
std::find( selectionWatchers.begin(), selectionWatchers.end(), watcher );
|
||||||
|
|
||||||
|
// We already have this watcher
|
||||||
|
if( itr != selectionWatchers.end() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
selectionWatchers.push_back( watcher );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWidgetManager::unregisterSelectionWatcher( IEditorSelectionWatcher *watcher )
|
||||||
|
{
|
||||||
|
std::vector< IEditorSelectionWatcher* >::iterator itr =
|
||||||
|
std::find( selectionWatchers.begin(), selectionWatchers.end(), watcher );
|
||||||
|
|
||||||
|
// We don't have this watcher
|
||||||
|
if( itr == selectionWatchers.end() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
selectionWatchers.erase( itr );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWidgetManager::notifyAdditionWatchers( const std::string &widgetName )
|
||||||
|
{
|
||||||
|
std::vector< IWidgetAdditionWatcher* >::const_iterator itr = additionWatchers.begin();
|
||||||
|
while( itr != additionWatchers.end() )
|
||||||
|
{
|
||||||
|
(*itr)->widgetAdded( widgetName );
|
||||||
|
++itr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWidgetManager::registerAdditionWatcher( IWidgetAdditionWatcher *watcher )
|
||||||
|
{
|
||||||
|
std::vector< IWidgetAdditionWatcher* >::const_iterator itr
|
||||||
|
= std::find( additionWatchers.begin(), additionWatchers.end(), watcher );
|
||||||
|
// already exists
|
||||||
|
if( itr != additionWatchers.end() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
additionWatchers.push_back( watcher );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CWidgetManager::unregisterAdditionWatcher( IWidgetAdditionWatcher *watcher )
|
||||||
|
{
|
||||||
|
std::vector< IWidgetAdditionWatcher* >::iterator itr
|
||||||
|
= std::find( additionWatchers.begin(), additionWatchers.end(), watcher );
|
||||||
|
// doesn't exist
|
||||||
|
if( itr == additionWatchers.end() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
additionWatchers.erase( itr );
|
||||||
|
}
|
||||||
|
|
||||||
|
CInterfaceElement* CWidgetManager::addWidgetToGroup( std::string &group, std::string &widgetClass, std::string &widgetName )
|
||||||
|
{
|
||||||
|
// Check if this group exists
|
||||||
|
CInterfaceElement *e = getElementFromId( group );
|
||||||
|
if( e == NULL )
|
||||||
|
return NULL;
|
||||||
|
CInterfaceGroup *g = dynamic_cast< CInterfaceGroup* >( e );
|
||||||
|
if( g == NULL )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Check if an element already exists with that name
|
||||||
|
if( g->getElement( widgetName ) != NULL )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Create and add the new widget
|
||||||
|
CViewBase *v = getParser()->createClass( widgetClass );
|
||||||
|
if( v == NULL )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
v->setId( std::string( g->getId() + ":" + widgetName ) );
|
||||||
|
v->setParent( g );
|
||||||
|
|
||||||
|
if( v->isGroup() )
|
||||||
|
g->addGroup( dynamic_cast< CInterfaceGroup* >( v ) );
|
||||||
|
else
|
||||||
|
if( v->isCtrl() )
|
||||||
|
g->addCtrl( dynamic_cast< CCtrlBase* >( v ) );
|
||||||
|
else
|
||||||
|
g->addView( v );
|
||||||
|
|
||||||
|
notifyAdditionWatchers( v->getId() );
|
||||||
|
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,10 @@
|
||||||
#include "nel/misc/mutex.h"
|
#include "nel/misc/mutex.h"
|
||||||
#include "nel/misc/report.h"
|
#include "nel/misc/report.h"
|
||||||
#include "nel/misc/system_utils.h"
|
#include "nel/misc/system_utils.h"
|
||||||
|
#include "nel/misc/variable.h"
|
||||||
|
|
||||||
#include "nel/misc/debug.h"
|
#include "nel/misc/debug.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
// these defines is for IsDebuggerPresent(). it'll not compile on windows 95
|
// these defines is for IsDebuggerPresent(). it'll not compile on windows 95
|
||||||
// just comment this and the IsDebuggerPresent to compile on windows 95
|
// just comment this and the IsDebuggerPresent to compile on windows 95
|
||||||
|
@ -57,6 +57,8 @@ using namespace std;
|
||||||
namespace NLMISC
|
namespace NLMISC
|
||||||
{
|
{
|
||||||
|
|
||||||
|
CVariable<bool> StdDisplayerColor("nel", "StdDisplayerColor", "Enable colors in std displayer", true, 0, true);
|
||||||
|
|
||||||
static const char *LogTypeToString[][8] = {
|
static const char *LogTypeToString[][8] = {
|
||||||
{ "", "ERR", "WRN", "INF", "DBG", "STT", "AST", "UKN" },
|
{ "", "ERR", "WRN", "INF", "DBG", "STT", "AST", "UKN" },
|
||||||
{ "", "Error", "Warning", "Information", "Debug", "Statistic", "Assert", "Unknown" },
|
{ "", "Error", "Warning", "Information", "Debug", "Statistic", "Assert", "Unknown" },
|
||||||
|
@ -139,9 +141,20 @@ void CStdDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess
|
||||||
bool needSpace = false;
|
bool needSpace = false;
|
||||||
//stringstream ss;
|
//stringstream ss;
|
||||||
string str;
|
string str;
|
||||||
|
#ifdef NL_OS_UNIX
|
||||||
|
bool colorSet = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (args.LogType != CLog::LOG_NO)
|
if (args.LogType != CLog::LOG_NO)
|
||||||
{
|
{
|
||||||
|
#ifdef NL_OS_UNIX
|
||||||
|
if (StdDisplayerColor.get())
|
||||||
|
{
|
||||||
|
if (args.LogType == CLog::LOG_ERROR || args.LogType == CLog::LOG_ASSERT) { str += "\e[0;30m\e[41m"; colorSet = true; } // black text, red background
|
||||||
|
else if (args.LogType == CLog::LOG_WARNING) { str += "\e[0;91m"; colorSet = true; } // bright red text
|
||||||
|
else if (args.LogType == CLog::LOG_DEBUG) { str += "\e[0;34m"; colorSet = true; } // blue text
|
||||||
|
}
|
||||||
|
#endif
|
||||||
//ss << logTypeToString(args.LogType);
|
//ss << logTypeToString(args.LogType);
|
||||||
str += logTypeToString(args.LogType);
|
str += logTypeToString(args.LogType);
|
||||||
needSpace = true;
|
needSpace = true;
|
||||||
|
@ -218,6 +231,13 @@ void CStdDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess
|
||||||
}
|
}
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
|
|
||||||
|
#ifdef NL_OS_UNIX
|
||||||
|
if (colorSet)
|
||||||
|
{
|
||||||
|
str += "\e[0m";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Printf ?
|
// Printf ?
|
||||||
if (consoleMode)
|
if (consoleMode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,15 +57,15 @@ ADD_DEFINITIONS(-DCORE_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
IF(WITH_INSTALL_LIBRARIES)
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
ELSE(WITH_INSTALL_LIBRARIES)
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
ENDIF(WITH_INSTALL_LIBRARIES)
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
ELSE(WIN32)
|
ELSE(WIN32)
|
||||||
IF(WITH_INSTALL_LIBRARIES)
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
ELSE(WITH_INSTALL_LIBRARIES)
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
ENDIF(WITH_INSTALL_LIBRARIES)
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,20 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_disp_sheet_id)
|
||||||
|
|
||||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
|
||||||
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_disp_sheet_id.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_disp_sheet_id.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,19 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_example)
|
||||||
|
|
||||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_example.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_example.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,24 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_georges_editor)
|
||||||
|
|
||||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_georges_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
|
||||||
|
|
||||||
IF(WITH_PCH)
|
IF(WITH_PCH)
|
||||||
ADD_NATIVE_PRECOMPILED_HEADER(ovqt_plugin_georges_editor ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
|
ADD_NATIVE_PRECOMPILED_HEADER(ovqt_plugin_georges_editor ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
|
||||||
ENDIF(WITH_PCH)
|
ENDIF(WITH_PCH)
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_georges_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,9 @@ SET(OVQT_PLUGIN_GUI_EDITOR_HDR
|
||||||
nelgui_widget.h
|
nelgui_widget.h
|
||||||
new_property_widget.h
|
new_property_widget.h
|
||||||
new_widget_widget.h
|
new_widget_widget.h
|
||||||
|
add_widget_widget.h
|
||||||
|
editor_selection_watcher.h
|
||||||
|
editor_message_processor.h
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(OVQT_PLUGIN_GUI_EDITOR_UIS
|
SET(OVQT_PLUGIN_GUI_EDITOR_UIS
|
||||||
|
@ -42,6 +45,7 @@ SET(OVQT_PLUGIN_GUI_EDITOR_UIS
|
||||||
project_window.ui
|
project_window.ui
|
||||||
new_property_widget.ui
|
new_property_widget.ui
|
||||||
new_widget_widget.ui
|
new_widget_widget.ui
|
||||||
|
add_widget_widget.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(QT_USE_QTGUI TRUE)
|
SET(QT_USE_QTGUI TRUE)
|
||||||
|
@ -82,4 +86,18 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_gui_editor)
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DGUI_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
ADD_DEFINITIONS(-DGUI_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_gui_editor LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d)
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_gui_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
#include "add_widget_widget.h"
|
||||||
|
#include "widget_info_tree.h"
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
namespace GUIEditor
|
||||||
|
{
|
||||||
|
|
||||||
|
AddWidgetWidget::AddWidgetWidget( QWidget *parent ) :
|
||||||
|
QWidget( parent )
|
||||||
|
{
|
||||||
|
setupUi( this );
|
||||||
|
setupConnections();
|
||||||
|
}
|
||||||
|
|
||||||
|
AddWidgetWidget::~AddWidgetWidget()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddWidgetWidget::setCurrentGroup( const QString &g )
|
||||||
|
{
|
||||||
|
groupEdit->setText( g );
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddWidgetWidget::setupWidgetInfo( const CWidgetInfoTree *tree )
|
||||||
|
{
|
||||||
|
std::vector< std::string > names;
|
||||||
|
tree->getNames( names, false );
|
||||||
|
|
||||||
|
widgetCB->clear();
|
||||||
|
|
||||||
|
std::sort( names.begin(), names.end() );
|
||||||
|
|
||||||
|
std::vector< std::string >::const_iterator itr = names.begin();
|
||||||
|
while( itr != names.end() )
|
||||||
|
{
|
||||||
|
widgetCB->addItem( QString( itr->c_str() ) );
|
||||||
|
++itr;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddWidgetWidget::setupConnections()
|
||||||
|
{
|
||||||
|
connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( close() ) );
|
||||||
|
connect( addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddWidgetWidget::onAddClicked()
|
||||||
|
{
|
||||||
|
if( groupEdit->text().isEmpty() )
|
||||||
|
{
|
||||||
|
QMessageBox::warning( NULL,
|
||||||
|
tr( "WARNING" ),
|
||||||
|
tr( "You need to be adding the new widget into a group!" ),
|
||||||
|
QMessageBox::Ok );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( nameEdit->text().isEmpty() )
|
||||||
|
{
|
||||||
|
QMessageBox::warning( NULL,
|
||||||
|
tr( "WARNING" ),
|
||||||
|
tr( "You need to specify a name for your new widget!" ),
|
||||||
|
QMessageBox::Ok );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
close();
|
||||||
|
|
||||||
|
Q_EMIT adding( groupEdit->text(), widgetCB->currentText(), nameEdit->text() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
#ifndef ADD_WIDGET_WIDGET_H
|
||||||
|
#define ADD_WIDGET_WIDGET_H
|
||||||
|
|
||||||
|
#include "ui_add_widget_widget.h"
|
||||||
|
|
||||||
|
namespace GUIEditor
|
||||||
|
{
|
||||||
|
class CWidgetInfoTree;
|
||||||
|
|
||||||
|
class AddWidgetWidget : public QWidget, public Ui::AddWidgetWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
AddWidgetWidget( QWidget *parent = NULL );
|
||||||
|
~AddWidgetWidget();
|
||||||
|
|
||||||
|
void setCurrentGroup( const QString &g );
|
||||||
|
void setupWidgetInfo( const CWidgetInfoTree *tree );
|
||||||
|
|
||||||
|
private:
|
||||||
|
void setupConnections();
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void onAddClicked();
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void adding( const QString &parentGroup, const QString &widgetType, const QString &name );
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,79 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>AddWidgetWidget</class>
|
||||||
|
<widget class="QWidget" name="AddWidgetWidget">
|
||||||
|
<property name="windowModality">
|
||||||
|
<enum>Qt::ApplicationModal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>318</width>
|
||||||
|
<height>132</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Add new widget</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Group</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="groupEdit">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Widget</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="widgetCB"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Name</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="nameEdit"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QPushButton" name="addButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Add</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QPushButton" name="cancelButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Cancel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -0,0 +1,134 @@
|
||||||
|
// Object Viewer Qt GUI Editor plugin <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include "editor_message_processor.h"
|
||||||
|
|
||||||
|
#include "nel/gui/interface_group.h"
|
||||||
|
#include "nel/gui/widget_manager.h"
|
||||||
|
#include "widget_info_tree.h"
|
||||||
|
|
||||||
|
namespace GUIEditor
|
||||||
|
{
|
||||||
|
void CEditorMessageProcessor::onDelete()
|
||||||
|
{
|
||||||
|
std::string selection = CWidgetManager::getInstance()->getCurrentEditorSelection();
|
||||||
|
if( selection.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
QMessageBox::StandardButton r =
|
||||||
|
QMessageBox::question( NULL,
|
||||||
|
tr( "Deleting widget" ),
|
||||||
|
tr( "Are you sure you want to delete %1?" ).arg( selection.c_str() ),
|
||||||
|
QMessageBox::Yes | QMessageBox::No );
|
||||||
|
if( r != QMessageBox::Yes )
|
||||||
|
return;
|
||||||
|
|
||||||
|
CInterfaceElement *e =
|
||||||
|
CWidgetManager::getInstance()->getElementFromId( selection );
|
||||||
|
if( e == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
CInterfaceElement *p = e->getParent();
|
||||||
|
if( p == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
CInterfaceGroup *g = dynamic_cast< CInterfaceGroup* >( p );
|
||||||
|
if( g == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( g->delElement( e ) )
|
||||||
|
{
|
||||||
|
CWidgetManager::getInstance()->setCurrentEditorSelection( "" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEditorMessageProcessor::onAdd( const QString &parentGroup, const QString &widgetType, const QString &name )
|
||||||
|
{
|
||||||
|
CWidgetInfoTreeNode *node = tree->findNodeByName( std::string( widgetType.toUtf8() ) );
|
||||||
|
// No such widget
|
||||||
|
if( node == NULL )
|
||||||
|
{
|
||||||
|
QMessageBox::critical(
|
||||||
|
NULL,
|
||||||
|
tr( "Error" ),
|
||||||
|
tr( "Error adding the new widget! No such widget type!" ),
|
||||||
|
QMessageBox::Ok
|
||||||
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// No class name defined
|
||||||
|
std::string className = node->getInfo().className;
|
||||||
|
if( className.empty() )
|
||||||
|
{
|
||||||
|
QMessageBox::critical(
|
||||||
|
NULL,
|
||||||
|
tr( "Error" ),
|
||||||
|
tr( "Error adding the new widget! Missing classname!" ),
|
||||||
|
QMessageBox::Ok
|
||||||
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string pgName = std::string( parentGroup.toUtf8() );
|
||||||
|
std::string wName = std::string( name.toUtf8() );
|
||||||
|
|
||||||
|
CInterfaceElement *e =
|
||||||
|
CWidgetManager::getInstance()->addWidgetToGroup(
|
||||||
|
pgName,
|
||||||
|
className,
|
||||||
|
wName
|
||||||
|
);
|
||||||
|
|
||||||
|
// Failed to add widget
|
||||||
|
if( e == NULL )
|
||||||
|
{
|
||||||
|
QMessageBox::critical(
|
||||||
|
NULL,
|
||||||
|
tr( "Error" ),
|
||||||
|
tr( "Error adding the new widget!" ),
|
||||||
|
QMessageBox::Ok
|
||||||
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setting the defaults will override the Id too
|
||||||
|
std::string id = e->getId();
|
||||||
|
|
||||||
|
// Set up the defaults
|
||||||
|
std::vector< SPropEntry >::const_iterator itr = node->getInfo().props.begin();
|
||||||
|
while( itr != node->getInfo().props.end() )
|
||||||
|
{
|
||||||
|
e->setProperty( itr->propName, itr->propDefault );
|
||||||
|
++itr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restore the Id
|
||||||
|
e->setId( id );
|
||||||
|
// Make the widget aligned to the top left corner
|
||||||
|
e->setParentPosRef( Hotspot_TL );
|
||||||
|
e->setPosRef( Hotspot_TL );
|
||||||
|
|
||||||
|
// Apply the new settings
|
||||||
|
e->setActive( false );
|
||||||
|
e->setActive( true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
// Object Viewer Qt GUI Editor plugin <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
namespace GUIEditor
|
||||||
|
{
|
||||||
|
class CWidgetInfoTree;
|
||||||
|
|
||||||
|
/// Processes the GUI Editor's editor messages like delete, new, etc...
|
||||||
|
class CEditorMessageProcessor : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
CEditorMessageProcessor( QObject *parent = NULL ) :
|
||||||
|
QObject( parent )
|
||||||
|
{
|
||||||
|
tree = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
~CEditorMessageProcessor(){}
|
||||||
|
|
||||||
|
void setTree( CWidgetInfoTree *tree ){ this->tree = tree; }
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void onDelete();
|
||||||
|
void onAdd( const QString &parentGroup, const QString &widgetType, const QString &name );
|
||||||
|
|
||||||
|
private:
|
||||||
|
CWidgetInfoTree *tree;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#include "editor_selection_watcher.h"
|
||||||
|
|
||||||
|
namespace GUIEditor
|
||||||
|
{
|
||||||
|
void CEditorSelectionWatcher::selectionChanged( std::string &newSelection )
|
||||||
|
{
|
||||||
|
Q_EMIT sgnSelectionChanged( newSelection );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#include "nel/gui/editor_selection_watcher.h"
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
namespace GUIEditor
|
||||||
|
{
|
||||||
|
/// Watches the Editor selection, and emits a signal when it changes
|
||||||
|
class CEditorSelectionWatcher : public QObject, public NLGUI::IEditorSelectionWatcher
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
CEditorSelectionWatcher() : QObject( NULL ){}
|
||||||
|
|
||||||
|
void selectionChanged( std::string &newSelection );
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void sgnSelectionChanged( std::string &id );
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -41,6 +41,9 @@
|
||||||
#include "project_file_serializer.h"
|
#include "project_file_serializer.h"
|
||||||
#include "project_window.h"
|
#include "project_window.h"
|
||||||
#include "nelgui_widget.h"
|
#include "nelgui_widget.h"
|
||||||
|
#include "editor_selection_watcher.h"
|
||||||
|
#include "editor_message_processor.h"
|
||||||
|
#include "add_widget_widget.h"
|
||||||
|
|
||||||
namespace GUIEditor
|
namespace GUIEditor
|
||||||
{
|
{
|
||||||
|
@ -53,11 +56,13 @@ namespace GUIEditor
|
||||||
QMainWindow(parent)
|
QMainWindow(parent)
|
||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
|
messageProcessor = new CEditorMessageProcessor;
|
||||||
m_undoStack = new QUndoStack(this);
|
m_undoStack = new QUndoStack(this);
|
||||||
widgetProps = new CWidgetProperties;
|
widgetProps = new CWidgetProperties;
|
||||||
linkList = new LinkList;
|
linkList = new LinkList;
|
||||||
procList = new ProcList;
|
procList = new ProcList;
|
||||||
projectWindow = new ProjectWindow;
|
projectWindow = new ProjectWindow;
|
||||||
|
addWidgetWidget = new AddWidgetWidget;
|
||||||
connect( projectWindow, SIGNAL( projectFilesChanged() ), this, SLOT( onProjectFilesChanged() ) );
|
connect( projectWindow, SIGNAL( projectFilesChanged() ), this, SLOT( onProjectFilesChanged() ) );
|
||||||
viewPort = new NelGUIWidget;
|
viewPort = new NelGUIWidget;
|
||||||
setCentralWidget( viewPort );
|
setCentralWidget( viewPort );
|
||||||
|
@ -73,6 +78,8 @@ namespace GUIEditor
|
||||||
parser.setWidgetInfoTree( widgetInfoTree );
|
parser.setWidgetInfoTree( widgetInfoTree );
|
||||||
parser.parseGUIWidgets();
|
parser.parseGUIWidgets();
|
||||||
widgetProps->setupWidgetInfo( widgetInfoTree );
|
widgetProps->setupWidgetInfo( widgetInfoTree );
|
||||||
|
addWidgetWidget->setupWidgetInfo( widgetInfoTree );
|
||||||
|
messageProcessor->setTree( widgetInfoTree );
|
||||||
|
|
||||||
QDockWidget *dock = new QDockWidget( "Widget Hierarchy", this );
|
QDockWidget *dock = new QDockWidget( "Widget Hierarchy", this );
|
||||||
dock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
dock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
||||||
|
@ -91,17 +98,23 @@ namespace GUIEditor
|
||||||
|
|
||||||
viewPort->init();
|
viewPort->init();
|
||||||
|
|
||||||
connect( viewPort, SIGNAL( guiLoadComplete() ), hierarchyView, SLOT( onGUILoaded() ) );
|
connect( viewPort, SIGNAL( guiLoadComplete() ), this, SLOT( onGUILoaded() ) );
|
||||||
connect( viewPort, SIGNAL( guiLoadComplete() ), procList, SLOT( onGUILoaded() ) );
|
connect( widgetProps, SIGNAL( treeChanged() ), this, SLOT( onTreeChanged() ) );
|
||||||
connect( viewPort, SIGNAL( guiLoadComplete() ), linkList, SLOT( onGUILoaded() ) );
|
connect(
|
||||||
connect( hierarchyView, SIGNAL( selectionChanged( std::string& ) ),
|
addWidgetWidget,
|
||||||
&browserCtrl, SLOT( onSelectionChanged( std::string& ) ) );
|
SIGNAL( adding( const QString&, const QString&, const QString& ) ),
|
||||||
|
messageProcessor,
|
||||||
|
SLOT( onAdd( const QString&, const QString&, const QString& ) )
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
GUIEditorWindow::~GUIEditorWindow()
|
GUIEditorWindow::~GUIEditorWindow()
|
||||||
{
|
{
|
||||||
writeSettings();
|
writeSettings();
|
||||||
|
|
||||||
|
delete messageProcessor;
|
||||||
|
messageProcessor = NULL;
|
||||||
|
|
||||||
delete widgetProps;
|
delete widgetProps;
|
||||||
widgetProps = NULL;
|
widgetProps = NULL;
|
||||||
|
|
||||||
|
@ -117,6 +130,9 @@ namespace GUIEditor
|
||||||
delete viewPort;
|
delete viewPort;
|
||||||
viewPort = NULL;
|
viewPort = NULL;
|
||||||
|
|
||||||
|
delete addWidgetWidget;
|
||||||
|
addWidgetWidget = NULL;
|
||||||
|
|
||||||
// no deletion needed for these, since dockwidget owns them
|
// no deletion needed for these, since dockwidget owns them
|
||||||
hierarchyView = NULL;
|
hierarchyView = NULL;
|
||||||
propBrowser = NULL;
|
propBrowser = NULL;
|
||||||
|
@ -262,6 +278,11 @@ namespace GUIEditor
|
||||||
if( reply != QMessageBox::Yes )
|
if( reply != QMessageBox::Yes )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
CEditorSelectionWatcher *w = viewPort->getWatcher();
|
||||||
|
disconnect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), hierarchyView, SLOT( onSelectionChanged( std::string& ) ) );
|
||||||
|
disconnect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), &browserCtrl, SLOT( onSelectionChanged( std::string& ) ) );
|
||||||
|
|
||||||
projectFiles.clearAll();
|
projectFiles.clearAll();
|
||||||
projectWindow->clear();
|
projectWindow->clear();
|
||||||
hierarchyView->clearHierarchy();
|
hierarchyView->clearHierarchy();
|
||||||
|
@ -291,6 +312,30 @@ namespace GUIEditor
|
||||||
setCursor( Qt::ArrowCursor );
|
setCursor( Qt::ArrowCursor );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUIEditorWindow::onGUILoaded()
|
||||||
|
{
|
||||||
|
hierarchyView->onGUILoaded();
|
||||||
|
procList->onGUILoaded();
|
||||||
|
linkList->onGUILoaded();
|
||||||
|
|
||||||
|
CEditorSelectionWatcher *w = viewPort->getWatcher();
|
||||||
|
connect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), hierarchyView, SLOT( onSelectionChanged( std::string& ) ) );
|
||||||
|
connect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), &browserCtrl, SLOT( onSelectionChanged( std::string& ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void GUIEditorWindow::onAddWidgetClicked()
|
||||||
|
{
|
||||||
|
QString g;
|
||||||
|
hierarchyView->getCurrentGroup( g );
|
||||||
|
|
||||||
|
addWidgetWidget->setCurrentGroup( g );
|
||||||
|
addWidgetWidget->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GUIEditorWindow::onTreeChanged()
|
||||||
|
{
|
||||||
|
addWidgetWidget->setupWidgetInfo( widgetInfoTree );
|
||||||
|
}
|
||||||
|
|
||||||
void GUIEditorWindow::createMenus()
|
void GUIEditorWindow::createMenus()
|
||||||
{
|
{
|
||||||
|
@ -299,6 +344,7 @@ namespace GUIEditor
|
||||||
QAction *saveAction = mm->action( Core::Constants::SAVE );
|
QAction *saveAction = mm->action( Core::Constants::SAVE );
|
||||||
QAction *saveAsAction = mm->action( Core::Constants::SAVE_AS );
|
QAction *saveAsAction = mm->action( Core::Constants::SAVE_AS );
|
||||||
QAction *closeAction = mm->action( Core::Constants::CLOSE );
|
QAction *closeAction = mm->action( Core::Constants::CLOSE );
|
||||||
|
QAction *delAction = mm->action( Core::Constants::DEL );
|
||||||
|
|
||||||
//if( newAction != NULL )
|
//if( newAction != NULL )
|
||||||
// newAction->setEnabled( true );
|
// newAction->setEnabled( true );
|
||||||
|
@ -308,6 +354,11 @@ namespace GUIEditor
|
||||||
saveAsAction->setEnabled( true );
|
saveAsAction->setEnabled( true );
|
||||||
if( closeAction != NULL )
|
if( closeAction != NULL )
|
||||||
closeAction->setEnabled( true );
|
closeAction->setEnabled( true );
|
||||||
|
if( delAction != NULL )
|
||||||
|
{
|
||||||
|
delAction->setEnabled( true );
|
||||||
|
connect( delAction, SIGNAL( triggered( bool ) ), messageProcessor, SLOT( onDelete() ) );
|
||||||
|
}
|
||||||
|
|
||||||
QMenu *menu = mm->menu( Core::Constants::M_TOOLS );
|
QMenu *menu = mm->menu( Core::Constants::M_TOOLS );
|
||||||
if( menu != NULL )
|
if( menu != NULL )
|
||||||
|
@ -329,6 +380,10 @@ namespace GUIEditor
|
||||||
a = new QAction( "Project Window", this );
|
a = new QAction( "Project Window", this );
|
||||||
connect( a, SIGNAL( triggered( bool ) ), projectWindow, SLOT( show() ) );
|
connect( a, SIGNAL( triggered( bool ) ), projectWindow, SLOT( show() ) );
|
||||||
m->addAction( a );
|
m->addAction( a );
|
||||||
|
|
||||||
|
a = new QAction( "Add Widget", this );
|
||||||
|
connect( a, SIGNAL( triggered( bool ) ), this, SLOT( onAddWidgetClicked() ) );
|
||||||
|
m->addAction( a );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,8 @@ namespace GUIEditor
|
||||||
class ProjectWindow;
|
class ProjectWindow;
|
||||||
class NelGUIWidget;
|
class NelGUIWidget;
|
||||||
class CWidgetInfoTree;
|
class CWidgetInfoTree;
|
||||||
|
class CEditorMessageProcessor;
|
||||||
|
class AddWidgetWidget;
|
||||||
|
|
||||||
class GUIEditorWindow: public QMainWindow
|
class GUIEditorWindow: public QMainWindow
|
||||||
{
|
{
|
||||||
|
@ -58,6 +60,9 @@ public Q_SLOTS:
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void onProjectFilesChanged();
|
void onProjectFilesChanged();
|
||||||
|
void onGUILoaded();
|
||||||
|
void onAddWidgetClicked();
|
||||||
|
void onTreeChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createMenus();
|
void createMenus();
|
||||||
|
@ -76,8 +81,9 @@ private:
|
||||||
ProcList *procList;
|
ProcList *procList;
|
||||||
ProjectWindow *projectWindow;
|
ProjectWindow *projectWindow;
|
||||||
NelGUIWidget *viewPort;
|
NelGUIWidget *viewPort;
|
||||||
|
|
||||||
CWidgetInfoTree *widgetInfoTree;
|
CWidgetInfoTree *widgetInfoTree;
|
||||||
|
CEditorMessageProcessor *messageProcessor;
|
||||||
|
AddWidgetWidget *addWidgetWidget;
|
||||||
|
|
||||||
CPropBrowserCtrl browserCtrl;
|
CPropBrowserCtrl browserCtrl;
|
||||||
QString currentProject;
|
QString currentProject;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <QTimerEvent>
|
#include <QTimerEvent>
|
||||||
|
#include "editor_selection_watcher.h"
|
||||||
|
|
||||||
namespace GUIEditor
|
namespace GUIEditor
|
||||||
{
|
{
|
||||||
|
@ -37,6 +38,7 @@ namespace GUIEditor
|
||||||
{
|
{
|
||||||
timerID = 0;
|
timerID = 0;
|
||||||
guiLoaded = false;
|
guiLoaded = false;
|
||||||
|
watcher = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
NelGUIWidget::~NelGUIWidget()
|
NelGUIWidget::~NelGUIWidget()
|
||||||
|
@ -70,6 +72,8 @@ namespace GUIEditor
|
||||||
NLGUI::CViewRenderer::getInstance()->init();
|
NLGUI::CViewRenderer::getInstance()->init();
|
||||||
|
|
||||||
CWidgetManager::getInstance()->getParser()->setEditorMode( true );
|
CWidgetManager::getInstance()->getParser()->setEditorMode( true );
|
||||||
|
|
||||||
|
watcher = new CEditorSelectionWatcher();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NelGUIWidget::parse( SProjectFiles &files )
|
bool NelGUIWidget::parse( SProjectFiles &files )
|
||||||
|
@ -106,6 +110,8 @@ namespace GUIEditor
|
||||||
guiLoaded = true;
|
guiLoaded = true;
|
||||||
Q_EMIT guiLoadComplete();
|
Q_EMIT guiLoadComplete();
|
||||||
|
|
||||||
|
CWidgetManager::getInstance()->registerSelectionWatcher( watcher );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,6 +121,7 @@ namespace GUIEditor
|
||||||
if( timerID != 0 )
|
if( timerID != 0 )
|
||||||
killTimer( timerID );
|
killTimer( timerID );
|
||||||
timerID = 0;
|
timerID = 0;
|
||||||
|
CWidgetManager::getInstance()->unregisterSelectionWatcher( watcher );
|
||||||
CWidgetManager::getInstance()->reset();
|
CWidgetManager::getInstance()->reset();
|
||||||
CWidgetManager::getInstance()->getParser()->removeAll();
|
CWidgetManager::getInstance()->getParser()->removeAll();
|
||||||
CViewRenderer::getInstance()->reset();
|
CViewRenderer::getInstance()->reset();
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
namespace GUIEditor
|
namespace GUIEditor
|
||||||
{
|
{
|
||||||
|
class CEditorSelectionWatcher;
|
||||||
|
|
||||||
/// Qt viewport for the Nel GUI library
|
/// Qt viewport for the Nel GUI library
|
||||||
class NelGUIWidget : public Nel3DWidget
|
class NelGUIWidget : public Nel3DWidget
|
||||||
{
|
{
|
||||||
|
@ -35,6 +37,7 @@ namespace GUIEditor
|
||||||
bool parse( SProjectFiles &files );
|
bool parse( SProjectFiles &files );
|
||||||
void draw();
|
void draw();
|
||||||
void reset();
|
void reset();
|
||||||
|
CEditorSelectionWatcher* getWatcher(){ return watcher; }
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void guiLoadComplete();
|
void guiLoadComplete();
|
||||||
|
@ -49,6 +52,7 @@ Q_SIGNALS:
|
||||||
private:
|
private:
|
||||||
int timerID;
|
int timerID;
|
||||||
bool guiLoaded;
|
bool guiLoaded;
|
||||||
|
CEditorSelectionWatcher *watcher;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,12 @@ namespace GUIEditor
|
||||||
|
|
||||||
CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( id );
|
CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( id );
|
||||||
if( e == NULL )
|
if( e == NULL )
|
||||||
|
{
|
||||||
|
connect( propertyMgr, SIGNAL( propertyChanged( QtProperty* ) ),
|
||||||
|
this, SLOT( onPropertyChanged( QtProperty* ) ) );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
currentElement = id;
|
currentElement = id;
|
||||||
|
|
||||||
|
@ -106,6 +111,12 @@ namespace GUIEditor
|
||||||
if( e == NULL )
|
if( e == NULL )
|
||||||
return;
|
return;
|
||||||
e->setProperty( propName.toUtf8().constData(), propValue.toUtf8().constData() );
|
e->setProperty( propName.toUtf8().constData(), propValue.toUtf8().constData() );
|
||||||
|
|
||||||
|
|
||||||
|
// Make sure the changes are applied
|
||||||
|
bool active = e->getActive();
|
||||||
|
e->setActive( !active );
|
||||||
|
e->setActive( active );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPropBrowserCtrl::setupProperties( const std::string &type, const CInterfaceElement *element )
|
void CPropBrowserCtrl::setupProperties( const std::string &type, const CInterfaceElement *element )
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "widget_hierarchy.h"
|
#include "widget_hierarchy.h"
|
||||||
#include "nel/gui/interface_group.h"
|
#include "nel/gui/interface_group.h"
|
||||||
#include "nel/gui/widget_manager.h"
|
#include "nel/gui/widget_manager.h"
|
||||||
|
#include "nel/gui/widget_addition_watcher.h"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
@ -56,6 +57,45 @@ namespace
|
||||||
name = s.toUtf8().constData();
|
name = s.toUtf8().constData();
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CWidgetDeletionWatcher : public CInterfaceElement::IDeletionWatcher
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CWidgetDeletionWatcher(){ h = NULL; }
|
||||||
|
|
||||||
|
~CWidgetDeletionWatcher(){}
|
||||||
|
|
||||||
|
void onDeleted( const std::string &id ){
|
||||||
|
if( h != NULL )
|
||||||
|
h->onWidgetDeleted( id );
|
||||||
|
}
|
||||||
|
|
||||||
|
void setWidgetHierarchy( GUIEditor::WidgetHierarchy *h ){ this->h = h; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
GUIEditor::WidgetHierarchy *h;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CWidgetAdditionWatcher : public IWidgetAdditionWatcher
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CWidgetAdditionWatcher(){ h = NULL; }
|
||||||
|
~CWidgetAdditionWatcher(){}
|
||||||
|
|
||||||
|
void widgetAdded( const std::string &name )
|
||||||
|
{
|
||||||
|
if( h != NULL )
|
||||||
|
h->onWidgetAdded( name );
|
||||||
|
}
|
||||||
|
|
||||||
|
void setWidgetHierarchy( GUIEditor::WidgetHierarchy *h ){ this->h = h; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
GUIEditor::WidgetHierarchy *h;
|
||||||
|
};
|
||||||
|
|
||||||
|
CWidgetDeletionWatcher deletionWatcher;
|
||||||
|
CWidgetAdditionWatcher additionWatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace GUIEditor
|
namespace GUIEditor
|
||||||
|
@ -66,6 +106,8 @@ namespace GUIEditor
|
||||||
setupUi( this );
|
setupUi( this );
|
||||||
connect( widgetHT, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ),
|
connect( widgetHT, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ),
|
||||||
this, SLOT( onItemDblClicked( QTreeWidgetItem* ) ) );
|
this, SLOT( onItemDblClicked( QTreeWidgetItem* ) ) );
|
||||||
|
deletionWatcher.setWidgetHierarchy( this );
|
||||||
|
additionWatcher.setWidgetHierarchy( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
WidgetHierarchy::~WidgetHierarchy()
|
WidgetHierarchy::~WidgetHierarchy()
|
||||||
|
@ -74,12 +116,17 @@ namespace GUIEditor
|
||||||
|
|
||||||
void WidgetHierarchy::clearHierarchy()
|
void WidgetHierarchy::clearHierarchy()
|
||||||
{
|
{
|
||||||
|
CInterfaceElement::unregisterDeletionWatcher( &deletionWatcher );
|
||||||
|
CWidgetManager::getInstance()->unregisterAdditionWatcher( &additionWatcher );
|
||||||
widgetHT->clear();
|
widgetHT->clear();
|
||||||
|
widgetHierarchyMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetHierarchy::buildHierarchy( std::string &masterGroup )
|
void WidgetHierarchy::buildHierarchy( std::string &masterGroup )
|
||||||
{
|
{
|
||||||
clearHierarchy();
|
clearHierarchy();
|
||||||
|
CInterfaceElement::registerDeletionWatcher( &deletionWatcher );
|
||||||
|
CWidgetManager::getInstance()->registerAdditionWatcher( &additionWatcher );
|
||||||
|
|
||||||
CInterfaceGroup *mg = CWidgetManager::getInstance()->getMasterGroupFromId( masterGroup );
|
CInterfaceGroup *mg = CWidgetManager::getInstance()->getMasterGroupFromId( masterGroup );
|
||||||
if( mg != NULL )
|
if( mg != NULL )
|
||||||
|
@ -87,6 +134,7 @@ namespace GUIEditor
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem( static_cast<QTreeWidgetItem*>(NULL) );
|
QTreeWidgetItem *item = new QTreeWidgetItem( static_cast<QTreeWidgetItem*>(NULL) );
|
||||||
item->setText( 0, "ui" );
|
item->setText( 0, "ui" );
|
||||||
widgetHT->addTopLevelItem( item );
|
widgetHT->addTopLevelItem( item );
|
||||||
|
widgetHierarchyMap[ "ui" ] = item;
|
||||||
|
|
||||||
buildHierarchy( item, mg );
|
buildHierarchy( item, mg );
|
||||||
}
|
}
|
||||||
|
@ -96,7 +144,9 @@ namespace GUIEditor
|
||||||
{
|
{
|
||||||
// First add ourselves
|
// First add ourselves
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem( parent );
|
QTreeWidgetItem *item = new QTreeWidgetItem( parent );
|
||||||
|
|
||||||
item->setText( 0, makeNodeName( group->getId() ).c_str() );
|
item->setText( 0, makeNodeName( group->getId() ).c_str() );
|
||||||
|
widgetHierarchyMap[ group->getId() ] = item;
|
||||||
|
|
||||||
// Then add recursively our subgroups
|
// Then add recursively our subgroups
|
||||||
const std::vector< CInterfaceGroup* > &groups = group->getGroups();
|
const std::vector< CInterfaceGroup* > &groups = group->getGroups();
|
||||||
|
@ -113,6 +163,7 @@ namespace GUIEditor
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *subItem = new QTreeWidgetItem( item );
|
QTreeWidgetItem *subItem = new QTreeWidgetItem( item );
|
||||||
subItem->setText( 0, makeNodeName( (*citr)->getId() ).c_str() );
|
subItem->setText( 0, makeNodeName( (*citr)->getId() ).c_str() );
|
||||||
|
widgetHierarchyMap[ (*citr)->getId() ] = subItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add our views
|
// Add our views
|
||||||
|
@ -122,14 +173,134 @@ namespace GUIEditor
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *subItem = new QTreeWidgetItem( item );
|
QTreeWidgetItem *subItem = new QTreeWidgetItem( item );
|
||||||
subItem->setText( 0, makeNodeName( (*vitr)->getId() ).c_str() );
|
subItem->setText( 0, makeNodeName( (*vitr)->getId() ).c_str() );
|
||||||
|
widgetHierarchyMap[ (*vitr)->getId() ] = subItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WidgetHierarchy::onWidgetDeleted( const std::string &id )
|
||||||
|
{
|
||||||
|
std::map< std::string, QTreeWidgetItem* >::iterator itr
|
||||||
|
= widgetHierarchyMap.find( id );
|
||||||
|
if( itr == widgetHierarchyMap.end() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( widgetHT->currentItem() == itr->second )
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *item = itr->second;
|
||||||
|
QTreeWidgetItem *p = item;
|
||||||
|
|
||||||
|
// Deselect item
|
||||||
|
item->setSelected( false );
|
||||||
|
widgetHT->setCurrentItem( NULL );
|
||||||
|
|
||||||
|
// Collapse the tree
|
||||||
|
while( p != NULL )
|
||||||
|
{
|
||||||
|
p->setExpanded( false );
|
||||||
|
p = p->parent();
|
||||||
|
}
|
||||||
|
|
||||||
|
currentSelection = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
itr->second->setSelected( false );
|
||||||
|
|
||||||
|
delete itr->second;
|
||||||
|
itr->second = NULL;
|
||||||
|
widgetHierarchyMap.erase( itr );
|
||||||
|
}
|
||||||
|
|
||||||
|
void WidgetHierarchy::onWidgetAdded( const std::string &id )
|
||||||
|
{
|
||||||
|
// Get the parent's name
|
||||||
|
std::string::size_type p = id.find_last_of( ':' );
|
||||||
|
if( p == std::string::npos )
|
||||||
|
return;
|
||||||
|
std::string parentId = id.substr( 0, p );
|
||||||
|
|
||||||
|
// Do we have the parent in the hierarchy?
|
||||||
|
std::map< std::string, QTreeWidgetItem* >::iterator itr
|
||||||
|
= widgetHierarchyMap.find( parentId );
|
||||||
|
if( itr == widgetHierarchyMap.end() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Add the new widget to the hierarchy
|
||||||
|
QTreeWidgetItem *parent = itr->second;
|
||||||
|
QTreeWidgetItem *item = new QTreeWidgetItem( parent );
|
||||||
|
item->setText( 0, makeNodeName( id ).c_str() );
|
||||||
|
widgetHierarchyMap[ id ] = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WidgetHierarchy::getCurrentGroup( QString &g )
|
||||||
|
{
|
||||||
|
std::string s = CWidgetManager::getInstance()->getCurrentEditorSelection();
|
||||||
|
if( s.empty() )
|
||||||
|
{
|
||||||
|
g = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
NLGUI::CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( s );
|
||||||
|
if( e == NULL )
|
||||||
|
{
|
||||||
|
g = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( e->isGroup() )
|
||||||
|
{
|
||||||
|
g = e->getId().c_str();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
NLGUI::CInterfaceGroup *p = e->getParent();
|
||||||
|
if( p == NULL )
|
||||||
|
{
|
||||||
|
g = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g = p->getId().c_str();
|
||||||
|
}
|
||||||
|
|
||||||
void WidgetHierarchy::onGUILoaded()
|
void WidgetHierarchy::onGUILoaded()
|
||||||
{
|
{
|
||||||
if( masterGroup.empty() )
|
if( masterGroup.empty() )
|
||||||
return;
|
return;
|
||||||
buildHierarchy( masterGroup );
|
buildHierarchy( masterGroup );
|
||||||
|
currentSelection.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void WidgetHierarchy::onSelectionChanged( std::string &newSelection )
|
||||||
|
{
|
||||||
|
if( newSelection == currentSelection )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( newSelection.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::map< std::string, QTreeWidgetItem* >::iterator itr =
|
||||||
|
widgetHierarchyMap.find( newSelection );
|
||||||
|
if( itr == widgetHierarchyMap.end() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// deselect current item
|
||||||
|
if( widgetHT->currentItem() != NULL )
|
||||||
|
widgetHT->currentItem()->setSelected( false );
|
||||||
|
|
||||||
|
// expand the tree items, so that we can see the selected item
|
||||||
|
QTreeWidgetItem *item = itr->second;
|
||||||
|
QTreeWidgetItem *currItem = item;
|
||||||
|
while( currItem != NULL )
|
||||||
|
{
|
||||||
|
currItem->setExpanded( true );
|
||||||
|
currItem = currItem->parent();
|
||||||
|
}
|
||||||
|
|
||||||
|
// select the current item
|
||||||
|
item->setSelected( true );
|
||||||
|
widgetHT->setCurrentItem( item );
|
||||||
|
currentSelection = newSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetHierarchy::onItemDblClicked( QTreeWidgetItem *item )
|
void WidgetHierarchy::onItemDblClicked( QTreeWidgetItem *item )
|
||||||
|
@ -138,9 +309,7 @@ namespace GUIEditor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::string n = item->text( 0 ).toUtf8().constData();
|
std::string n = item->text( 0 ).toUtf8().constData();
|
||||||
std::string selection = makeFullName( item, n );
|
currentSelection = makeFullName( item, n );
|
||||||
CWidgetManager::getInstance()->setCurrentEditorSelection( selection );
|
CWidgetManager::getInstance()->setCurrentEditorSelection( currentSelection );
|
||||||
|
|
||||||
Q_EMIT selectionChanged( selection );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
#define WIDGET_HA_H
|
#define WIDGET_HA_H
|
||||||
|
|
||||||
#include "ui_widget_hierarchy.h"
|
#include "ui_widget_hierarchy.h"
|
||||||
|
#include <string>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
namespace NLGUI
|
namespace NLGUI
|
||||||
{
|
{
|
||||||
|
@ -40,11 +42,17 @@ namespace GUIEditor
|
||||||
void clearHierarchy();
|
void clearHierarchy();
|
||||||
void buildHierarchy( std::string &masterGroup );
|
void buildHierarchy( std::string &masterGroup );
|
||||||
|
|
||||||
|
void onWidgetDeleted( const std::string &id );
|
||||||
|
void onWidgetAdded( const std::string &id );
|
||||||
|
|
||||||
|
void getCurrentGroup( QString &g );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void buildHierarchy( QTreeWidgetItem *parent, NLGUI::CInterfaceGroup *group );
|
void buildHierarchy( QTreeWidgetItem *parent, NLGUI::CInterfaceGroup *group );
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void onGUILoaded();
|
void onGUILoaded();
|
||||||
|
void onSelectionChanged( std::string &newSelection );
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void onItemDblClicked( QTreeWidgetItem *item );
|
void onItemDblClicked( QTreeWidgetItem *item );
|
||||||
|
@ -52,9 +60,7 @@ namespace GUIEditor
|
||||||
private:
|
private:
|
||||||
std::string currentSelection;
|
std::string currentSelection;
|
||||||
std::string masterGroup;
|
std::string masterGroup;
|
||||||
|
std::map< std::string, QTreeWidgetItem* > widgetHierarchyMap;
|
||||||
Q_SIGNALS:
|
|
||||||
void selectionChanged( std::string &id );
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ namespace GUIEditor
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string GUIName;
|
std::string GUIName;
|
||||||
|
std::string className;
|
||||||
std::string ancestor;
|
std::string ancestor;
|
||||||
std::string description;
|
std::string description;
|
||||||
bool isAbstract;
|
bool isAbstract;
|
||||||
|
|
|
@ -63,6 +63,7 @@ namespace GUIEditor
|
||||||
f << "\t<header>" << std::endl;
|
f << "\t<header>" << std::endl;
|
||||||
f << "\t\t<name>" << info.name << "</name>" << std::endl;
|
f << "\t\t<name>" << info.name << "</name>" << std::endl;
|
||||||
f << "\t\t<guiname>" << info.GUIName << "</guiname>" << std::endl;
|
f << "\t\t<guiname>" << info.GUIName << "</guiname>" << std::endl;
|
||||||
|
f << "\t\t<classname>" << info.className << "</classname>" << std::endl;
|
||||||
f << "\t\t<ancestor>" << info.ancestor << "</ancestor>" << std::endl;
|
f << "\t\t<ancestor>" << info.ancestor << "</ancestor>" << std::endl;
|
||||||
f << "\t\t<description>" << info.description << "</description>" << std::endl;
|
f << "\t\t<description>" << info.description << "</description>" << std::endl;
|
||||||
|
|
||||||
|
|
|
@ -93,11 +93,11 @@ namespace GUIEditor
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the node names and put them into the vector
|
/// Get the node names and put them into the vector
|
||||||
void getNames( std::vector< std::string > &v ) const
|
void getNames( std::vector< std::string > &v, bool includeAbstract = true ) const
|
||||||
{
|
{
|
||||||
if( root == NULL )
|
if( root == NULL )
|
||||||
return;
|
return;
|
||||||
root->getNames( v );
|
root->getNames( v, includeAbstract );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -215,11 +215,13 @@ namespace GUIEditor
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the node names and put them into the vector
|
/// Get the node names and put them into the vector
|
||||||
void getNames( std::vector< std::string > &v ) const
|
void getNames( std::vector< std::string > &v, bool includeAbstract = true ) const
|
||||||
{
|
{
|
||||||
v.push_back( info.name );
|
if( !info.isAbstract || ( info.isAbstract && includeAbstract ) )
|
||||||
|
v.push_back( info.name );
|
||||||
|
|
||||||
for( std::vector< CWidgetInfoTreeNode* >::const_iterator itr = children.begin(); itr != children.end(); ++itr )
|
for( std::vector< CWidgetInfoTreeNode* >::const_iterator itr = children.begin(); itr != children.end(); ++itr )
|
||||||
( *itr )->getNames( v );
|
( *itr )->getNames( v, includeAbstract );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Accepts a visitor to itself and to the children nodes
|
/// Accepts a visitor to itself and to the children nodes
|
||||||
|
|
|
@ -84,6 +84,7 @@ namespace GUIEditor{
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tree->removeNode( widgetName.toUtf8().constData() );
|
tree->removeNode( widgetName.toUtf8().constData() );
|
||||||
|
Q_EMIT treeChanged();
|
||||||
widgetPropTree->clear();
|
widgetPropTree->clear();
|
||||||
buildWidgetList();
|
buildWidgetList();
|
||||||
}
|
}
|
||||||
|
@ -156,6 +157,7 @@ namespace GUIEditor{
|
||||||
void CWidgetProperties::onWidgetAdded()
|
void CWidgetProperties::onWidgetAdded()
|
||||||
{
|
{
|
||||||
buildWidgetList();
|
buildWidgetList();
|
||||||
|
Q_EMIT treeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWidgetProperties::buildWidgetList()
|
void CWidgetProperties::buildWidgetList()
|
||||||
|
|
|
@ -74,6 +74,9 @@ namespace GUIEditor
|
||||||
CWidgetInfoTree *tree;
|
CWidgetInfoTree *tree;
|
||||||
NewPropertyWidget *newPropertyWidget;
|
NewPropertyWidget *newPropertyWidget;
|
||||||
NewWidgetWidget *newWidgetWidget;
|
NewWidgetWidget *newWidgetWidget;
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void treeChanged();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,9 @@ namespace GUIEditor
|
||||||
if( key == "guiname" )
|
if( key == "guiname" )
|
||||||
info.GUIName = value.toUtf8().constData();
|
info.GUIName = value.toUtf8().constData();
|
||||||
else
|
else
|
||||||
|
if( key == "classname" )
|
||||||
|
info.className = value.toUtf8().constData();
|
||||||
|
else
|
||||||
if( key == "ancestor" )
|
if( key == "ancestor" )
|
||||||
info.ancestor = value.toUtf8().constData();
|
info.ancestor = value.toUtf8().constData();
|
||||||
else
|
else
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<property>
|
<property>
|
||||||
<name>button_type</name>
|
<name>button_type</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default>toggle_button</default>
|
<default>push_button</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>pushed</name>
|
<name>pushed</name>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>CtrlButton</name>
|
<name>CtrlButton</name>
|
||||||
<guiname>CCtrlButton</guiname>
|
<guiname>CCtrlButton</guiname>
|
||||||
|
<classname>button</classname>
|
||||||
<ancestor>CtrlBaseButton</ancestor>
|
<ancestor>CtrlBaseButton</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
@ -11,17 +12,17 @@
|
||||||
<property>
|
<property>
|
||||||
<name>tx_normal</name>
|
<name>tx_normal</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>log_but_r.tga</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>tx_pushed</name>
|
<name>tx_pushed</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>log_but_r.tga</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>tx_over</name>
|
<name>tx_over</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>log_but_over_r.tga</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>scale</name>
|
<name>scale</name>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>CtrlColPick</name>
|
<name>CtrlColPick</name>
|
||||||
<guiname>CCtrlColPick</guiname>
|
<guiname>CCtrlColPick</guiname>
|
||||||
|
<classname>colpick</classname>
|
||||||
<ancestor>CtrlBase</ancestor>
|
<ancestor>CtrlBase</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>CtrlScroll</name>
|
<name>CtrlScroll</name>
|
||||||
<guiname>CCtrlScroll</guiname>
|
<guiname>CCtrlScroll</guiname>
|
||||||
|
<classname>scroll</classname>
|
||||||
<ancestor>CtrlBase</ancestor>
|
<ancestor>CtrlBase</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>CtrlTextButton</name>
|
<name>CtrlTextButton</name>
|
||||||
<guiname>CCtrlTextButton</guiname>
|
<guiname>CCtrlTextButton</guiname>
|
||||||
|
<classname>text_button</classname>
|
||||||
<ancestor>CtrlBaseButton</ancestor>
|
<ancestor>CtrlBaseButton</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
@ -11,27 +12,27 @@
|
||||||
<property>
|
<property>
|
||||||
<name>tx_normal</name>
|
<name>tx_normal</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>but</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>tx_pushed</name>
|
<name>tx_pushed</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>but</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>tx_over</name>
|
<name>tx_over</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>but_over</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>hardtext</name>
|
<name>hardtext</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>text</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>wmargin</name>
|
<name>wmargin</name>
|
||||||
<type>int</type>
|
<type>int</type>
|
||||||
<default>0</default>
|
<default>20</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>wmin</name>
|
<name>wmin</name>
|
||||||
|
@ -151,7 +152,7 @@
|
||||||
<property>
|
<property>
|
||||||
<name>line_maxw</name>
|
<name>line_maxw</name>
|
||||||
<type>int</type>
|
<type>int</type>
|
||||||
<default>0</default>
|
<default>200</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>multi_line_space</name>
|
<name>multi_line_space</name>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>DBGroupSelectNumber</name>
|
<name>DBGroupSelectNumber</name>
|
||||||
<guiname>CDBGroupSelectNumber</guiname>
|
<guiname>CDBGroupSelectNumber</guiname>
|
||||||
|
<classname>select_number</classname>
|
||||||
<ancestor>InterfaceGroup</ancestor>
|
<ancestor>InterfaceGroup</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>DBViewBar</name>
|
<name>DBViewBar</name>
|
||||||
<guiname>CDBViewBar</guiname>
|
<guiname>CDBViewBar</guiname>
|
||||||
|
<classname>bar</classname>
|
||||||
<ancestor>ViewBitmap</ancestor>
|
<ancestor>ViewBitmap</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>DBViewBar3</name>
|
<name>DBViewBar3</name>
|
||||||
<guiname>CDBViewBar3</guiname>
|
<guiname>CDBViewBar3</guiname>
|
||||||
|
<classname>bar3</classname>
|
||||||
<ancestor>ViewBitmap</ancestor>
|
<ancestor>ViewBitmap</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>DBViewDigit</name>
|
<name>DBViewDigit</name>
|
||||||
<guiname>CDBViewDigit</guiname>
|
<guiname>CDBViewDigit</guiname>
|
||||||
|
<classname>digit</classname>
|
||||||
<ancestor>CtrlBase</ancestor>
|
<ancestor>CtrlBase</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
@ -11,7 +12,7 @@
|
||||||
<property>
|
<property>
|
||||||
<name>value</name>
|
<name>value</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>0</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>numdigit</name>
|
<name>numdigit</name>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>DBViewNumber</name>
|
<name>DBViewNumber</name>
|
||||||
<guiname>CDBViewNumber</guiname>
|
<guiname>CDBViewNumber</guiname>
|
||||||
|
<classname>text_number</classname>
|
||||||
<ancestor>ViewText</ancestor>
|
<ancestor>ViewText</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
@ -11,7 +12,7 @@
|
||||||
<property>
|
<property>
|
||||||
<name>value</name>
|
<name>value</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>0</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>positive</name>
|
<name>positive</name>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>DBViewQuantity</name>
|
<name>DBViewQuantity</name>
|
||||||
<guiname>CDBViewQuantity</guiname>
|
<guiname>CDBViewQuantity</guiname>
|
||||||
|
<classname>text_quantity</classname>
|
||||||
<ancestor>ViewText</ancestor>
|
<ancestor>ViewText</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
@ -11,17 +12,17 @@
|
||||||
<property>
|
<property>
|
||||||
<name>value</name>
|
<name>value</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>0</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>valuemax</name>
|
<name>valuemax</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>100</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>emptytext</name>
|
<name>emptytext</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>empty text</default>
|
||||||
</property>
|
</property>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>GroupContainer</name>
|
<name>GroupContainer</name>
|
||||||
<guiname>CGroupContainer</guiname>
|
<guiname>CGroupContainer</guiname>
|
||||||
|
<classname>container</classname>
|
||||||
<ancestor>InterfaceGroup</ancestor>
|
<ancestor>InterfaceGroup</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>GroupEditBox</name>
|
<name>GroupEditBox</name>
|
||||||
<guiname>CGroupEditBox</guiname>
|
<guiname>CGroupEditBox</guiname>
|
||||||
|
<classname>edit_box</classname>
|
||||||
<ancestor>InterfaceGroup</ancestor>
|
<ancestor>InterfaceGroup</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>GroupHTML</name>
|
<name>GroupHTML</name>
|
||||||
<guiname>CGroupHTML</guiname>
|
<guiname>CGroupHTML</guiname>
|
||||||
|
<classname>html</classname>
|
||||||
<ancestor>GroupScrollText</ancestor>
|
<ancestor>GroupScrollText</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>GroupHeader</name>
|
<name>GroupHeader</name>
|
||||||
<guiname>CGroupHeader</guiname>
|
<guiname>CGroupHeader</guiname>
|
||||||
|
<classname>header</classname>
|
||||||
<ancestor>GroupList</ancestor>
|
<ancestor>GroupList</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>GroupList</name>
|
<name>GroupList</name>
|
||||||
<guiname>CGroupList</guiname>
|
<guiname>CGroupList</guiname>
|
||||||
|
<classname>list</classname>
|
||||||
<ancestor>InterfaceGroup</ancestor>
|
<ancestor>InterfaceGroup</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>GroupMenu</name>
|
<name>GroupMenu</name>
|
||||||
<guiname>CGroupMenu</guiname>
|
<guiname>CGroupMenu</guiname>
|
||||||
|
<classname>menu</classname>
|
||||||
<ancestor>GroupModal</ancestor>
|
<ancestor>GroupModal</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>GroupModal</name>
|
<name>GroupModal</name>
|
||||||
<guiname>CGroupModal</guiname>
|
<guiname>CGroupModal</guiname>
|
||||||
|
<classname>modal</classname>
|
||||||
<ancestor>GroupFrame</ancestor>
|
<ancestor>GroupFrame</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>GroupScrollText</name>
|
<name>GroupScrollText</name>
|
||||||
<guiname>CGroupScrollText</guiname>
|
<guiname>CGroupScrollText</guiname>
|
||||||
|
<classname>scroll_text</classname>
|
||||||
<ancestor>InterfaceGroup</ancestor>
|
<ancestor>InterfaceGroup</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>GroupTab</name>
|
<name>GroupTab</name>
|
||||||
<guiname>CGroupTab</guiname>
|
<guiname>CGroupTab</guiname>
|
||||||
|
<classname>tab</classname>
|
||||||
<ancestor>InterfaceGroup</ancestor>
|
<ancestor>InterfaceGroup</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>GroupTable</name>
|
<name>GroupTable</name>
|
||||||
<guiname>CGroupTable</guiname>
|
<guiname>CGroupTable</guiname>
|
||||||
|
<classname>table</classname>
|
||||||
<ancestor>InterfaceGroup</ancestor>
|
<ancestor>InterfaceGroup</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>GroupTree</name>
|
<name>GroupTree</name>
|
||||||
<guiname>CGroupTree</guiname>
|
<guiname>CGroupTree</guiname>
|
||||||
|
<classname>tree</classname>
|
||||||
<ancestor>InterfaceGroup</ancestor>
|
<ancestor>InterfaceGroup</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>InterfaceGroup</name>
|
<name>InterfaceGroup</name>
|
||||||
<guiname>CInterfaceGroup</guiname>
|
<guiname>CInterfaceGroup</guiname>
|
||||||
|
<classname>interface_group</classname>
|
||||||
<ancestor>CtrlBase</ancestor>
|
<ancestor>CtrlBase</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>InterfaceGroupWheel</name>
|
<name>InterfaceGroupWheel</name>
|
||||||
<guiname>CInterfaceGroupWheel</guiname>
|
<guiname>CInterfaceGroupWheel</guiname>
|
||||||
|
<classname>group_wheel</classname>
|
||||||
<ancestor>InterfaceGroup</ancestor>
|
<ancestor>InterfaceGroup</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>ViewBitmap</name>
|
<name>ViewBitmap</name>
|
||||||
<guiname>CViewBitmap</guiname>
|
<guiname>CViewBitmap</guiname>
|
||||||
|
<classname>bitmap</classname>
|
||||||
<ancestor>CtrlBase</ancestor>
|
<ancestor>CtrlBase</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>ViewBitmapCombo</name>
|
<name>ViewBitmapCombo</name>
|
||||||
<guiname>CViewBitmapCombo</guiname>
|
<guiname>CViewBitmapCombo</guiname>
|
||||||
|
<classname>bitmap_combo</classname>
|
||||||
<ancestor>CtrlBase</ancestor>
|
<ancestor>CtrlBase</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>ViewText</name>
|
<name>ViewText</name>
|
||||||
<guiname>CViewText</guiname>
|
<guiname>CViewText</guiname>
|
||||||
|
<classname>text</classname>
|
||||||
<ancestor>InterfaceElement</ancestor>
|
<ancestor>InterfaceElement</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
@ -46,7 +47,7 @@
|
||||||
<property>
|
<property>
|
||||||
<name>line_maxw</name>
|
<name>line_maxw</name>
|
||||||
<type>int</type>
|
<type>int</type>
|
||||||
<default>0</default>
|
<default>100</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>multi_line_space</name>
|
<name>multi_line_space</name>
|
||||||
|
@ -101,7 +102,7 @@
|
||||||
<property>
|
<property>
|
||||||
<name>hardtext</name>
|
<name>hardtext</name>
|
||||||
<type>string</type>
|
<type>string</type>
|
||||||
<default></default>
|
<default>some text</default>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>hardtext_format</name>
|
<name>hardtext_format</name>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>ViewTextFormated</name>
|
<name>ViewTextFormated</name>
|
||||||
<guiname>CViewTextFormated</guiname>
|
<guiname>CViewTextFormated</guiname>
|
||||||
|
<classname>text_formated</classname>
|
||||||
<ancestor>ViewText</ancestor>
|
<ancestor>ViewText</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>ViewTextID</name>
|
<name>ViewTextID</name>
|
||||||
<guiname>CViewTextID</guiname>
|
<guiname>CViewTextID</guiname>
|
||||||
|
<classname>text_id</classname>
|
||||||
<ancestor>ViewText</ancestor>
|
<ancestor>ViewText</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<header>
|
<header>
|
||||||
<name>ViewTextIDFormated</name>
|
<name>ViewTextIDFormated</name>
|
||||||
<guiname>CViewTextIDFormated</guiname>
|
<guiname>CViewTextIDFormated</guiname>
|
||||||
|
<classname>text_id_formated</classname>
|
||||||
<ancestor>ViewTextID</ancestor>
|
<ancestor>ViewTextID</ancestor>
|
||||||
<description></description>
|
<description></description>
|
||||||
<abstract>false</abstract>
|
<abstract>false</abstract>
|
||||||
|
|
|
@ -55,5 +55,20 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_landscape_editor)
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DLANDSCAPE_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
ADD_DEFINITIONS(-DLANDSCAPE_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
|
||||||
#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_landscape_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
|
||||||
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_landscape_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
|
@ -36,6 +36,20 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_log)
|
||||||
|
|
||||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
|
||||||
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_log.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_log.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,21 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_mission_compiler)
|
||||||
|
|
||||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_mission_compiler.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_mission_compiler.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
||||||
|
|
|
@ -196,6 +196,21 @@ IF(WITH_PCH)
|
||||||
ADD_NATIVE_PRECOMPILED_HEADER(ovqt_plugin_object_viewer ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
|
ADD_NATIVE_PRECOMPILED_HEADER(ovqt_plugin_object_viewer ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
|
||||||
ENDIF(WITH_PCH)
|
ENDIF(WITH_PCH)
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_object_viewer.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_object_viewer.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,20 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_sheet_builder)
|
||||||
|
|
||||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
|
||||||
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_sheet_builder.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_sheet_builder.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,19 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_translation_manager)
|
||||||
|
|
||||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_translation_manager.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_translation_manager.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,19 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_world_editor)
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DWORLD_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
ADD_DEFINITIONS(-DWORLD_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_world_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_world_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,20 @@ NL_ADD_LIB_SUFFIX(ovqt_plugin_zone_painter)
|
||||||
|
|
||||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
INSTALL(TARGETS ovqt_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} ARCHIVE DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
|
||||||
|
IF(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ELSE(WIN32)
|
||||||
|
IF(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ELSE(WITH_INSTALL_LIBRARIES)
|
||||||
|
INSTALL(TARGETS ovqt_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)
|
||||||
|
ENDIF(WITH_INSTALL_LIBRARIES)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_zone_painter.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_zone_painter.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d)
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time)
|
||||||
{
|
{
|
||||||
bool tempBRet = bRet;
|
bool tempBRet = bRet;
|
||||||
bRet = false;
|
bRet = false;
|
||||||
// delete pShape; // FIXME: there is a delete bug with CMeshMultiLod exported from max!!!
|
delete pShape;
|
||||||
bRet = tempBRet;
|
bRet = tempBRet;
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
|
|
|
@ -99,7 +99,7 @@ bool SLightBuild::canConvertFromMaxLight (INode *node, TimeValue tvTime)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( deleteIt )
|
if( deleteIt )
|
||||||
maxLight->MaybeAutoDelete();
|
maxLight->DeleteThis();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -305,7 +305,7 @@ void SLightBuild::convertFromMaxLight (INode *node,TimeValue tvTime)
|
||||||
this->rSoftShadowConeLength = (float)atof(sTmp.c_str());
|
this->rSoftShadowConeLength = (float)atof(sTmp.c_str());
|
||||||
|
|
||||||
if( deleteIt )
|
if( deleteIt )
|
||||||
maxLight->MaybeAutoDelete();
|
maxLight->DeleteThis();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***********************************************************************************************
|
// ***********************************************************************************************
|
||||||
|
|
|
@ -135,7 +135,7 @@ CCollisionMeshBuild* CExportNel::createCollisionMeshBuild(std::vector<INode *> &
|
||||||
|
|
||||||
// Delete the triObject if we should...
|
// Delete the triObject if we should...
|
||||||
if (deleteIt)
|
if (deleteIt)
|
||||||
tri->MaybeAutoDelete();
|
tri->DeleteThis();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,10 @@ IShape* CExportNel::buildFlare(INode& node, TimeValue time)
|
||||||
CExportNel::getValueByNameUsingParamBlock2(node, "PersistenceParam", (ParamType2)TYPE_FLOAT, &persistence, 0);
|
CExportNel::getValueByNameUsingParamBlock2(node, "PersistenceParam", (ParamType2)TYPE_FLOAT, &persistence, 0);
|
||||||
fshape->setPersistence(persistence);
|
fshape->setPersistence(persistence);
|
||||||
// retrieve spacing of the flare
|
// retrieve spacing of the flare
|
||||||
CExportNel::getValueByNameUsingParamBlock2(node, "Spacing", (ParamType2)TYPE_FLOAT, &spacing, 0);
|
bool hasSpacing = CExportNel::getValueByNameUsingParamBlock2(node, "Spacing", (ParamType2)TYPE_FLOAT, &spacing, 0)
|
||||||
fshape->setFlareSpacing(spacing);
|
|| CExportNel::getValueByNameUsingParamBlock2(node, "spacing", (ParamType2)TYPE_FLOAT, &spacing, 0);
|
||||||
|
if (hasSpacing) fshape->setFlareSpacing(spacing);
|
||||||
|
else nlwarning("FAILED CFlareShape Spacing");
|
||||||
// retrieve use of radial attenuation
|
// retrieve use of radial attenuation
|
||||||
CExportNel::getValueByNameUsingParamBlock2(node, "Attenuable", (ParamType2) TYPE_BOOL, &attenuable, 0);
|
CExportNel::getValueByNameUsingParamBlock2(node, "Attenuable", (ParamType2) TYPE_BOOL, &attenuable, 0);
|
||||||
if (attenuable)
|
if (attenuable)
|
||||||
|
|
|
@ -238,7 +238,7 @@ void CExportNel::getLights (std::vector<CLight>& vectLight, TimeValue time, INod
|
||||||
|
|
||||||
// Delete the GenLight if we should...
|
// Delete the GenLight if we should...
|
||||||
if (deleteIt)
|
if (deleteIt)
|
||||||
maxLight->MaybeAutoDelete();
|
maxLight->DeleteThis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@ bool CExportNel::buildLodCharacter (NL3D::CLodCharacterShapeBuild& lodBuild, IN
|
||||||
|
|
||||||
// Delete the triObject if we should...
|
// Delete the triObject if we should...
|
||||||
if (deleteIt)
|
if (deleteIt)
|
||||||
tri->MaybeAutoDelete();
|
tri->DeleteThis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "export_nel.h"
|
#include "export_nel.h"
|
||||||
#include "../tile_utility/tile_utility.h"
|
#include "../tile_utility/tile_utility.h"
|
||||||
|
#include "nel/misc/path.h"
|
||||||
#include "nel/3d/texture_file.h"
|
#include "nel/3d/texture_file.h"
|
||||||
#include "nel/3d/texture_multi_file.h"
|
#include "nel/3d/texture_multi_file.h"
|
||||||
#include "nel/3d/texture_cube.h"
|
#include "nel/3d/texture_cube.h"
|
||||||
|
@ -1139,9 +1140,9 @@ int CExportNel::getVertMapChannel (Texmap& texmap, Matrix3& channelMatrix, TimeV
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the absolute or relative path from a texture filename
|
// get the absolute or relative path from a texture filename
|
||||||
static std::string ConvertTexFileName(const char *src, bool _AbsolutePath)
|
static std::string ConvertTexFileName(const std::string &path, bool _AbsolutePath)
|
||||||
{
|
{
|
||||||
// File name, maxlen 256 under windows
|
/*// File name, maxlen 256 under windows
|
||||||
char sFileName[512];
|
char sFileName[512];
|
||||||
strcpy (sFileName, src);
|
strcpy (sFileName, src);
|
||||||
|
|
||||||
|
@ -1156,7 +1157,15 @@ static std::string ConvertTexFileName(const char *src, bool _AbsolutePath)
|
||||||
// Make the final path
|
// Make the final path
|
||||||
_makepath (sFileName, NULL, NULL, sName, sExt);
|
_makepath (sFileName, NULL, NULL, sName, sExt);
|
||||||
}
|
}
|
||||||
return std::string(sFileName);
|
return std::string(sFileName);*/
|
||||||
|
if (_AbsolutePath)
|
||||||
|
{
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NLMISC::CFile::getFilename(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build a NeL texture corresponding with a max Texmap.
|
// Build a NeL texture corresponding with a max Texmap.
|
||||||
|
@ -1243,7 +1252,7 @@ ITexture* CExportNel::buildATexture (Texmap& texmap, CMaterialDesc &remap3dsTexC
|
||||||
if (l == 1 && !fileName[0].empty())
|
if (l == 1 && !fileName[0].empty())
|
||||||
{
|
{
|
||||||
srcTex = new CTextureFile;
|
srcTex = new CTextureFile;
|
||||||
static_cast<CTextureFile *>(srcTex)->setFileName (ConvertTexFileName(fileName[0].c_str(), _AbsolutePath));
|
static_cast<CTextureFile *>(srcTex)->setFileName (ConvertTexFileName(fileName[0], _AbsolutePath));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1253,7 +1262,8 @@ ITexture* CExportNel::buildATexture (Texmap& texmap, CMaterialDesc &remap3dsTexC
|
||||||
if (!fileName[k].empty())
|
if (!fileName[k].empty())
|
||||||
{
|
{
|
||||||
/// set the name of the texture after converting it
|
/// set the name of the texture after converting it
|
||||||
static_cast<CTextureMultiFile *>(srcTex)->setFileName(k, ConvertTexFileName(fileName[k].c_str(), _AbsolutePath).c_str());
|
std::string convertMultiTex = ConvertTexFileName(fileName[k], _AbsolutePath);
|
||||||
|
static_cast<CTextureMultiFile *>(srcTex)->setFileName(k, convertMultiTex.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1261,7 +1271,8 @@ ITexture* CExportNel::buildATexture (Texmap& texmap, CMaterialDesc &remap3dsTexC
|
||||||
else // standard texture
|
else // standard texture
|
||||||
{
|
{
|
||||||
srcTex = new CTextureFile;
|
srcTex = new CTextureFile;
|
||||||
static_cast<CTextureFile *>(srcTex)->setFileName (ConvertTexFileName(pBitmap->GetMapName(), _AbsolutePath));
|
std::string mapName = pBitmap->GetMapName();
|
||||||
|
static_cast<CTextureFile *>(srcTex)->setFileName (ConvertTexFileName(mapName, _AbsolutePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2) Use this texture 'as it', or duplicate it to create the faces of a cube map
|
// 2) Use this texture 'as it', or duplicate it to create the faces of a cube map
|
||||||
|
@ -1361,7 +1372,7 @@ NL3D::CTextureCube *CExportNel::buildTextureCubeFromReflectRefract(Texmap &texma
|
||||||
CTextureFile *pT = new CTextureFile();
|
CTextureFile *pT = new CTextureFile();
|
||||||
|
|
||||||
// Set the file name
|
// Set the file name
|
||||||
pT->setFileName(ConvertTexFileName(names[i].c_str(), _AbsolutePath));
|
pT->setFileName(ConvertTexFileName(names[i], _AbsolutePath));
|
||||||
|
|
||||||
// Set the texture
|
// Set the texture
|
||||||
pTextureCube->setTexture(tfNewOrder[i], pT);
|
pTextureCube->setTexture(tfNewOrder[i], pT);
|
||||||
|
|
|
@ -110,7 +110,7 @@ CMesh::CMeshBuild* CExportNel::createMeshBuild(INode& node, TimeValue tvTime, CM
|
||||||
|
|
||||||
// Delete the triObject if we should...
|
// Delete the triObject if we should...
|
||||||
if (deleteIt)
|
if (deleteIt)
|
||||||
tri->MaybeAutoDelete();
|
tri->DeleteThis();
|
||||||
tri = NULL;
|
tri = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -449,7 +449,7 @@ NL3D::IShape *CExportNel::buildShape (INode& node, TimeValue time, const TInodeP
|
||||||
|
|
||||||
// Delete the triObject if we should...
|
// Delete the triObject if we should...
|
||||||
if (deleteIt)
|
if (deleteIt)
|
||||||
tri->MaybeAutoDelete();
|
tri->DeleteThis();
|
||||||
tri = NULL;
|
tri = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1406,7 +1406,7 @@ IMeshGeom *CExportNel::buildMeshGeom (INode& node, TimeValue time, const TInodeP
|
||||||
|
|
||||||
// Delete the triObject if we should...
|
// Delete the triObject if we should...
|
||||||
if (deleteIt)
|
if (deleteIt)
|
||||||
tri->MaybeAutoDelete();
|
tri->DeleteThis();
|
||||||
tri = NULL;
|
tri = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2058,7 +2058,7 @@ NL3D::IShape *CExportNel::buildWaterShape(INode& node, TimeValue time)
|
||||||
|
|
||||||
// Delete the triObject if we should...
|
// Delete the triObject if we should...
|
||||||
if (deleteIt)
|
if (deleteIt)
|
||||||
tri->MaybeAutoDelete();
|
tri->DeleteThis();
|
||||||
tri = NULL;
|
tri = NULL;
|
||||||
nlinfo("WaterShape : build succesful");
|
nlinfo("WaterShape : build succesful");
|
||||||
return ws;
|
return ws;
|
||||||
|
@ -2100,11 +2100,8 @@ bool CExportNel::buildMeshAABBox(INode &node, NLMISC::CAABBox &dest, TimeValue t
|
||||||
dest.setMinMax(nelMin, nelMax);
|
dest.setMinMax(nelMin, nelMax);
|
||||||
//
|
//
|
||||||
if (deleteIt)
|
if (deleteIt)
|
||||||
{
|
tri->DeleteThis();
|
||||||
#ifdef NL_DONT_FIND_MAX_CRASH
|
|
||||||
tri->MaybeAutoDelete();
|
|
||||||
#endif // NL_DEBUG
|
|
||||||
}
|
|
||||||
tri = NULL;
|
tri = NULL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,7 +180,7 @@ bool CMeshInterface::buildFromMaxMesh(INode &node, TimeValue tvTime)
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (deleteIt)
|
if (deleteIt)
|
||||||
tri->MaybeAutoDelete();
|
tri->DeleteThis();
|
||||||
tri = NULL;
|
tri = NULL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -362,7 +362,7 @@ static void AddNodeToQuadGrid(const NLMISC::CAABBox &delimiter, TNodeFaceQG &des
|
||||||
nldebug("%d faces where added", numFaceAdded);
|
nldebug("%d faces where added", numFaceAdded);
|
||||||
//
|
//
|
||||||
if (deleteIt)
|
if (deleteIt)
|
||||||
tri->MaybeAutoDelete();
|
tri->DeleteThis();
|
||||||
tri = NULL;
|
tri = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -495,7 +495,7 @@ static bool SelectVerticesInMeshFromInterfaces(const std::vector<CMeshInterface>
|
||||||
if (obj != tri)
|
if (obj != tri)
|
||||||
{
|
{
|
||||||
// not a mesh object, so do nothing
|
// not a mesh object, so do nothing
|
||||||
tri->MaybeAutoDelete();
|
tri->DeleteThis();
|
||||||
tri = NULL;
|
tri = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue