Moved event descriptors under the NLGUI namespace.

This commit is contained in:
dfighter1985 2012-05-10 23:31:39 +02:00
parent 862b2b8cb9
commit fce2d8e443
69 changed files with 354 additions and 329 deletions

View file

@ -21,6 +21,8 @@
#include "nel/misc/types_nl.h"
namespace NLGUI
{
// ----------------------------------------------------------------------------
class CEventDescriptor
@ -247,6 +249,8 @@ protected:
bool _HasFocus;
};
}
#endif // RZ_EVENT_DESCRIPTOR_H
/* End of event_descriptor.h */

View file

@ -19,6 +19,9 @@
#include "nel/misc/events.h"
#include "nel/gui/event_descriptor.h"
namespace NLGUI
{
void CEventDescriptorKey::init(const NLMISC::CEventKey &ev)
{
_CtrlState = (ev.Button & NLMISC::ctrlKeyButton) != 0;
@ -50,3 +53,5 @@ void CEventDescriptorKey::init(const NLMISC::CEventKey &ev)
}
}
}

View file

@ -2249,7 +2249,7 @@ class CAHConfirmTrade : public IActionHandler
case 1: enableResale = true; break;
default: // 2: comes only from Enter of Shift+Enter key from an edit box or in the modal window
{
const CEventDescriptorKey& keyEvent = CInterfaceManager::getInstance()->getLastEventKeyDesc();
const NLGUI::CEventDescriptorKey& keyEvent = CInterfaceManager::getInstance()->getLastEventKeyDesc();
enableResale = ! keyEvent.getKeyShift();
}
}

View file

@ -32,14 +32,14 @@ CCtrlBase::~CCtrlBase()
}
// ***************************************************************************
bool CCtrlBase::handleEvent(const CEventDescriptor &event)
bool CCtrlBase::handleEvent(const NLGUI::CEventDescriptor &event)
{
if (event.getType() == CEventDescriptor::system)
if (event.getType() == NLGUI::CEventDescriptor::system)
{
CEventDescriptorSystem &eds = (CEventDescriptorSystem&)event;
if (eds.getEventTypeExtended() == CEventDescriptorSystem::activecalledonparent)
NLGUI::CEventDescriptorSystem &eds = (NLGUI::CEventDescriptorSystem&)event;
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::activecalledonparent)
{
if (!((CEventDescriptorActiveCalledOnParent &) eds).getActive())
if (!((NLGUI::CEventDescriptorActiveCalledOnParent &) eds).getActive())
{
// the mouse capture should be lost when the ctrl is hidden
CInterfaceManager *manager = CInterfaceManager::getInstance();

View file

@ -58,7 +58,7 @@ public:
/// Handle all events (implemented by derived classes) (return true to signal event handled)
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
virtual CCtrlBase *getSubCtrl (sint32 /* x */, sint32 /* y */) { return this; }

View file

@ -199,18 +199,18 @@ void CCtrlBaseButton::setModulateGlobalColorAll(bool state)
// ***************************************************************************
bool CCtrlBaseButton::handleEvent (const CEventDescriptor& event)
bool CCtrlBaseButton::handleEvent (const NLGUI::CEventDescriptor& event)
{
if (CCtrlBase::handleEvent(event)) return true;
if (!_Active || _Frozen)
return false;
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
if (pIM->getCapturePointerLeft() != this)
return false;
@ -223,7 +223,7 @@ bool CCtrlBaseButton::handleEvent (const CEventDescriptor& event)
(eventDesc.getY() <= (_YReal+ _HReal))))
return false;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
{
if (_AHOnLeftDblClick)
{
@ -246,7 +246,7 @@ bool CCtrlBaseButton::handleEvent (const CEventDescriptor& event)
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
if (pIM->getCapturePointerLeft() != this)
return false;
@ -299,12 +299,12 @@ bool CCtrlBaseButton::handleEvent (const CEventDescriptor& event)
// Always return true on LeftClick.
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
{
_LastLeftClickButton = NULL;
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
{
_LastLeftClickButton = NULL;
bool handled= false;
@ -331,10 +331,10 @@ bool CCtrlBaseButton::handleEvent (const CEventDescriptor& event)
}
else if (event.getType() == CEventDescriptor::system)
else if (event.getType() == NLGUI::CEventDescriptor::system)
{
const CEventDescriptorSystem &systemEvent = (const CEventDescriptorSystem &) event;
if (systemEvent.getEventTypeExtended() == CEventDescriptorSystem::clocktick)
const NLGUI::CEventDescriptorSystem &systemEvent = (const NLGUI::CEventDescriptorSystem &) event;
if (systemEvent.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::clocktick)
{
if (_AHOnClockTick != NULL)
{

View file

@ -40,7 +40,7 @@ public:
CCtrlBaseButton(const TCtorParam &param);
virtual bool parse (xmlNodePtr cur,CInterfaceGroup * parentGroup);
virtual bool handleEvent (const CEventDescriptor& event);
virtual bool handleEvent (const NLGUI::CEventDescriptor& event);
/// \name Misc
// @{

View file

@ -22,8 +22,10 @@
#include "ctrl_base_button.h"
#include "view_renderer.h"
namespace NLGUI
{
class CEventDescriptor;
}
class CInterfaceManager;
/**

View file

@ -108,14 +108,14 @@ void CCtrlColPick::draw()
}
// ------------------------------------------------------------------------------------------------
bool CCtrlColPick::handleEvent (const CEventDescriptor &event)
bool CCtrlColPick::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (CCtrlBase::handleEvent(event)) return true;
if (!_Active)
return false;
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if ((CInterfaceManager::getInstance()->getCapturePointerLeft() != this) &&
(!((eventDesc.getX() >= _XReal) &&
(eventDesc.getX() < (_XReal + _WReal))&&
@ -123,18 +123,18 @@ bool CCtrlColPick::handleEvent (const CEventDescriptor &event)
(eventDesc.getY() <= (_YReal+ _HReal)))))
return false;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
{
_MouseDown = true;
selectColor(eventDesc.getX()-_XReal, eventDesc.getY()-_YReal);
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
_MouseDown = false;
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove)
{
if (_MouseDown)
{

View file

@ -40,7 +40,7 @@ public:
virtual void updateCoords();
virtual void draw();
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
sint32 getColorR () const { return _ColorSelect.R; }
sint32 getColorG () const { return _ColorSelect.G; }

View file

@ -278,7 +278,7 @@ void CCtrlPolygon::setAlpha(sint32 a)
}
// *********************************************************************************
bool CCtrlPolygon::handleEvent(const CEventDescriptor &/* event */)
bool CCtrlPolygon::handleEvent(const NLGUI::CEventDescriptor &/* event */)
{
H_AUTO(Rz_CCtrlPolygon_handleEvent)
return false;

View file

@ -64,7 +64,7 @@ public:
//const NLMISC::CMatrix &getMatrix() const { return _Matrix; }
// test if last call to 'setVertices' was for a valid poly (e.g one that doesn't overlapp itself)
bool isValid() const { return _Valid; }
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
// no capturable by default (just tooltip capability wanted)
virtual bool isCapturable() const { return false; }

View file

@ -410,7 +410,7 @@ void CCtrlQuad::setCustomUVs(const CUV uvs[4])
}
// *********************************************************************************
bool CCtrlQuad::handleEvent(const CEventDescriptor &/* event */)
bool CCtrlQuad::handleEvent(const NLGUI::CEventDescriptor &/* event */)
{
H_AUTO(Rz_CCtrlQuad_handleEvent)
return false;

View file

@ -85,7 +85,7 @@ public:
// from CCtrlBase, no op by default
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
// see if this control contains the given point (in parent coords)
bool contains(const NLMISC::CVector2f &pos) const;

View file

@ -457,14 +457,14 @@ void CCtrlScroll::draw()
}
// ------------------------------------------------------------------------------------------------
bool CCtrlScroll::handleEvent (const CEventDescriptor &event)
bool CCtrlScroll::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (CCtrlBase::handleEvent(event)) return true;
if (!_Active || _Frozen)
return false;
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if ((CInterfaceManager::getInstance()->getCapturePointerLeft() != this) &&
(!((eventDesc.getX() >= _XReal) &&
(eventDesc.getX() < (_XReal + _WReal))&&
@ -472,7 +472,7 @@ bool CCtrlScroll::handleEvent (const CEventDescriptor &event)
(eventDesc.getY() <= (_YReal+ _HReal)))))
return false;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
{
_MouseDown = true;
_InitialValue = getValue();
@ -490,20 +490,20 @@ bool CCtrlScroll::handleEvent (const CEventDescriptor &event)
}
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
_MouseDown = false;
runAH(_AHOnScrollEnd, _AHOnScrollEndParams.empty() ? _AHOnScrollParams : _AHOnScrollEndParams); // backward compatibility
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown && _MouseDown && _Cancelable)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown && _MouseDown && _Cancelable)
{
_MouseDown = false;
setValue(_InitialValue);
runAH(_AHOnScrollCancel, _AHOnScrollCancelParams); // backward compatibility
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove)
{
if (_MouseDown)
{
@ -514,7 +514,7 @@ bool CCtrlScroll::handleEvent (const CEventDescriptor &event)
}
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel && _Vertical)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel && _Vertical)
{
moveTrackY (eventDesc.getWheel() * 12);
return true;

View file

@ -41,7 +41,7 @@ public:
virtual void updateCoords();
virtual void draw();
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
void setTarget (CInterfaceGroup *pIG);

View file

@ -23,7 +23,10 @@
#include "view_renderer.h"
namespace NLGUI
{
class CEventDescriptor;
}
class CInterfaceManager;
class CViewText;

View file

@ -38,7 +38,7 @@ void CCtrlToolTip::draw ()
}
// ----------------------------------------------------------------------------
bool CCtrlToolTip::handleEvent (const CEventDescriptor& event)
bool CCtrlToolTip::handleEvent (const NLGUI::CEventDescriptor& event)
{
if (CCtrlBase::handleEvent(event)) return true;
return false;

View file

@ -22,7 +22,10 @@
#include "ctrl_base.h"
#include "nel/3d/u_texture.h"
namespace NLGUI
{
class CEventDescriptor;
}
class CInterfaceManager;
/**
@ -37,7 +40,7 @@ public:
/// Constructor
CCtrlToolTip(const TCtorParam &param) : CCtrlBase(param) {}
virtual bool handleEvent (const CEventDescriptor& eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
virtual void draw();
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
// Can do nothing with tooltip (but display it :) )

View file

@ -2590,18 +2590,18 @@ sint32 CDBCtrlSheet::drawNumber(sint32 x, sint32 y, sint32 wSheet, sint32 /* hSh
}
// ----------------------------------------------------------------------------
bool CDBCtrlSheet::handleEvent (const CEventDescriptor &event)
bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (CCtrlBase::handleEvent(event)) return true;
CInterfaceManager *pIM = CInterfaceManager::getInstance();
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
// Handle drag'n'drop
if (pIM->getCapturePointerLeft() == this)
{
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown && !_Draging)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown && !_Draging)
{
_DragX = eventDesc.getX();
_DragY = eventDesc.getY();
@ -2655,7 +2655,7 @@ bool CDBCtrlSheet::handleEvent (const CEventDescriptor &event)
if (_Draging)
{
// If mouse left up, must end the Drag
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
bool handled = false;
// get the ctrl under the drop
@ -2843,7 +2843,7 @@ bool CDBCtrlSheet::handleEvent (const CEventDescriptor &event)
(eventDesc.getY() <= (_YReal+ _HReal))))
return false;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
if (pIM->getCapturePointerLeft() != this)
@ -2865,12 +2865,12 @@ bool CDBCtrlSheet::handleEvent (const CEventDescriptor &event)
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
{
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
{
bool handled= false;
CInterfaceManager *pIM = CInterfaceManager::getInstance();

View file

@ -189,7 +189,7 @@ public:
virtual void draw();
void drawSheet (sint32 scrX, sint32 scrY, bool draging, bool showSelectionBorder = true);
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
void setActionOnLeftClick (const std::string &ActionHandlerName) { _AHOnLeftClick = getAH(ActionHandlerName, _AHLeftClickParams); }
void setActionOnRightClick (const std::string &ActionHandlerName) { _AHOnRightClick = getAH(ActionHandlerName, _AHRightClickParams); }

View file

@ -749,14 +749,14 @@ void CDBGroupListSheet::clearViews ()
}
// ***************************************************************************
bool CDBGroupListSheet::handleEvent (const CEventDescriptor &event)
bool CDBGroupListSheet::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if (isIn(eventDesc.getX(), eventDesc.getY()))
{
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
{
if (_ScrollBar != NULL)
{
@ -765,7 +765,7 @@ bool CDBGroupListSheet::handleEvent (const CEventDescriptor &event)
return true;
}
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
CGroupContainer *pGC = getContainer();
if (pGC != NULL) pGC->setHighLighted(false);

View file

@ -49,7 +49,7 @@ public:
virtual void checkCoords ();
virtual void draw ();
virtual void clearViews ();
virtual bool handleEvent (const CEventDescriptor &eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
// mod interface
void changeNbRow(sint delta);

View file

@ -664,12 +664,12 @@ void CDBGroupListSheetText::clearViews ()
}
// ***************************************************************************
bool CDBGroupListSheetText::handleEvent (const CEventDescriptor &event)
bool CDBGroupListSheetText::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
_Scrolling = 0;
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if (isIn(eventDesc.getX(), eventDesc.getY()))
{
// Drag'n'drop from a ctrl sheet that belongs to this list
@ -687,9 +687,9 @@ bool CDBGroupListSheetText::handleEvent (const CEventDescriptor &event)
{
pDraggedSheet = _SheetChildren[pos]->Ctrl;
pIM->setCapturePointerLeft(pDraggedSheet);
CEventDescriptorMouse newEv = eventDesc;
NLGUI::CEventDescriptorMouse newEv = eventDesc;
// Send this because not send (the captured button has processed the event mouseleftdown)
newEv.setEventTypeExtended(CEventDescriptorMouse::mouseleftdown);
newEv.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouseleftdown);
pDraggedSheet->handleEvent(newEv);
}
}
@ -711,7 +711,7 @@ bool CDBGroupListSheetText::handleEvent (const CEventDescriptor &event)
if(swapable())
{
if (pDraggedSheet != NULL)
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
sint posdst = -1,possrc = -1;
const vector<CCtrlBase*> &rV = pIM->getCtrlsUnderPointer();
@ -733,7 +733,7 @@ bool CDBGroupListSheetText::handleEvent (const CEventDescriptor &event)
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
{
// If scroll ok, and if scroll possible
if (_ScrollBar != NULL && _List != NULL && _List->getH()>_List->getMaxH())
@ -752,10 +752,10 @@ bool CDBGroupListSheetText::handleEvent (const CEventDescriptor &event)
}
}
}
else if (event.getType() == CEventDescriptor::system)
else if (event.getType() == NLGUI::CEventDescriptor::system)
{
const CEventDescriptorSystem &systemEvent = (const CEventDescriptorSystem &) event;
if (systemEvent.getEventTypeExtended() == CEventDescriptorSystem::clocktick)
const NLGUI::CEventDescriptorSystem &systemEvent = (const NLGUI::CEventDescriptorSystem &) event;
if (systemEvent.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::clocktick)
{
if (_Scrolling != 0)
if (_ScrollBar != NULL && _List != NULL)

View file

@ -57,7 +57,7 @@ public:
virtual void checkCoords ();
virtual void draw ();
virtual void clearViews ();
virtual bool handleEvent (const CEventDescriptor &eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
/// \name IListSheetBase implementation
// @{

View file

@ -149,14 +149,14 @@ void CDBGroupSelectNumber::clearViews ()
}
// ***************************************************************************
bool CDBGroupSelectNumber::handleEvent (const CEventDescriptor &event)
bool CDBGroupSelectNumber::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if (isIn(eventDesc.getX(), eventDesc.getY()))
{
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
{
changeValue (eventDesc.getWheel());
return true;

View file

@ -51,7 +51,7 @@ public:
virtual void checkCoords();
virtual void draw ();
virtual void clearViews ();
virtual bool handleEvent (const CEventDescriptor &eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
// mod interface
void changeValue(sint delta);

View file

@ -399,15 +399,15 @@ void CGroupCompas::draw()
// ***************************************************************************
bool CGroupCompas::handleEvent (const CEventDescriptor &event)
bool CGroupCompas::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
//
if ((_RadarView != NULL) && (_RadarRangeView != NULL))
{
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
_RadarPos = pIM->getDbProp("UI:SAVE:RADARZOOM")->getValue32();

View file

@ -86,7 +86,7 @@ public:
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
virtual void updateCoords();
virtual void draw();
virtual bool handleEvent (const CEventDescriptor &eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
void setTarget(const CCompassTarget &target);
const CCompassTarget &getTarget() const { return _Target; }

View file

@ -151,18 +151,18 @@ void CCtrlResizer::draw ()
}
// ***************************************************************************
bool CCtrlResizer::handleEvent (const CEventDescriptor &event)
bool CCtrlResizer::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (CCtrlBase::handleEvent(event)) return true;
if (!_Active || !_Parent)
return false;
if (event.getType() == CEventDescriptor::system)
if (event.getType() == NLGUI::CEventDescriptor::system)
{
const CEventDescriptorSystem &eds = (const CEventDescriptorSystem &) event;
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) event;
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::setfocus)
{
const CEventDescriptorSetFocus &edsf = (const CEventDescriptorSetFocus &) eds;
const NLGUI::CEventDescriptorSetFocus &edsf = (const NLGUI::CEventDescriptorSetFocus &) eds;
if (edsf.hasFocus() == false && _MouseDown)
{
_MouseDown = false;
@ -172,15 +172,15 @@ bool CCtrlResizer::handleEvent (const CEventDescriptor &event)
}
}
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if ((CInterfaceManager::getInstance()->getCapturePointerLeft() != this) && !isIn(eventDesc.getX(), eventDesc.getY()))
return false;
CGroupContainer *gc = dynamic_cast<CGroupContainer *>(_Parent);
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
{
// must check that parent isn't closed
if (gc)
@ -200,13 +200,13 @@ bool CCtrlResizer::handleEvent (const CEventDescriptor &event)
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
_MouseDown = false;
_Parent->invalidateCoords();
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove)
{
if (_MouseDown)
{
@ -560,7 +560,7 @@ void CCtrlMover::draw ()
}
// ***************************************************************************
bool CCtrlMover::handleEvent (const CEventDescriptor &event)
bool CCtrlMover::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (CCtrlBase::handleEvent(event)) return true;
if (!_Active)
@ -568,12 +568,12 @@ bool CCtrlMover::handleEvent (const CEventDescriptor &event)
CInterfaceManager *pIM= CInterfaceManager::getInstance();
if (event.getType() == CEventDescriptor::system)
if (event.getType() == NLGUI::CEventDescriptor::system)
{
const CEventDescriptorSystem &eds = (const CEventDescriptorSystem &) event;
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) event;
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::setfocus)
{
const CEventDescriptorSetFocus &edsf = (const CEventDescriptorSetFocus &) eds;
const NLGUI::CEventDescriptorSetFocus &edsf = (const NLGUI::CEventDescriptorSetFocus &) eds;
if (edsf.hasFocus() == false && _Moving)
{
stopMove(pIM);
@ -582,9 +582,9 @@ bool CCtrlMover::handleEvent (const CEventDescriptor &event)
}
}
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
// the ctrl must have been captured
if (pIM->getCapturePointerLeft() != this)
return false;
@ -599,7 +599,7 @@ bool CCtrlMover::handleEvent (const CEventDescriptor &event)
}
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown && _WaitToOpenClose)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown && _WaitToOpenClose)
{
if (_WaitToOpenClose)
{
@ -657,7 +657,7 @@ bool CCtrlMover::handleEvent (const CEventDescriptor &event)
if (_CanOpen || gc->isOpenWhenPopup())
{
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
if (!_Parent) return false;
gc->setHighLighted(false);
@ -704,7 +704,7 @@ bool CCtrlMover::handleEvent (const CEventDescriptor &event)
if (_CanMove)
{
// Enter Moving?
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown )
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown )
{
_MoveStartX= _Parent->getX()-eventDesc.getX();
_MoveStartY= _Parent->getY()-eventDesc.getY();
@ -725,13 +725,13 @@ bool CCtrlMover::handleEvent (const CEventDescriptor &event)
else
{
// Leave Moving?
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup )
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup )
{
stopMove(pIM);
return true;
}
// Move
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove )
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove )
{
_HasMoved = true;
if (gc) gc->touch();
@ -911,10 +911,10 @@ bool CCtrlMover::handleEvent (const CEventDescriptor &event)
}
}
}
if (event.getType() == CEventDescriptor::system)
if (event.getType() == NLGUI::CEventDescriptor::system)
{
const CEventDescriptorSystem &systemEvent = (const CEventDescriptorSystem &) event;
if (systemEvent.getEventTypeExtended() == CEventDescriptorSystem::clocktick)
const NLGUI::CEventDescriptorSystem &systemEvent = (const NLGUI::CEventDescriptorSystem &) event;
if (systemEvent.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::clocktick)
{
if (_WaitToOpenClose)
{
@ -1046,7 +1046,7 @@ bool CCtrlMover::runTitleActionHandler()
}
// ***************************************************************************
void CCtrlMover::setPoped(CGroupContainer *gc, sint32 x, sint32 y, CInterfaceManager *pIM, const CEventDescriptorMouse &eventDesc)
void CCtrlMover::setPoped(CGroupContainer *gc, sint32 x, sint32 y, CInterfaceManager *pIM, const NLGUI::CEventDescriptorMouse &eventDesc)
{
gc->setHighLighted(false);
sint32 deltaX = x - _Parent->getX();
@ -1088,7 +1088,7 @@ void CCtrlMover::setPoped(CGroupContainer *gc, sint32 x, sint32 y, CInterfaceMan
}
// ***************************************************************************
void CCtrlMover::setMovingInParent(CGroupContainer *gc, sint32 /* x */, sint32 y, CInterfaceManager *pIM, const CEventDescriptorMouse &eventDesc)
void CCtrlMover::setMovingInParent(CGroupContainer *gc, sint32 /* x */, sint32 y, CInterfaceManager *pIM, const NLGUI::CEventDescriptorMouse &eventDesc)
{
if (!gc) return;
sint32 deltaY = y - gc->getY();
@ -2267,7 +2267,7 @@ void CGroupContainer::clearViews()
}
// ***************************************************************************
bool CGroupContainer::handleEvent (const CEventDescriptor& event)
bool CGroupContainer::handleEvent (const NLGUI::CEventDescriptor& event)
{
if (!_Active)
return false;
@ -2282,13 +2282,13 @@ bool CGroupContainer::handleEvent (const CEventDescriptor& event)
if (!CInterfaceGroup::handleEvent(event))
{
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
// MouseWheel mgt
if ((_LayerSetup == 0) && (isIn(eventDesc.getX(), eventDesc.getY())))
{
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
{
if (_ScrollBar != NULL)
_ScrollBar->moveTrackY (eventDesc.getWheel()*12);
@ -3776,21 +3776,21 @@ void CGroupContainer::addModalSon (CGroupContainer *pSon)
}
// ***************************************************************************
bool CGroupContainer::checkIfModal(const CEventDescriptor& event)
bool CGroupContainer::checkIfModal(const NLGUI::CEventDescriptor& event)
{
bool bRet = true;
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
if ((eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown) ||
(eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown))
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if ((eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown) ||
(eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown))
{
bRet = blinkAllSons();
}
// Additionaly, if it is a UP, don't blink, but return false if some son active
if (bRet && (
(eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup) ||
(eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup))
(eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup) ||
(eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup))
)
{
bRet= !isGrayed();

View file

@ -22,7 +22,10 @@
#include "interface_group.h"
#include "nel/misc/smart_ptr.h"
namespace NLGUI
{
class CEventDescriptorLocalised;
}
class CInterfaceList;
class CCtrlButton;
class CCtrlScroll;
@ -48,7 +51,7 @@ public:
CCtrlResizer(const TCtorParam &param);
virtual void draw ();
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
// Add a big delta so when the user is over the Resizer, always take it whatever other controls under
virtual uint getDeltaDepth() const { return 100; }
@ -99,7 +102,7 @@ public:
CCtrlMover(const TCtorParam &param, bool canMove, bool canOpen);
~CCtrlMover();
virtual void draw ();
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
bool canMove() { return _CanMove; }
bool isMoving() const {return _Moving;}
@ -132,8 +135,8 @@ private:
//
static COptionsContainerInsertion *getInsertionOptions();
private:
void setPoped(CGroupContainer *gc, sint32 x, sint32 y, CInterfaceManager *pIM, const CEventDescriptorMouse &eventDesc);
void setMovingInParent(CGroupContainer *gc, sint32 x, sint32 y, CInterfaceManager *pIM, const CEventDescriptorMouse &eventDesc);
void setPoped(CGroupContainer *gc, sint32 x, sint32 y, CInterfaceManager *pIM, const NLGUI::CEventDescriptorMouse &eventDesc);
void setMovingInParent(CGroupContainer *gc, sint32 x, sint32 y, CInterfaceManager *pIM, const NLGUI::CEventDescriptorMouse &eventDesc);
void updateInsertionIndex(const CGroupList *gl, sint32 posY);
void stopMove(CInterfaceManager *pIM);
bool runTitleActionHandler();
@ -171,7 +174,7 @@ public:
virtual void clearViews ();
virtual bool handleEvent (const CEventDescriptor &eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
virtual void launch ();
@ -446,7 +449,7 @@ public:
void setModalParentList (const std::string &name);
bool checkIfModal(const CEventDescriptor& event); // Return true if we can handle the event (and prevent from selecting a window)
bool checkIfModal(const NLGUI::CEventDescriptor& event); // Return true if we can handle the event (and prevent from selecting a window)
bool isGrayed() const;
bool blinkAllSons();

View file

@ -551,7 +551,7 @@ void CGroupEditBox::writeString(const ucstring &str, bool replace, bool atEnd)
}
// ----------------------------------------------------------------------------
void CGroupEditBox::handleEventChar(const CEventDescriptorKey &rEDK)
void CGroupEditBox::handleEventChar(const NLGUI::CEventDescriptorKey &rEDK)
{
stopParentBlink();
switch(rEDK.getChar())
@ -711,7 +711,7 @@ void CGroupEditBox::handleEventChar(const CEventDescriptorKey &rEDK)
}
// ----------------------------------------------------------------------------
void CGroupEditBox::handleEventString(const CEventDescriptorKey &rEDK)
void CGroupEditBox::handleEventString(const NLGUI::CEventDescriptorKey &rEDK)
{
appendStringFromClipboard(rEDK.getString());
}
@ -827,11 +827,11 @@ void CGroupEditBox::back()
}
// ----------------------------------------------------------------------------
bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
bool CGroupEditBox::handleEvent (const NLGUI::CEventDescriptor& event)
{
if (!_Active || !_ViewText)
return false;
if (event.getType() == CEventDescriptor::key)
if (event.getType() == NLGUI::CEventDescriptor::key)
{
if (_BypassNextKey)
{
@ -841,18 +841,18 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
///////////////
// KEY EVENT //
///////////////
const CEventDescriptorKey &rEDK = (const CEventDescriptorKey&)event;
const NLGUI::CEventDescriptorKey &rEDK = (const NLGUI::CEventDescriptorKey&)event;
switch(rEDK.getKeyEventType())
{
case CEventDescriptorKey::keychar: handleEventChar(rEDK); break;
case CEventDescriptorKey::keystring: handleEventString(rEDK); break;
case NLGUI::CEventDescriptorKey::keychar: handleEventChar(rEDK); break;
case NLGUI::CEventDescriptorKey::keystring: handleEventString(rEDK); break;
default: break;
}
// update the text
setInputString(_InputString);
// if event of type char or string, consider handle all of them
if( rEDK.getKeyEventType()==CEventDescriptorKey::keychar || rEDK.getKeyEventType()==CEventDescriptorKey::keystring )
if( rEDK.getKeyEventType()==NLGUI::CEventDescriptorKey::keychar || rEDK.getKeyEventType()==NLGUI::CEventDescriptorKey::keystring )
return true;
// Else filter the EventKeyDown AND EventKeyUp.
else
@ -866,16 +866,16 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
}
}
else
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
/////////////////
// MOUSE EVENT //
/////////////////
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
CInterfaceManager *pIM = CInterfaceManager::getInstance();
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
{
if (pIM->getCapturePointerRight() == this)
{
@ -901,7 +901,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
return false;
// if click, and not frozen, then get the focus
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown && !_Frozen)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown && !_Frozen)
{
_SelectingText = true;
stopParentBlink();
@ -920,7 +920,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
return true;
}
// if click, and not frozen, then get the focus
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove && !_Frozen && _SelectingText)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove && !_Frozen && _SelectingText)
{
// set the right cursor position
uint newCurPos;
@ -934,7 +934,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
}
// if click, and not frozen, then get the focus
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup && !_Frozen)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup && !_Frozen)
{
_SelectingText = false;
if (_SelectCursorPos == _CursorPos)
@ -943,7 +943,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
{
pIM->setCapturePointerRight(this);
return true;
@ -954,10 +954,10 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
//////////////////
// SYSTEM EVENT //
//////////////////
const CEventDescriptorSystem &eventDesc = (const CEventDescriptorSystem &)event;
if (eventDesc.getEventTypeExtended() == CEventDescriptorSystem::activecalledonparent)
const NLGUI::CEventDescriptorSystem &eventDesc = (const NLGUI::CEventDescriptorSystem &)event;
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::activecalledonparent)
{
CEventDescriptorActiveCalledOnParent &activeEvent = (CEventDescriptorActiveCalledOnParent &) eventDesc;
NLGUI::CEventDescriptorActiveCalledOnParent &activeEvent = (NLGUI::CEventDescriptorActiveCalledOnParent &) eventDesc;
if (activeEvent.getActive() == false && _ResetFocusOnHide)
{
CInterfaceManager::getInstance()->resetCaptureKeyboard();

View file

@ -22,8 +22,10 @@
#include "interface_group.h"
#include "nel/3d/u_texture.h"
namespace NLGUI
{
class CEventDescriptor;
}
class CViewText;
// ----------------------------------------------------------------------------
class CGroupEditBox : public CInterfaceGroup
@ -41,7 +43,7 @@ public:
virtual void draw();
virtual bool handleEvent (const CEventDescriptor& eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
/// Accessors
ucstring getInputString() const { return _InputString; }
@ -290,8 +292,8 @@ protected:
private:
void setupDisplayText();
void makeTopWindow();
void handleEventChar(const CEventDescriptorKey &event);
void handleEventString(const CEventDescriptorKey &event);
void handleEventChar(const NLGUI::CEventDescriptorKey &event);
void handleEventString(const NLGUI::CEventDescriptorKey &event);
void setup();
void triggerOnChangeAH();
void appendStringFromClipboard(const ucstring &str);

View file

@ -255,17 +255,17 @@ public:
if (getParent()->getParent() == _Parent->getParentPos()) return NULL; // leftmost header
return dynamic_cast<CInterfaceGroup *>(getParent()->getParentPos());
}
bool handleEvent (const CEventDescriptor &event)
bool handleEvent (const NLGUI::CEventDescriptor &event)
{
CInterfaceManager *im = CInterfaceManager::getInstance();
if (_Parent)
{
if (event.getType() == CEventDescriptor::system)
if (event.getType() == NLGUI::CEventDescriptor::system)
{
const CEventDescriptorSystem &eds = (const CEventDescriptorSystem &) event;
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) event;
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::setfocus)
{
const CEventDescriptorSetFocus &edsf = (const CEventDescriptorSetFocus &) eds;
const NLGUI::CEventDescriptorSetFocus &edsf = (const NLGUI::CEventDescriptorSetFocus &) eds;
if (edsf.hasFocus() == false)
{
release();
@ -273,10 +273,10 @@ public:
}
}
}
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
{
if (!this->isIn(eventDesc.getX(), eventDesc.getY())) return false;
_TargetGroup = getTargetGroup();
@ -286,11 +286,11 @@ public:
_OffsetX = _TargetGroup->getW() - eventDesc.getX();
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
release();
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove)
{
if (_Moving && im->getCapturePointerLeft() == this)
{

View file

@ -2106,14 +2106,14 @@ bool CGroupHTML::parse(xmlNodePtr cur,CInterfaceGroup *parentGroup)
// ***************************************************************************
bool CGroupHTML::handleEvent (const CEventDescriptor& eventDesc)
bool CGroupHTML::handleEvent (const NLGUI::CEventDescriptor& eventDesc)
{
bool traited = CGroupScrollText::handleEvent (eventDesc);
if (eventDesc.getType() == CEventDescriptor::system)
if (eventDesc.getType() == NLGUI::CEventDescriptor::system)
{
const CEventDescriptorSystem &systemEvent = (const CEventDescriptorSystem &) eventDesc;
if (systemEvent.getEventTypeExtended() == CEventDescriptorSystem::clocktick)
const NLGUI::CEventDescriptorSystem &systemEvent = (const NLGUI::CEventDescriptorSystem &) eventDesc;
if (systemEvent.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::clocktick)
{
// Handle now
handle ();

View file

@ -73,7 +73,7 @@ public:
virtual void draw ();
// Events
virtual bool handleEvent (const CEventDescriptor& eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
// Browse
virtual void browse (const char *url);

View file

@ -663,16 +663,16 @@ void CGroupList::draw ()
}
// ----------------------------------------------------------------------------
bool CGroupList::handleEvent (const CEventDescriptor& event)
bool CGroupList::handleEvent (const NLGUI::CEventDescriptor& event)
{
if (!_Active)
return false;
bool bReturn = CInterfaceGroup::handleEvent(event);
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
_OverElt = -1;
if (!isIn(eventDesc.getX(), eventDesc.getY()))

View file

@ -121,7 +121,7 @@ public:
virtual void draw();
virtual bool handleEvent (const CEventDescriptor& eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
virtual void clearViews();
virtual void clearControls();

View file

@ -171,15 +171,15 @@ CGroupMap::CPolyButton::CPolyButton()
//============================================================================================================
bool CGroupMap::CPolyButton::handleEvent (const CEventDescriptor &event)
bool CGroupMap::CPolyButton::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (CCtrlBase::handleEvent(event)) return true;
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
CInterfaceManager *im = CInterfaceManager::getInstance();
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
if (im->getCapturePointerLeft() != this)
return false;
@ -205,7 +205,7 @@ bool CGroupMap::CPolyButton::handleEvent (const CEventDescriptor &event)
}
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
{
if (contains(CVector2f((float)eventDesc.getX(), (float)eventDesc.getY())))
{
@ -1703,7 +1703,7 @@ void CGroupMap::draw()
}
//============================================================================================================
bool CGroupMap::handleEvent(const CEventDescriptor &event)
bool CGroupMap::handleEvent(const NLGUI::CEventDescriptor &event)
{
CInterfaceManager *im = CInterfaceManager::getInstance();
// if R2 editor editor is on, give it a chance to handle the event first
@ -1712,11 +1712,11 @@ bool CGroupMap::handleEvent(const CEventDescriptor &event)
bool handled = false;
bool panEnd = false;
// handle standard clicks
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
panEnd = eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup && _Panning && _HasMoved;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup && !panEnd)
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
panEnd = eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup && _Panning && _HasMoved;
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup && !panEnd)
{
//if (im->getCapturePointerLeft() == this)
// NB : don't test capture of mouse here, because
@ -1745,7 +1745,7 @@ bool CGroupMap::handleEvent(const CEventDescriptor &event)
}
}
}
else if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
else if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
{
if (im->getCapturePointerRight() == this)
{
@ -1784,13 +1784,13 @@ bool CGroupMap::handleEvent(const CEventDescriptor &event)
// left button can be used to 'pan' the map
// mouse wheel can be used to zoom in/out
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
if (!_Active)
return false;
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
if (im->getCapturePointerLeft() != this)
{
@ -1801,13 +1801,13 @@ bool CGroupMap::handleEvent(const CEventDescriptor &event)
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
{
im->setCapturePointerRight(this);
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
{
if (isIn(eventDesc.getX(), eventDesc.getY()))
{
@ -1843,7 +1843,7 @@ bool CGroupMap::handleEvent(const CEventDescriptor &event)
}
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove)
{
if (im->getCapturePointerLeft() != this || !_Panning)
return CInterfaceGroup::handleEvent(event);
@ -1873,7 +1873,7 @@ bool CGroupMap::handleEvent(const CEventDescriptor &event)
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel && !_Panning)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel && !_Panning)
{
sint32 wheel = eventDesc.getWheel();
float newScale = _UserScale;
@ -1907,7 +1907,7 @@ bool CGroupMap::handleEvent(const CEventDescriptor &event)
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
{
// convert click pos into map pos
if (_MapTexW == 0 || _MapTexH == 0)
@ -1931,10 +1931,10 @@ bool CGroupMap::handleEvent(const CEventDescriptor &event)
}
}
}
if (event.getType() == CEventDescriptor::system)
if (event.getType() == NLGUI::CEventDescriptor::system)
{
CEventDescriptorSystem &es = (CEventDescriptorSystem &) event;
if (es.getEventTypeExtended() == CEventDescriptorSystem::activecalledonparent)
NLGUI::CEventDescriptorSystem &es = (NLGUI::CEventDescriptorSystem &) event;
if (es.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::activecalledonparent)
{
bool visible = getActive();
if (visible)

View file

@ -119,7 +119,7 @@ public:
virtual void updateCoords();
virtual void checkCoords();
virtual void draw ();
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup);
virtual bool getCtrlsUnder (sint32 x, sint32 y, sint32 clipX, sint32 clipY, sint32 clipW, sint32 clipH, std::vector<CCtrlBase*> &vICL);
@ -234,7 +234,7 @@ private:
{
public:
CPolyButton();
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
virtual void updateCoords();
virtual void draw () {}
void drawPolyButton();
@ -258,7 +258,7 @@ private:
CContLandMark::TContLMType Type;
bool HandleEvents;
public:
virtual bool handleEvent (const CEventDescriptor& event)
virtual bool handleEvent (const NLGUI::CEventDescriptor& event)
{
if (!HandleEvents) return false;
return CCtrlButton::handleEvent(event);

View file

@ -933,7 +933,7 @@ void CGroupSubMenu::draw()
}
// ------------------------------------------------------------------------------------------------
bool CGroupSubMenu::handleEvent (const CEventDescriptor &event)
bool CGroupSubMenu::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (!_Active)
return false;
@ -942,9 +942,9 @@ bool CGroupSubMenu::handleEvent (const CEventDescriptor &event)
if(_GroupList)
textDYPos= -(1+_GroupList->getSpace())/2;
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
_Selected = -1;
// TODO First check sub menus that can be not in the area of this menu
@ -976,7 +976,7 @@ bool CGroupSubMenu::handleEvent (const CEventDescriptor &event)
}
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
// If a line is selected and the line is not grayed
if ((_Selected != -1) && (!_Lines[i].ViewText->getGrayed()))
@ -1004,13 +1004,13 @@ bool CGroupSubMenu::handleEvent (const CEventDescriptor &event)
}
}
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
//
if (_GroupList && _ScrollBar)
{
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
{
if (isIn(eventDesc.getX(), eventDesc.getY()))
{
@ -2082,7 +2082,7 @@ void CGroupMenu::draw ()
}
// ------------------------------------------------------------------------------------------------
bool CGroupMenu::handleEvent (const CEventDescriptor &event)
bool CGroupMenu::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (!_Active)
return false;

View file

@ -107,7 +107,7 @@ public:
virtual void draw ();
virtual bool handleEvent (const CEventDescriptor &eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
virtual CInterfaceElement* getElement (const std::string &id);
@ -300,7 +300,7 @@ public:
void recurseDraw(CGroupSubMenu *pSubMenu);
virtual bool handleEvent (const CEventDescriptor &eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
virtual CInterfaceElement* getElement (const std::string &id);

View file

@ -68,12 +68,12 @@ void CGroupModalGetKey::setActive (bool state)
}
// ***************************************************************************
bool CGroupModalGetKey::handleEvent (const CEventDescriptor &event)
bool CGroupModalGetKey::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (event.getType() == CEventDescriptor::key)
if (event.getType() == NLGUI::CEventDescriptor::key)
{
CEventDescriptorKey &edk = (CEventDescriptorKey &)event;
if (edk.getKeyEventType() == CEventDescriptorKey::keydown)
NLGUI::CEventDescriptorKey &edk = (NLGUI::CEventDescriptorKey &)event;
if (edk.getKeyEventType() == NLGUI::CEventDescriptorKey::keydown)
{
// if ((edk.getKey() != KeyCONTROL) && (edk.getKey() != KeyMENU) && (edk.getKey() != KeySHIFT))
// {

View file

@ -38,7 +38,7 @@ public:
/// Constructor
CGroupModalGetKey(const TCtorParam &param);
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
virtual void setActive(bool state);

View file

@ -841,16 +841,16 @@ void CGroupParagraph::draw ()
}
// ----------------------------------------------------------------------------
bool CGroupParagraph::handleEvent (const CEventDescriptor& event)
bool CGroupParagraph::handleEvent (const NLGUI::CEventDescriptor& event)
{
if (!_Active)
return false;
bool bReturn = CInterfaceGroup::handleEvent(event);
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
_OverElt = -1;
if (!isIn(eventDesc.getX(), eventDesc.getY()))

View file

@ -139,7 +139,7 @@ public:
virtual void draw();
virtual bool handleEvent (const CEventDescriptor& eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
virtual void clearViews();
virtual void clearControls();

View file

@ -121,15 +121,15 @@ void CGroupScrollText::clearViews()
}
//========================================================================
bool CGroupScrollText::handleEvent(const CEventDescriptor &event)
bool CGroupScrollText::handleEvent(const NLGUI::CEventDescriptor &event)
{
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
//
if (_List && _ScrollBar)
{
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
{
if (isIn(eventDesc.getX(), eventDesc.getY()))
{

View file

@ -47,7 +47,7 @@ public:
virtual void checkCoords ();
virtual void draw ();
virtual void clearViews ();
virtual bool handleEvent (const CEventDescriptor &eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
// get the list associated to this group
CGroupList *getList() const { return _List; }

View file

@ -788,12 +788,12 @@ void CCtrlTabButton::setActive(bool state)
}
// ***************************************************************************
bool CCtrlTabButton::handleEvent (const CEventDescriptor &event)
bool CCtrlTabButton::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (event.getType() == CEventDescriptor::system)
if (event.getType() == NLGUI::CEventDescriptor::system)
{
const CEventDescriptorSystem &systemEvent = (const CEventDescriptorSystem &) event;
if (systemEvent.getEventTypeExtended() == CEventDescriptorSystem::clocktick)
const NLGUI::CEventDescriptorSystem &systemEvent = (const NLGUI::CEventDescriptorSystem &) event;
if (systemEvent.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::clocktick)
if (_Blinking)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();

View file

@ -155,7 +155,7 @@ public:
virtual void setActive(bool state);
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
void setBlink (bool b);

View file

@ -777,14 +777,14 @@ const std::string &CGroupTree::getSelectedNodeId() const
}
// ----------------------------------------------------------------------------
bool CGroupTree::handleEvent (const CEventDescriptor& event)
bool CGroupTree::handleEvent (const NLGUI::CEventDescriptor& event)
{
if (!_Active) return false;
if (CInterfaceGroup::handleEvent(event)) return true;
// The line must be over (pre-selected)
if (event.getType() == CEventDescriptor::mouse && _OverLine>=0)
if (event.getType() == NLGUI::CEventDescriptor::mouse && _OverLine>=0)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if (!isIn(eventDesc.getX(), eventDesc.getY()))
return false;
@ -799,7 +799,7 @@ bool CGroupTree::handleEvent (const CEventDescriptor& event)
(x < (_XReal+getHrcIconXEnd(_Lines[_OverLine].Depth + _Lines[_OverLine].getNumAdditionnalBitmap()))))
bIcon = true;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
{
if (bText)
{
@ -807,7 +807,7 @@ bool CGroupTree::handleEvent (const CEventDescriptor& event)
}
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
{
// line selection
if (bText)

View file

@ -213,7 +213,7 @@ public:
virtual void draw();
virtual bool handleEvent (const CEventDescriptor& eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
void reset();

View file

@ -43,13 +43,13 @@ bool CInterfaceGroupWheel::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
}
// *****************************************************************************************************************
bool CInterfaceGroupWheel::handleEvent(const CEventDescriptor &event)
bool CInterfaceGroupWheel::handleEvent(const NLGUI::CEventDescriptor &event)
{
if (CInterfaceGroup::handleEvent(event)) return true;
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
{
CInterfaceManager *im = CInterfaceManager::getInstance();
if (eventDesc.getWheel() > 0 && _AHWheelUp)

View file

@ -31,7 +31,7 @@ public:
CInterfaceGroupWheel(const TCtorParam &param);
/// Coming from CInterfaceElement
virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup);
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
private:
IActionHandler *_AHWheelUp;
CStringShared _AHWheelUpParams;

View file

@ -163,12 +163,12 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
// if there was some control capturing the mouse, warn them that they lost the focus
if (pIM->getCapturePointerLeft())
{
pIM->getCapturePointerLeft()->handleEvent(CEventDescriptorSetFocus(pEvent->Get));
pIM->getCapturePointerLeft()->handleEvent(NLGUI::CEventDescriptorSetFocus(pEvent->Get));
}
pIM->setCapturePointerLeft(NULL);
if (pIM->getCapturePointerRight())
{
pIM->getCapturePointerRight()->handleEvent(CEventDescriptorSetFocus(pEvent->Get));
pIM->getCapturePointerRight()->handleEvent(NLGUI::CEventDescriptorSetFocus(pEvent->Get));
}
pIM->setCapturePointerRight(NULL);
UserControls.stopFreeLook();
@ -191,7 +191,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
&& (ClientCfg.R2EDEnabled || R2::getEditor().getCurrentTool())
)
{
R2::getEditor().handleEvent(CEventDescriptorSetFocus(pEvent->Get));
R2::getEditor().handleEvent(NLGUI::CEventDescriptorSetFocus(pEvent->Get));
}
}
@ -224,7 +224,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
event == EventStringId)
{
// if not handled, post to Action Manager
if( !pIM->handleEvent( CEventDescriptorKey((const CEventKey &) event) ) )
if( !pIM->handleEvent( NLGUI::CEventDescriptorKey((const CEventKey &) event) ) )
{
// See if handled by editor
bool handled = false;
@ -232,7 +232,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
&& (ClientCfg.R2EDEnabled || R2::getEditor().getCurrentTool())
)
{
handled = R2::getEditor().handleEvent(CEventDescriptorKey((const CEventKey &) event) );
handled = R2::getEditor().handleEvent(NLGUI::CEventDescriptorKey((const CEventKey &) event) );
}
if (!handled)
{
@ -282,7 +282,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
CViewPointer &rIP = *pIM->getPointer();
CEventDescriptorMouse eventDesc;
NLGUI::CEventDescriptorMouse eventDesc;
sint32 x,y;
rIP.getPointerDispPos (x, y);
eventDesc.setX (x);
@ -326,12 +326,12 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
// handle Event
if(pEvent->Button & leftButton)
{
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftdown);
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouseleftdown);
handled|= pIM->handleEvent (eventDesc);
}
if(pEvent->Button & rightButton)
{
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightdown);
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouserightdown);
handled|= pIM->handleEvent (eventDesc);
}
}
@ -350,12 +350,12 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
// handle Event
if(pEvent->Button & leftButton)
{
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftup);
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouseleftup);
handled|= pIM->handleEvent (eventDesc);
}
if(pEvent->Button & rightButton)
{
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightup);
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouserightup);
handled|= pIM->handleEvent (eventDesc);
}
}
@ -369,12 +369,12 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
// handle Event
if(pEvent->Button & leftButton)
{
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftdblclk);
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouseleftdblclk);
handled|= pIM->handleEvent (eventDesc);
}
if(pEvent->Button & rightButton)
{
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightdblclk);
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouserightdblclk);
handled|= pIM->handleEvent (eventDesc);
}
@ -395,7 +395,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
// handle Event now.
if (_MouseWheel != 0)
{
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mousewheel);
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mousewheel);
eventDesc.setWheel(_MouseWheel);
handled|= pIM->handleEvent (eventDesc);
_MouseWheel = 0;
@ -429,7 +429,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
// ***************************************************************************
bool CInputHandlerManager::updateMousePos(NLMISC::CEventMouse &event, CEventDescriptorMouse &eventDesc)
bool CInputHandlerManager::updateMousePos(NLMISC::CEventMouse &event, NLGUI::CEventDescriptorMouse &eventDesc)
{
if (!IsMouseFreeLook())
{
@ -461,7 +461,7 @@ bool CInputHandlerManager::updateMousePos(NLMISC::CEventMouse &event, CEventDes
eventDesc.setY (y);
// handle Event now.
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mousemove);
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mousemove);
return pIM->handleEvent (eventDesc);
}
}
@ -470,7 +470,7 @@ bool CInputHandlerManager::updateMousePos(NLMISC::CEventMouse &event, CEventDes
// ***************************************************************************
void CInputHandlerManager::CComboKey::init(const CEventDescriptorKey &rDK)
void CInputHandlerManager::CComboKey::init(const NLGUI::CEventDescriptorKey &rDK)
{
Key= rDK.getKey();
CtrlFlags= 0;
@ -493,7 +493,7 @@ bool CInputHandlerManager::CComboKey::operator<(const CComboKey &c) const
// ***************************************************************************
bool CInputHandlerManager::isComboKeyChat(const CEventDescriptorKey &edk) const
bool CInputHandlerManager::isComboKeyChat(const NLGUI::CEventDescriptorKey &edk) const
{
CComboKey ckey;
ckey.init(edk);

View file

@ -96,7 +96,7 @@ public:
* Basics events such as KeyA, KeyB etc.. should be in this config file.
* Combo Keys like Ctrl+A (select all) should be in this config file too.
*/
bool isComboKeyChat(const CEventDescriptorKey &edk) const;
bool isComboKeyChat(const NLGUI::CEventDescriptorKey &edk) const;
/** Pump The Events of The setuped EventServer (ie Driver->EventServer).
@ -165,7 +165,7 @@ private:
{
CtrlFlags= 0;
}
void init(const CEventDescriptorKey &rDK);
void init(const NLGUI::CEventDescriptorKey &rDK);
bool operator<(const CComboKey &c) const;
};
@ -178,7 +178,7 @@ private:
void parseKey(xmlNodePtr cur, std::vector<CComboKey> &out);
// return true if handled
bool updateMousePos(NLMISC::CEventMouse &event, CEventDescriptorMouse &eventDesc);
bool updateMousePos(NLMISC::CEventMouse &event, NLGUI::CEventDescriptorMouse &eventDesc);
};

View file

@ -546,7 +546,7 @@ void CInterface3DScene::draw ()
}
// ----------------------------------------------------------------------------
bool CInterface3DScene::handleEvent (const CEventDescriptor &event)
bool CInterface3DScene::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (!_UserInteraction)
return false;
@ -554,12 +554,12 @@ bool CInterface3DScene::handleEvent (const CEventDescriptor &event)
if (!_Active)
return false;
// if focus is lost then cancel rotation / zoom
if (event.getType() == CEventDescriptor::system)
if (event.getType() == NLGUI::CEventDescriptor::system)
{
const CEventDescriptorSystem &eds = (const CEventDescriptorSystem &) event;
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) event;
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::setfocus)
{
const CEventDescriptorSetFocus &edsf = (const CEventDescriptorSetFocus &) eds;
const NLGUI::CEventDescriptorSetFocus &edsf = (const NLGUI::CEventDescriptorSetFocus &) eds;
if (edsf.hasFocus() == false)
{
_MouseLDown = false;
@ -568,9 +568,9 @@ bool CInterface3DScene::handleEvent (const CEventDescriptor &event)
}
}
}
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if ((CInterfaceManager::getInstance()->getCapturePointerLeft() != this) &&
(CInterfaceManager::getInstance()->getCapturePointerRight() != this) &&
(!((eventDesc.getX() >= _XReal) &&
@ -579,7 +579,7 @@ bool CInterface3DScene::handleEvent (const CEventDescriptor &event)
(eventDesc.getY() <= (_YReal+ _HReal)))))
return false;
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
{
_MouseLDown = true;
_MouseLDownX = eventDesc.getX();
@ -588,12 +588,12 @@ bool CInterface3DScene::handleEvent (const CEventDescriptor &event)
pIM->setCapturePointerLeft(this); // Because we are not just a control
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
_MouseLDown = false;
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
{
_MouseRDown = true;
_MouseRDownX = eventDesc.getX();
@ -602,12 +602,12 @@ bool CInterface3DScene::handleEvent (const CEventDescriptor &event)
pIM->setCapturePointerRight(this); // Because we are not just a control
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
{
_MouseRDown = false;
return true;
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove)
{
if (_MouseLDown)
{

View file

@ -60,7 +60,7 @@ public:
virtual void draw ();
virtual bool handleEvent (const CEventDescriptor &eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
virtual CInterfaceElement* getElement (const std::string &id);

View file

@ -92,7 +92,7 @@ void CInterfaceGroup::setIdRecurse(const std::string &id)
// ------------------------------------------------------------------------------------------------
void CInterfaceGroup::notifyActiveCalled(const CEventDescriptorActiveCalledOnParent &desc)
void CInterfaceGroup::notifyActiveCalled(const NLGUI::CEventDescriptorActiveCalledOnParent &desc)
{
// notify children that the 'active' state of this group has changed
for(std::vector<CInterfaceGroup*>::iterator it = _ChildrenGroups.begin(); it != _ChildrenGroups.end(); ++it)
@ -121,7 +121,7 @@ void CInterfaceGroup::setActive(bool state)
pIM->runActionHandler (_AHOnDeactive, this, _AHOnDeactiveParams);
}
notifyActiveCalled(CEventDescriptorActiveCalledOnParent(state));
notifyActiveCalled(NLGUI::CEventDescriptorActiveCalledOnParent(state));
}
}
@ -685,7 +685,7 @@ bool CInterfaceGroup::isChildGroup(const CInterfaceGroup *group) const
}
// ------------------------------------------------------------------------------------------------
bool CInterfaceGroup::handleEvent (const CEventDescriptor &event)
bool CInterfaceGroup::handleEvent (const NLGUI::CEventDescriptor &event)
{
if (CCtrlBase::handleEvent(event)) return true;
if (!_Active)
@ -693,19 +693,19 @@ bool CInterfaceGroup::handleEvent (const CEventDescriptor &event)
CInterfaceManager *im = CInterfaceManager::getInstance();
if (event.getType() == CEventDescriptor::system)
if (event.getType() == NLGUI::CEventDescriptor::system)
{
CEventDescriptorSystem &eds = (CEventDescriptorSystem&)event;
if (eds.getEventTypeExtended() == CEventDescriptorSystem::activecalledonparent)
NLGUI::CEventDescriptorSystem &eds = (NLGUI::CEventDescriptorSystem&)event;
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::activecalledonparent)
{
// notify all childrens
notifyActiveCalled((CEventDescriptorActiveCalledOnParent &) eds);
notifyActiveCalled((NLGUI::CEventDescriptorActiveCalledOnParent &) eds);
}
}
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
if (!isIn(eventDesc.getX(), eventDesc.getY()))
return false;
@ -733,7 +733,7 @@ bool CInterfaceGroup::handleEvent (const CEventDescriptor &event)
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
{
if (_AHOnLeftClick != NULL)
{
@ -742,7 +742,7 @@ bool CInterfaceGroup::handleEvent (const CEventDescriptor &event)
}
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
{
if (_AHOnRightClick != NULL)
{
@ -750,7 +750,7 @@ bool CInterfaceGroup::handleEvent (const CEventDescriptor &event)
return true;
}
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
{
// handle the Mouse Wheel only if interesting
if (_H>_MaxH)

View file

@ -76,7 +76,7 @@ public:
sint32 getMinUsedW() const;
/// Coming from CCtrlBase
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
void executeControl (const std::string &sControlName);
@ -319,7 +319,7 @@ protected:
void doUpdateCoords();
// notify children controls & groups that 'active' has been called on one of their parent
void notifyActiveCalled(const CEventDescriptorActiveCalledOnParent &desc);
void notifyActiveCalled(const NLGUI::CEventDescriptorActiveCalledOnParent &desc);
protected:

View file

@ -1332,8 +1332,8 @@ void CInterfaceManager::updateFrameEvents()
}
// send clock tick msg to ctrl that are captured
CEventDescriptorSystem clockTick;
clockTick.setEventTypeExtended(CEventDescriptorSystem::clocktick);
NLGUI::CEventDescriptorSystem clockTick;
clockTick.setEventTypeExtended(NLGUI::CEventDescriptorSystem::clocktick);
if (_CapturePointerLeft)
{
_CapturePointerLeft->handleEvent(clockTick);
@ -2671,7 +2671,7 @@ uint CInterfaceManager::getDepth (CCtrlBase *ctrl, CInterfaceGroup *pNewCurrentW
}
// ------------------------------------------------------------------------------------------------
bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event)
{
bool handled= false;
@ -2680,18 +2680,18 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
if (_ActiveAnims[i]->isDisableButtons())
return false;
if (event.getType() == CEventDescriptor::key)
if (event.getType() == NLGUI::CEventDescriptor::key)
{
CEventDescriptorKey &eventDesc = (CEventDescriptorKey&)event;
NLGUI::CEventDescriptorKey &eventDesc = (NLGUI::CEventDescriptorKey&)event;
_LastEventKeyDesc = eventDesc;
// Any Key event disable the ContextHelp
disableContextHelp();
// Hide menu if the key is pushed
// if ((eventDesc.getKeyEventType() == CEventDescriptorKey::keydown) && !_ModalStack.empty() && !eventDesc.getKeyAlt() && !eventDesc.getKeyCtrl() && !eventDesc.getKeyShift())
// if ((eventDesc.getKeyEventType() == NLGUI::CEventDescriptorKey::keydown) && !_ModalStack.empty() && !eventDesc.getKeyAlt() && !eventDesc.getKeyCtrl() && !eventDesc.getKeyShift())
// Hide menu (or popup menu) is ESCAPE pressed
if( eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == KeyESCAPE )
if( eventDesc.getKeyEventType() == NLGUI::CEventDescriptorKey::keychar && eventDesc.getChar() == KeyESCAPE )
{
if(_ModalStack.size() > 0)
{
@ -2702,7 +2702,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
}
// Manage "quit window" If the Key is ESCAPE, no captureKeyboard
if( eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == KeyESCAPE )
if( eventDesc.getKeyEventType() == NLGUI::CEventDescriptorKey::keychar && eventDesc.getChar() == KeyESCAPE )
{
// Get the last escapable active top window. NB: this is ergonomically better.
CInterfaceGroup *win= getLastEscapableTopWindow();
@ -2729,7 +2729,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
}
// Manage complex "Enter"
if (eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == KeyRETURN)
if (eventDesc.getKeyEventType() == NLGUI::CEventDescriptorKey::keychar && eventDesc.getChar() == KeyRETURN)
{
// If the top window has Enter AH
CInterfaceGroup *tw= getTopWindow();
@ -2802,9 +2802,9 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
return result;
}
}
else if (event.getType() == CEventDescriptor::mouse && _MouseHandlingEnabled )
else if (event.getType() == NLGUI::CEventDescriptor::mouse && _MouseHandlingEnabled )
{
CEventDescriptorMouse &eventDesc = (CEventDescriptorMouse&)event;
NLGUI::CEventDescriptorMouse &eventDesc = (NLGUI::CEventDescriptorMouse&)event;
// First thing to do : Capture handling
if (_CapturePointerLeft != NULL)
@ -2817,7 +2817,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
_WindowUnder = ptr?ptr->getId():"";
// Any Mouse event but move disable the ContextHelp
if(eventDesc.getEventTypeExtended() != CEventDescriptorMouse::mousemove)
if(eventDesc.getEventTypeExtended() != NLGUI::CEventDescriptorMouse::mousemove)
{
disableContextHelp();
}
@ -2844,8 +2844,8 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
{
// If there is a handler on click out launch it
if (pNewCurrentWnd != mwi.ModalWindow)
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown ||
(eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown))
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown ||
(eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown))
if (!mwi.ModalHandlerClickOut.empty())
runActionHandler(mwi.ModalHandlerClickOut,NULL,mwi.ModalClickOutParams);
@ -2855,8 +2855,8 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
// NB: don't force handle==true because to quit a modal does not avoid other actions
// quit if click outside
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown ||
(eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown))
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown ||
(eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown))
{
clickedOutModalWindow = dynamic_cast<CGroupModal *>((CInterfaceGroup*)mwi.ModalWindow);
// disable the modal
@ -2885,7 +2885,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
}
// Manage LeftClick.
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
{
if ((pNewCurrentWnd != NULL) && (_ModalStack.empty()) && (pNewCurrentWnd->getOverlappable()))
{
@ -2937,7 +2937,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
}
// Manage RightClick
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
{
if ((pNewCurrentWnd != NULL) && (_ModalStack.empty()) && (pNewCurrentWnd->getOverlappable()))
{
@ -2981,7 +2981,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
handled |= _CapturePointerRight->handleEvent(event);
}
}
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
{
if (!handled)
if (pNewCurrentWnd != NULL)
@ -3001,7 +3001,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
{
if (((pNewCurrentWnd != NULL) && _ModalStack.empty()) || ((!_ModalStack.empty() && _ModalStack.back().ModalWindow == pNewCurrentWnd)))
{
CEventDescriptorMouse ev2 = eventDesc;
NLGUI::CEventDescriptorMouse ev2 = eventDesc;
sint32 x= eventDesc.getX(), y = eventDesc.getY();
if (pNewCurrentWnd)
{
@ -3011,13 +3011,13 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
}
// After handle event of a left click, may set window Top if movable (infos etc...)
//if( (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown) && pNewCurrentWnd->isMovable() )
//if( (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown) && pNewCurrentWnd->isMovable() )
// setTopWindow(pNewCurrentWnd);
}
}
// Put here to let a chance to the window to handle if the capture dont
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
{
if (_CapturePointerLeft != NULL)
{
@ -3039,7 +3039,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
if(mwi.ModalExitClickR)
{
// quit if click right
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
// disable the modal
disableModalWindow();
}
@ -3048,7 +3048,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
if(mwi.ModalExitClickL)
{
// quit if click right
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
// disable the modal
disableModalWindow();
}

View file

@ -338,7 +338,7 @@ public:
/// Handle The Event. return true if the interfaceManager catch it and if must not send to the Game Action Manager
bool handleEvent (const CEventDescriptor &eventDesc);
bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
void runActionHandler (const std::string &AHName, CCtrlBase *pCaller,
const std::string &Params=std::string(""));
void runActionHandler (IActionHandler *ah, CCtrlBase *pCaller,
@ -704,7 +704,7 @@ public:
}
// Description of the last key event that called an action handler
const CEventDescriptorKey& getLastEventKeyDesc() const { return _LastEventKeyDesc; }
const NLGUI::CEventDescriptorKey& getLastEventKeyDesc() const { return _LastEventKeyDesc; }
void notifyMailAvailable();
void notifyForumUpdated();
@ -1034,7 +1034,7 @@ private:
sint32 _CurrentPlayerCharac[CHARACTERISTICS::NUM_CHARACTERISTICS];
// Description of the last key event that called an action handler
CEventDescriptorKey _LastEventKeyDesc;
NLGUI::CEventDescriptorKey _LastEventKeyDesc;
// observers for copying database branch changes
CServerToLocalAutoCopy ServerToLocalAutoCopyInventory;

View file

@ -131,7 +131,7 @@ public:
_Parent->getCorner(winX, winY, _ParentPosRef);
return contains(x - winX, y - winY);
}
virtual bool handleEvent (const CEventDescriptor &/* event */)
virtual bool handleEvent (const NLGUI::CEventDescriptor &/* event */)
{
return false;
}

View file

@ -4739,17 +4739,17 @@ void CEditor::autoSave()
}
// *********************************************************************************************************
bool CEditor::handleEvent (const CEventDescriptor &eventDesc)
bool CEditor::handleEvent (const NLGUI::CEventDescriptor &eventDesc)
{
//H_AUTO(R2_CEditor_handleEvent )
CHECK_EDITOR
if (ConnectionWanted || !_CurrentTool) return false; // TMP special case for connection
if (eventDesc.getType() == CEventDescriptor::system)
if (eventDesc.getType() == NLGUI::CEventDescriptor::system)
{
const CEventDescriptorSystem &eds = (const CEventDescriptorSystem &) eventDesc;
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) eventDesc;
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::setfocus)
{
const CEventDescriptorSetFocus &edsf = (const CEventDescriptorSetFocus &) eds;
const NLGUI::CEventDescriptorSetFocus &edsf = (const NLGUI::CEventDescriptorSetFocus &) eds;
if (edsf.hasFocus() == false)
{
// cancel current tool

View file

@ -250,7 +250,7 @@ public:
* Handle an user input event
* \return true if the event was handled by the editor
*/
bool handleEvent (const CEventDescriptor &eventDesc);
bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
// Handle copy, reaches the editor if no edit box is currently active
void copy();

View file

@ -41,7 +41,7 @@ void CInstanceMapDeco::CCtrlButtonEntity::getContextHelp(ucstring &help) const
}
// *********************************************************************************************************
bool CInstanceMapDeco::CCtrlButtonEntity::handleEvent(const CEventDescriptor &/* event */)
bool CInstanceMapDeco::CCtrlButtonEntity::handleEvent(const NLGUI::CEventDescriptor &/* event */)
{
//H_AUTO(R2_CCtrlButtonEntity_handleEvent)
return false; // just a display with tooltip capability

View file

@ -80,7 +80,7 @@ private:
CCtrlButtonEntity(CInstance &instance) : CCtrlButton(TCtorParam()), _Instance(instance) {}
// from IDisplayerUIHandle
virtual CInstance &getDisplayedInstance() { return _Instance; }
virtual bool handleEvent (const CEventDescriptor &event);
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
private:
CInstance &_Instance;
protected:

View file

@ -760,42 +760,42 @@ void CTool::setMouseCursor(const char *cursorTexture)
}
// ***************************************************************
bool CTool::handleEvent(const CEventDescriptor &event)
bool CTool::handleEvent(const NLGUI::CEventDescriptor &event)
{
//H_AUTO(R2_CTool_handleEvent)
bool handled = false;
if (event.getType() == CEventDescriptor::mouse)
if (event.getType() == NLGUI::CEventDescriptor::mouse)
{
CEventDescriptorMouse &eventDesc = (CEventDescriptorMouse&)event;
NLGUI::CEventDescriptorMouse &eventDesc = (NLGUI::CEventDescriptorMouse&)event;
switch(eventDesc.getEventTypeExtended())
{
case CEventDescriptorMouse::mousemove:
case NLGUI::CEventDescriptorMouse::mousemove:
handled = onMouseMove();
break;
case CEventDescriptorMouse::mouseleftdown:
case NLGUI::CEventDescriptorMouse::mouseleftdown:
handled = onMouseLeftButtonDown();
//if (handled) nlwarning("onMouseLeftButtonDown handled");
break;
case CEventDescriptorMouse::mouserightdown:
case NLGUI::CEventDescriptorMouse::mouserightdown:
handled = onMouseRightButtonDown();
//if (handled) nlwarning("onMouseRightButtonDown handled");
break;
case CEventDescriptorMouse::mouseleftup:
case NLGUI::CEventDescriptorMouse::mouseleftup:
handled = onMouseLeftButtonUp();
//if (handled) nlwarning("onMouseLeftButtonUp handled");
break;
case CEventDescriptorMouse::mouserightup:
case NLGUI::CEventDescriptorMouse::mouserightup:
handled = onMouseRightButtonUp();
//if (handled) nlwarning("onMouseRightButtonUp handled");
break;
}
}
if (event.getType() == CEventDescriptor::system)
if (event.getType() == NLGUI::CEventDescriptor::system)
{
const CEventDescriptorSystem &eds = (const CEventDescriptorSystem &) event;
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) event;
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::setfocus)
{
const CEventDescriptorSetFocus &edsf = (const CEventDescriptorSetFocus &) eds;
const NLGUI::CEventDescriptorSetFocus &edsf = (const NLGUI::CEventDescriptorSetFocus &) eds;
if (edsf.hasFocus() == true)
{
onFocusGained();

View file

@ -26,7 +26,10 @@
//
class CInterfaceManager;
namespace NLGUI
{
class CEventDescriptor;
}
class CLuaObject;
class CGroupMap;
@ -119,7 +122,7 @@ public:
*
* \return true if the event has been handled by the tool
*/
virtual bool handleEvent (const CEventDescriptor &eventDesc);
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
//
virtual void onFocusGained() {} // the app window gained the focus (there's no 'focus lost' event here because it reset current tool, so 'CTooll::cancel' will be called instead)
// IMPORTANT : Reacting to this should be unnecessary, as lost focus reset the current tool,