Moved event descriptors under the NLGUI namespace.
This commit is contained in:
parent
862b2b8cb9
commit
fce2d8e443
69 changed files with 354 additions and 329 deletions
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
#include "nel/misc/types_nl.h"
|
#include "nel/misc/types_nl.h"
|
||||||
|
|
||||||
|
namespace NLGUI
|
||||||
|
{
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
class CEventDescriptor
|
class CEventDescriptor
|
||||||
|
@ -247,6 +249,8 @@ protected:
|
||||||
bool _HasFocus;
|
bool _HasFocus;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif // RZ_EVENT_DESCRIPTOR_H
|
#endif // RZ_EVENT_DESCRIPTOR_H
|
||||||
|
|
||||||
/* End of event_descriptor.h */
|
/* End of event_descriptor.h */
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
#include "nel/misc/events.h"
|
#include "nel/misc/events.h"
|
||||||
#include "nel/gui/event_descriptor.h"
|
#include "nel/gui/event_descriptor.h"
|
||||||
|
|
||||||
|
namespace NLGUI
|
||||||
|
{
|
||||||
|
|
||||||
void CEventDescriptorKey::init(const NLMISC::CEventKey &ev)
|
void CEventDescriptorKey::init(const NLMISC::CEventKey &ev)
|
||||||
{
|
{
|
||||||
_CtrlState = (ev.Button & NLMISC::ctrlKeyButton) != 0;
|
_CtrlState = (ev.Button & NLMISC::ctrlKeyButton) != 0;
|
||||||
|
@ -50,3 +53,5 @@ void CEventDescriptorKey::init(const NLMISC::CEventKey &ev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -2249,7 +2249,7 @@ class CAHConfirmTrade : public IActionHandler
|
||||||
case 1: enableResale = true; break;
|
case 1: enableResale = true; break;
|
||||||
default: // 2: comes only from Enter of Shift+Enter key from an edit box or in the modal window
|
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();
|
enableResale = ! keyEvent.getKeyShift();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
NLGUI::CEventDescriptorSystem &eds = (NLGUI::CEventDescriptorSystem&)event;
|
||||||
if (eds.getEventTypeExtended() == CEventDescriptorSystem::activecalledonparent)
|
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
|
// the mouse capture should be lost when the ctrl is hidden
|
||||||
CInterfaceManager *manager = CInterfaceManager::getInstance();
|
CInterfaceManager *manager = CInterfaceManager::getInstance();
|
||||||
|
|
|
@ -58,7 +58,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/// Handle all events (implemented by derived classes) (return true to signal event handled)
|
/// 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; }
|
virtual CCtrlBase *getSubCtrl (sint32 /* x */, sint32 /* y */) { return this; }
|
||||||
|
|
||||||
|
|
|
@ -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 (CCtrlBase::handleEvent(event)) return true;
|
||||||
if (!_Active || _Frozen)
|
if (!_Active || _Frozen)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (event.getType() == CEventDescriptor::mouse)
|
if (event.getType() == NLGUI::CEventDescriptor::mouse)
|
||||||
{
|
{
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
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)
|
if (pIM->getCapturePointerLeft() != this)
|
||||||
return false;
|
return false;
|
||||||
|
@ -223,7 +223,7 @@ bool CCtrlBaseButton::handleEvent (const CEventDescriptor& event)
|
||||||
(eventDesc.getY() <= (_YReal+ _HReal))))
|
(eventDesc.getY() <= (_YReal+ _HReal))))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
|
||||||
{
|
{
|
||||||
if (_AHOnLeftDblClick)
|
if (_AHOnLeftDblClick)
|
||||||
{
|
{
|
||||||
|
@ -246,7 +246,7 @@ bool CCtrlBaseButton::handleEvent (const CEventDescriptor& event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
{
|
{
|
||||||
if (pIM->getCapturePointerLeft() != this)
|
if (pIM->getCapturePointerLeft() != this)
|
||||||
return false;
|
return false;
|
||||||
|
@ -299,12 +299,12 @@ bool CCtrlBaseButton::handleEvent (const CEventDescriptor& event)
|
||||||
// Always return true on LeftClick.
|
// Always return true on LeftClick.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
|
||||||
{
|
{
|
||||||
_LastLeftClickButton = NULL;
|
_LastLeftClickButton = NULL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
|
||||||
{
|
{
|
||||||
_LastLeftClickButton = NULL;
|
_LastLeftClickButton = NULL;
|
||||||
bool handled= false;
|
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;
|
const NLGUI::CEventDescriptorSystem &systemEvent = (const NLGUI::CEventDescriptorSystem &) event;
|
||||||
if (systemEvent.getEventTypeExtended() == CEventDescriptorSystem::clocktick)
|
if (systemEvent.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::clocktick)
|
||||||
{
|
{
|
||||||
if (_AHOnClockTick != NULL)
|
if (_AHOnClockTick != NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
CCtrlBaseButton(const TCtorParam ¶m);
|
CCtrlBaseButton(const TCtorParam ¶m);
|
||||||
|
|
||||||
virtual bool parse (xmlNodePtr cur,CInterfaceGroup * parentGroup);
|
virtual bool parse (xmlNodePtr cur,CInterfaceGroup * parentGroup);
|
||||||
virtual bool handleEvent (const CEventDescriptor& event);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor& event);
|
||||||
|
|
||||||
/// \name Misc
|
/// \name Misc
|
||||||
// @{
|
// @{
|
||||||
|
|
|
@ -22,8 +22,10 @@
|
||||||
#include "ctrl_base_button.h"
|
#include "ctrl_base_button.h"
|
||||||
#include "view_renderer.h"
|
#include "view_renderer.h"
|
||||||
|
|
||||||
|
namespace NLGUI
|
||||||
|
{
|
||||||
class CEventDescriptor;
|
class CEventDescriptor;
|
||||||
|
}
|
||||||
class CInterfaceManager;
|
class CInterfaceManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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 (CCtrlBase::handleEvent(event)) return true;
|
||||||
if (!_Active)
|
if (!_Active)
|
||||||
return false;
|
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) &&
|
if ((CInterfaceManager::getInstance()->getCapturePointerLeft() != this) &&
|
||||||
(!((eventDesc.getX() >= _XReal) &&
|
(!((eventDesc.getX() >= _XReal) &&
|
||||||
(eventDesc.getX() < (_XReal + _WReal))&&
|
(eventDesc.getX() < (_XReal + _WReal))&&
|
||||||
|
@ -123,18 +123,18 @@ bool CCtrlColPick::handleEvent (const CEventDescriptor &event)
|
||||||
(eventDesc.getY() <= (_YReal+ _HReal)))))
|
(eventDesc.getY() <= (_YReal+ _HReal)))))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
|
||||||
{
|
{
|
||||||
_MouseDown = true;
|
_MouseDown = true;
|
||||||
selectColor(eventDesc.getX()-_XReal, eventDesc.getY()-_YReal);
|
selectColor(eventDesc.getX()-_XReal, eventDesc.getY()-_YReal);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
{
|
{
|
||||||
_MouseDown = false;
|
_MouseDown = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove)
|
||||||
{
|
{
|
||||||
if (_MouseDown)
|
if (_MouseDown)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
|
|
||||||
virtual void updateCoords();
|
virtual void updateCoords();
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
virtual bool handleEvent (const CEventDescriptor &event);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
|
||||||
|
|
||||||
sint32 getColorR () const { return _ColorSelect.R; }
|
sint32 getColorR () const { return _ColorSelect.R; }
|
||||||
sint32 getColorG () const { return _ColorSelect.G; }
|
sint32 getColorG () const { return _ColorSelect.G; }
|
||||||
|
|
|
@ -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)
|
H_AUTO(Rz_CCtrlPolygon_handleEvent)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
//const NLMISC::CMatrix &getMatrix() const { return _Matrix; }
|
//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)
|
// test if last call to 'setVertices' was for a valid poly (e.g one that doesn't overlapp itself)
|
||||||
bool isValid() const { return _Valid; }
|
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)
|
// no capturable by default (just tooltip capability wanted)
|
||||||
virtual bool isCapturable() const { return false; }
|
virtual bool isCapturable() const { return false; }
|
||||||
|
|
|
@ -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)
|
H_AUTO(Rz_CCtrlQuad_handleEvent)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -85,7 +85,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
// from CCtrlBase, no op by default
|
// 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)
|
// see if this control contains the given point (in parent coords)
|
||||||
bool contains(const NLMISC::CVector2f &pos) const;
|
bool contains(const NLMISC::CVector2f &pos) const;
|
||||||
|
|
|
@ -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 (CCtrlBase::handleEvent(event)) return true;
|
||||||
if (!_Active || _Frozen)
|
if (!_Active || _Frozen)
|
||||||
return false;
|
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) &&
|
if ((CInterfaceManager::getInstance()->getCapturePointerLeft() != this) &&
|
||||||
(!((eventDesc.getX() >= _XReal) &&
|
(!((eventDesc.getX() >= _XReal) &&
|
||||||
(eventDesc.getX() < (_XReal + _WReal))&&
|
(eventDesc.getX() < (_XReal + _WReal))&&
|
||||||
|
@ -472,7 +472,7 @@ bool CCtrlScroll::handleEvent (const CEventDescriptor &event)
|
||||||
(eventDesc.getY() <= (_YReal+ _HReal)))))
|
(eventDesc.getY() <= (_YReal+ _HReal)))))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
|
||||||
{
|
{
|
||||||
_MouseDown = true;
|
_MouseDown = true;
|
||||||
_InitialValue = getValue();
|
_InitialValue = getValue();
|
||||||
|
@ -490,20 +490,20 @@ bool CCtrlScroll::handleEvent (const CEventDescriptor &event)
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
{
|
{
|
||||||
_MouseDown = false;
|
_MouseDown = false;
|
||||||
runAH(_AHOnScrollEnd, _AHOnScrollEndParams.empty() ? _AHOnScrollParams : _AHOnScrollEndParams); // backward compatibility
|
runAH(_AHOnScrollEnd, _AHOnScrollEndParams.empty() ? _AHOnScrollParams : _AHOnScrollEndParams); // backward compatibility
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown && _MouseDown && _Cancelable)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown && _MouseDown && _Cancelable)
|
||||||
{
|
{
|
||||||
_MouseDown = false;
|
_MouseDown = false;
|
||||||
setValue(_InitialValue);
|
setValue(_InitialValue);
|
||||||
runAH(_AHOnScrollCancel, _AHOnScrollCancelParams); // backward compatibility
|
runAH(_AHOnScrollCancel, _AHOnScrollCancelParams); // backward compatibility
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove)
|
||||||
{
|
{
|
||||||
if (_MouseDown)
|
if (_MouseDown)
|
||||||
{
|
{
|
||||||
|
@ -514,7 +514,7 @@ bool CCtrlScroll::handleEvent (const CEventDescriptor &event)
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel && _Vertical)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel && _Vertical)
|
||||||
{
|
{
|
||||||
moveTrackY (eventDesc.getWheel() * 12);
|
moveTrackY (eventDesc.getWheel() * 12);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
|
|
||||||
virtual void updateCoords();
|
virtual void updateCoords();
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
virtual bool handleEvent (const CEventDescriptor &event);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
|
||||||
|
|
||||||
|
|
||||||
void setTarget (CInterfaceGroup *pIG);
|
void setTarget (CInterfaceGroup *pIG);
|
||||||
|
|
|
@ -23,7 +23,10 @@
|
||||||
#include "view_renderer.h"
|
#include "view_renderer.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace NLGUI
|
||||||
|
{
|
||||||
class CEventDescriptor;
|
class CEventDescriptor;
|
||||||
|
}
|
||||||
class CInterfaceManager;
|
class CInterfaceManager;
|
||||||
class CViewText;
|
class CViewText;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
if (CCtrlBase::handleEvent(event)) return true;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -22,7 +22,10 @@
|
||||||
#include "ctrl_base.h"
|
#include "ctrl_base.h"
|
||||||
#include "nel/3d/u_texture.h"
|
#include "nel/3d/u_texture.h"
|
||||||
|
|
||||||
|
namespace NLGUI
|
||||||
|
{
|
||||||
class CEventDescriptor;
|
class CEventDescriptor;
|
||||||
|
}
|
||||||
class CInterfaceManager;
|
class CInterfaceManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,7 +40,7 @@ public:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
CCtrlToolTip(const TCtorParam ¶m) : CCtrlBase(param) {}
|
CCtrlToolTip(const TCtorParam ¶m) : CCtrlBase(param) {}
|
||||||
|
|
||||||
virtual bool handleEvent (const CEventDescriptor& eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
||||||
// Can do nothing with tooltip (but display it :) )
|
// Can do nothing with tooltip (but display it :) )
|
||||||
|
|
|
@ -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;
|
if (CCtrlBase::handleEvent(event)) return true;
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
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
|
// Handle drag'n'drop
|
||||||
if (pIM->getCapturePointerLeft() == this)
|
if (pIM->getCapturePointerLeft() == this)
|
||||||
{
|
{
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown && !_Draging)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown && !_Draging)
|
||||||
{
|
{
|
||||||
_DragX = eventDesc.getX();
|
_DragX = eventDesc.getX();
|
||||||
_DragY = eventDesc.getY();
|
_DragY = eventDesc.getY();
|
||||||
|
@ -2655,7 +2655,7 @@ bool CDBCtrlSheet::handleEvent (const CEventDescriptor &event)
|
||||||
if (_Draging)
|
if (_Draging)
|
||||||
{
|
{
|
||||||
// If mouse left up, must end the Drag
|
// If mouse left up, must end the Drag
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
{
|
{
|
||||||
bool handled = false;
|
bool handled = false;
|
||||||
// get the ctrl under the drop
|
// get the ctrl under the drop
|
||||||
|
@ -2843,7 +2843,7 @@ bool CDBCtrlSheet::handleEvent (const CEventDescriptor &event)
|
||||||
(eventDesc.getY() <= (_YReal+ _HReal))))
|
(eventDesc.getY() <= (_YReal+ _HReal))))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
{
|
{
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||||
if (pIM->getCapturePointerLeft() != this)
|
if (pIM->getCapturePointerLeft() != this)
|
||||||
|
@ -2865,12 +2865,12 @@ bool CDBCtrlSheet::handleEvent (const CEventDescriptor &event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
|
||||||
{
|
{
|
||||||
bool handled= false;
|
bool handled= false;
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||||
|
|
|
@ -189,7 +189,7 @@ public:
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
void drawSheet (sint32 scrX, sint32 scrY, bool draging, bool showSelectionBorder = true);
|
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 setActionOnLeftClick (const std::string &ActionHandlerName) { _AHOnLeftClick = getAH(ActionHandlerName, _AHLeftClickParams); }
|
||||||
void setActionOnRightClick (const std::string &ActionHandlerName) { _AHOnRightClick = getAH(ActionHandlerName, _AHRightClickParams); }
|
void setActionOnRightClick (const std::string &ActionHandlerName) { _AHOnRightClick = getAH(ActionHandlerName, _AHRightClickParams); }
|
||||||
|
|
|
@ -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 (isIn(eventDesc.getX(), eventDesc.getY()))
|
||||||
{
|
{
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
|
||||||
{
|
{
|
||||||
if (_ScrollBar != NULL)
|
if (_ScrollBar != NULL)
|
||||||
{
|
{
|
||||||
|
@ -765,7 +765,7 @@ bool CDBGroupListSheet::handleEvent (const CEventDescriptor &event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
{
|
{
|
||||||
CGroupContainer *pGC = getContainer();
|
CGroupContainer *pGC = getContainer();
|
||||||
if (pGC != NULL) pGC->setHighLighted(false);
|
if (pGC != NULL) pGC->setHighLighted(false);
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
virtual void checkCoords ();
|
virtual void checkCoords ();
|
||||||
virtual void draw ();
|
virtual void draw ();
|
||||||
virtual void clearViews ();
|
virtual void clearViews ();
|
||||||
virtual bool handleEvent (const CEventDescriptor &eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
|
||||||
|
|
||||||
// mod interface
|
// mod interface
|
||||||
void changeNbRow(sint delta);
|
void changeNbRow(sint delta);
|
||||||
|
|
|
@ -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;
|
_Scrolling = 0;
|
||||||
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
|
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
|
||||||
if (isIn(eventDesc.getX(), eventDesc.getY()))
|
if (isIn(eventDesc.getX(), eventDesc.getY()))
|
||||||
{
|
{
|
||||||
// Drag'n'drop from a ctrl sheet that belongs to this list
|
// 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;
|
pDraggedSheet = _SheetChildren[pos]->Ctrl;
|
||||||
pIM->setCapturePointerLeft(pDraggedSheet);
|
pIM->setCapturePointerLeft(pDraggedSheet);
|
||||||
CEventDescriptorMouse newEv = eventDesc;
|
NLGUI::CEventDescriptorMouse newEv = eventDesc;
|
||||||
// Send this because not send (the captured button has processed the event mouseleftdown)
|
// 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);
|
pDraggedSheet->handleEvent(newEv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -711,7 +711,7 @@ bool CDBGroupListSheetText::handleEvent (const CEventDescriptor &event)
|
||||||
if(swapable())
|
if(swapable())
|
||||||
{
|
{
|
||||||
if (pDraggedSheet != NULL)
|
if (pDraggedSheet != NULL)
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
{
|
{
|
||||||
sint posdst = -1,possrc = -1;
|
sint posdst = -1,possrc = -1;
|
||||||
const vector<CCtrlBase*> &rV = pIM->getCtrlsUnderPointer();
|
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 scroll ok, and if scroll possible
|
||||||
if (_ScrollBar != NULL && _List != NULL && _List->getH()>_List->getMaxH())
|
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;
|
const NLGUI::CEventDescriptorSystem &systemEvent = (const NLGUI::CEventDescriptorSystem &) event;
|
||||||
if (systemEvent.getEventTypeExtended() == CEventDescriptorSystem::clocktick)
|
if (systemEvent.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::clocktick)
|
||||||
{
|
{
|
||||||
if (_Scrolling != 0)
|
if (_Scrolling != 0)
|
||||||
if (_ScrollBar != NULL && _List != NULL)
|
if (_ScrollBar != NULL && _List != NULL)
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
virtual void checkCoords ();
|
virtual void checkCoords ();
|
||||||
virtual void draw ();
|
virtual void draw ();
|
||||||
virtual void clearViews ();
|
virtual void clearViews ();
|
||||||
virtual bool handleEvent (const CEventDescriptor &eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
|
||||||
|
|
||||||
/// \name IListSheetBase implementation
|
/// \name IListSheetBase implementation
|
||||||
// @{
|
// @{
|
||||||
|
|
|
@ -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 (isIn(eventDesc.getX(), eventDesc.getY()))
|
||||||
{
|
{
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
|
||||||
{
|
{
|
||||||
changeValue (eventDesc.getWheel());
|
changeValue (eventDesc.getWheel());
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -51,7 +51,7 @@ public:
|
||||||
virtual void checkCoords();
|
virtual void checkCoords();
|
||||||
virtual void draw ();
|
virtual void draw ();
|
||||||
virtual void clearViews ();
|
virtual void clearViews ();
|
||||||
virtual bool handleEvent (const CEventDescriptor &eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
|
||||||
|
|
||||||
// mod interface
|
// mod interface
|
||||||
void changeValue(sint delta);
|
void changeValue(sint delta);
|
||||||
|
|
|
@ -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 ((_RadarView != NULL) && (_RadarRangeView != NULL))
|
||||||
{
|
{
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
|
||||||
{
|
{
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||||
_RadarPos = pIM->getDbProp("UI:SAVE:RADARZOOM")->getValue32();
|
_RadarPos = pIM->getDbProp("UI:SAVE:RADARZOOM")->getValue32();
|
||||||
|
|
|
@ -86,7 +86,7 @@ public:
|
||||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
||||||
virtual void updateCoords();
|
virtual void updateCoords();
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
virtual bool handleEvent (const CEventDescriptor &eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
|
||||||
|
|
||||||
void setTarget(const CCompassTarget &target);
|
void setTarget(const CCompassTarget &target);
|
||||||
const CCompassTarget &getTarget() const { return _Target; }
|
const CCompassTarget &getTarget() const { return _Target; }
|
||||||
|
|
|
@ -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 (CCtrlBase::handleEvent(event)) return true;
|
||||||
if (!_Active || !_Parent)
|
if (!_Active || !_Parent)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (event.getType() == CEventDescriptor::system)
|
if (event.getType() == NLGUI::CEventDescriptor::system)
|
||||||
{
|
{
|
||||||
const CEventDescriptorSystem &eds = (const CEventDescriptorSystem &) event;
|
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) event;
|
||||||
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
|
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)
|
if (edsf.hasFocus() == false && _MouseDown)
|
||||||
{
|
{
|
||||||
_MouseDown = false;
|
_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()))
|
if ((CInterfaceManager::getInstance()->getCapturePointerLeft() != this) && !isIn(eventDesc.getX(), eventDesc.getY()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
CGroupContainer *gc = dynamic_cast<CGroupContainer *>(_Parent);
|
CGroupContainer *gc = dynamic_cast<CGroupContainer *>(_Parent);
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
|
||||||
{
|
{
|
||||||
// must check that parent isn't closed
|
// must check that parent isn't closed
|
||||||
if (gc)
|
if (gc)
|
||||||
|
@ -200,13 +200,13 @@ bool CCtrlResizer::handleEvent (const CEventDescriptor &event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
{
|
{
|
||||||
_MouseDown = false;
|
_MouseDown = false;
|
||||||
_Parent->invalidateCoords();
|
_Parent->invalidateCoords();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove)
|
||||||
{
|
{
|
||||||
if (_MouseDown)
|
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 (CCtrlBase::handleEvent(event)) return true;
|
||||||
if (!_Active)
|
if (!_Active)
|
||||||
|
@ -568,12 +568,12 @@ bool CCtrlMover::handleEvent (const CEventDescriptor &event)
|
||||||
|
|
||||||
CInterfaceManager *pIM= CInterfaceManager::getInstance();
|
CInterfaceManager *pIM= CInterfaceManager::getInstance();
|
||||||
|
|
||||||
if (event.getType() == CEventDescriptor::system)
|
if (event.getType() == NLGUI::CEventDescriptor::system)
|
||||||
{
|
{
|
||||||
const CEventDescriptorSystem &eds = (const CEventDescriptorSystem &) event;
|
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) event;
|
||||||
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
|
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)
|
if (edsf.hasFocus() == false && _Moving)
|
||||||
{
|
{
|
||||||
stopMove(pIM);
|
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
|
// the ctrl must have been captured
|
||||||
if (pIM->getCapturePointerLeft() != this)
|
if (pIM->getCapturePointerLeft() != this)
|
||||||
return false;
|
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)
|
if (_WaitToOpenClose)
|
||||||
{
|
{
|
||||||
|
@ -657,7 +657,7 @@ bool CCtrlMover::handleEvent (const CEventDescriptor &event)
|
||||||
|
|
||||||
if (_CanOpen || gc->isOpenWhenPopup())
|
if (_CanOpen || gc->isOpenWhenPopup())
|
||||||
{
|
{
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
{
|
{
|
||||||
if (!_Parent) return false;
|
if (!_Parent) return false;
|
||||||
gc->setHighLighted(false);
|
gc->setHighLighted(false);
|
||||||
|
@ -704,7 +704,7 @@ bool CCtrlMover::handleEvent (const CEventDescriptor &event)
|
||||||
if (_CanMove)
|
if (_CanMove)
|
||||||
{
|
{
|
||||||
// Enter Moving?
|
// Enter Moving?
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown )
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown )
|
||||||
{
|
{
|
||||||
_MoveStartX= _Parent->getX()-eventDesc.getX();
|
_MoveStartX= _Parent->getX()-eventDesc.getX();
|
||||||
_MoveStartY= _Parent->getY()-eventDesc.getY();
|
_MoveStartY= _Parent->getY()-eventDesc.getY();
|
||||||
|
@ -725,13 +725,13 @@ bool CCtrlMover::handleEvent (const CEventDescriptor &event)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Leave Moving?
|
// Leave Moving?
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup )
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup )
|
||||||
{
|
{
|
||||||
stopMove(pIM);
|
stopMove(pIM);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Move
|
// Move
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove )
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove )
|
||||||
{
|
{
|
||||||
_HasMoved = true;
|
_HasMoved = true;
|
||||||
if (gc) gc->touch();
|
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;
|
const NLGUI::CEventDescriptorSystem &systemEvent = (const NLGUI::CEventDescriptorSystem &) event;
|
||||||
if (systemEvent.getEventTypeExtended() == CEventDescriptorSystem::clocktick)
|
if (systemEvent.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::clocktick)
|
||||||
{
|
{
|
||||||
if (_WaitToOpenClose)
|
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);
|
gc->setHighLighted(false);
|
||||||
sint32 deltaX = x - _Parent->getX();
|
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;
|
if (!gc) return;
|
||||||
sint32 deltaY = y - gc->getY();
|
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)
|
if (!_Active)
|
||||||
return false;
|
return false;
|
||||||
|
@ -2282,13 +2282,13 @@ bool CGroupContainer::handleEvent (const CEventDescriptor& event)
|
||||||
|
|
||||||
if (!CInterfaceGroup::handleEvent(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
|
// MouseWheel mgt
|
||||||
if ((_LayerSetup == 0) && (isIn(eventDesc.getX(), eventDesc.getY())))
|
if ((_LayerSetup == 0) && (isIn(eventDesc.getX(), eventDesc.getY())))
|
||||||
{
|
{
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
|
||||||
{
|
{
|
||||||
if (_ScrollBar != NULL)
|
if (_ScrollBar != NULL)
|
||||||
_ScrollBar->moveTrackY (eventDesc.getWheel()*12);
|
_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;
|
bool bRet = true;
|
||||||
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 ((eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown) ||
|
if ((eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown) ||
|
||||||
(eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown))
|
(eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown))
|
||||||
{
|
{
|
||||||
bRet = blinkAllSons();
|
bRet = blinkAllSons();
|
||||||
}
|
}
|
||||||
// Additionaly, if it is a UP, don't blink, but return false if some son active
|
// Additionaly, if it is a UP, don't blink, but return false if some son active
|
||||||
if (bRet && (
|
if (bRet && (
|
||||||
(eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup) ||
|
(eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup) ||
|
||||||
(eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup))
|
(eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
bRet= !isGrayed();
|
bRet= !isGrayed();
|
||||||
|
|
|
@ -22,7 +22,10 @@
|
||||||
#include "interface_group.h"
|
#include "interface_group.h"
|
||||||
#include "nel/misc/smart_ptr.h"
|
#include "nel/misc/smart_ptr.h"
|
||||||
|
|
||||||
|
namespace NLGUI
|
||||||
|
{
|
||||||
class CEventDescriptorLocalised;
|
class CEventDescriptorLocalised;
|
||||||
|
}
|
||||||
class CInterfaceList;
|
class CInterfaceList;
|
||||||
class CCtrlButton;
|
class CCtrlButton;
|
||||||
class CCtrlScroll;
|
class CCtrlScroll;
|
||||||
|
@ -48,7 +51,7 @@ public:
|
||||||
|
|
||||||
CCtrlResizer(const TCtorParam ¶m);
|
CCtrlResizer(const TCtorParam ¶m);
|
||||||
virtual void draw ();
|
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
|
// 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; }
|
virtual uint getDeltaDepth() const { return 100; }
|
||||||
|
|
||||||
|
@ -99,7 +102,7 @@ public:
|
||||||
CCtrlMover(const TCtorParam ¶m, bool canMove, bool canOpen);
|
CCtrlMover(const TCtorParam ¶m, bool canMove, bool canOpen);
|
||||||
~CCtrlMover();
|
~CCtrlMover();
|
||||||
virtual void draw ();
|
virtual void draw ();
|
||||||
virtual bool handleEvent (const CEventDescriptor &event);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
|
||||||
bool canMove() { return _CanMove; }
|
bool canMove() { return _CanMove; }
|
||||||
|
|
||||||
bool isMoving() const {return _Moving;}
|
bool isMoving() const {return _Moving;}
|
||||||
|
@ -132,8 +135,8 @@ private:
|
||||||
//
|
//
|
||||||
static COptionsContainerInsertion *getInsertionOptions();
|
static COptionsContainerInsertion *getInsertionOptions();
|
||||||
private:
|
private:
|
||||||
void setPoped(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 CEventDescriptorMouse &eventDesc);
|
void setMovingInParent(CGroupContainer *gc, sint32 x, sint32 y, CInterfaceManager *pIM, const NLGUI::CEventDescriptorMouse &eventDesc);
|
||||||
void updateInsertionIndex(const CGroupList *gl, sint32 posY);
|
void updateInsertionIndex(const CGroupList *gl, sint32 posY);
|
||||||
void stopMove(CInterfaceManager *pIM);
|
void stopMove(CInterfaceManager *pIM);
|
||||||
bool runTitleActionHandler();
|
bool runTitleActionHandler();
|
||||||
|
@ -171,7 +174,7 @@ public:
|
||||||
|
|
||||||
virtual void clearViews ();
|
virtual void clearViews ();
|
||||||
|
|
||||||
virtual bool handleEvent (const CEventDescriptor &eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
|
||||||
|
|
||||||
virtual void launch ();
|
virtual void launch ();
|
||||||
|
|
||||||
|
@ -446,7 +449,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
void setModalParentList (const std::string &name);
|
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 isGrayed() const;
|
||||||
bool blinkAllSons();
|
bool blinkAllSons();
|
||||||
|
|
||||||
|
|
|
@ -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();
|
stopParentBlink();
|
||||||
switch(rEDK.getChar())
|
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());
|
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)
|
if (!_Active || !_ViewText)
|
||||||
return false;
|
return false;
|
||||||
if (event.getType() == CEventDescriptor::key)
|
if (event.getType() == NLGUI::CEventDescriptor::key)
|
||||||
{
|
{
|
||||||
if (_BypassNextKey)
|
if (_BypassNextKey)
|
||||||
{
|
{
|
||||||
|
@ -841,18 +841,18 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
|
||||||
///////////////
|
///////////////
|
||||||
// KEY EVENT //
|
// KEY EVENT //
|
||||||
///////////////
|
///////////////
|
||||||
const CEventDescriptorKey &rEDK = (const CEventDescriptorKey&)event;
|
const NLGUI::CEventDescriptorKey &rEDK = (const NLGUI::CEventDescriptorKey&)event;
|
||||||
switch(rEDK.getKeyEventType())
|
switch(rEDK.getKeyEventType())
|
||||||
{
|
{
|
||||||
case CEventDescriptorKey::keychar: handleEventChar(rEDK); break;
|
case NLGUI::CEventDescriptorKey::keychar: handleEventChar(rEDK); break;
|
||||||
case CEventDescriptorKey::keystring: handleEventString(rEDK); break;
|
case NLGUI::CEventDescriptorKey::keystring: handleEventString(rEDK); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
// update the text
|
// update the text
|
||||||
setInputString(_InputString);
|
setInputString(_InputString);
|
||||||
|
|
||||||
// if event of type char or string, consider handle all of them
|
// 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;
|
return true;
|
||||||
// Else filter the EventKeyDown AND EventKeyUp.
|
// Else filter the EventKeyDown AND EventKeyUp.
|
||||||
else
|
else
|
||||||
|
@ -866,16 +866,16 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (event.getType() == CEventDescriptor::mouse)
|
if (event.getType() == NLGUI::CEventDescriptor::mouse)
|
||||||
{
|
{
|
||||||
/////////////////
|
/////////////////
|
||||||
// MOUSE EVENT //
|
// MOUSE EVENT //
|
||||||
/////////////////
|
/////////////////
|
||||||
const CEventDescriptorMouse &eventDesc = (const CEventDescriptorMouse &)event;
|
const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event;
|
||||||
|
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
|
||||||
{
|
{
|
||||||
if (pIM->getCapturePointerRight() == this)
|
if (pIM->getCapturePointerRight() == this)
|
||||||
{
|
{
|
||||||
|
@ -901,7 +901,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// if click, and not frozen, then get the focus
|
// if click, and not frozen, then get the focus
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown && !_Frozen)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown && !_Frozen)
|
||||||
{
|
{
|
||||||
_SelectingText = true;
|
_SelectingText = true;
|
||||||
stopParentBlink();
|
stopParentBlink();
|
||||||
|
@ -920,7 +920,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// if click, and not frozen, then get the focus
|
// 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
|
// set the right cursor position
|
||||||
uint newCurPos;
|
uint newCurPos;
|
||||||
|
@ -934,7 +934,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// if click, and not frozen, then get the focus
|
// if click, and not frozen, then get the focus
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup && !_Frozen)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup && !_Frozen)
|
||||||
{
|
{
|
||||||
_SelectingText = false;
|
_SelectingText = false;
|
||||||
if (_SelectCursorPos == _CursorPos)
|
if (_SelectCursorPos == _CursorPos)
|
||||||
|
@ -943,7 +943,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
|
||||||
{
|
{
|
||||||
pIM->setCapturePointerRight(this);
|
pIM->setCapturePointerRight(this);
|
||||||
return true;
|
return true;
|
||||||
|
@ -954,10 +954,10 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
|
||||||
//////////////////
|
//////////////////
|
||||||
// SYSTEM EVENT //
|
// SYSTEM EVENT //
|
||||||
//////////////////
|
//////////////////
|
||||||
const CEventDescriptorSystem &eventDesc = (const CEventDescriptorSystem &)event;
|
const NLGUI::CEventDescriptorSystem &eventDesc = (const NLGUI::CEventDescriptorSystem &)event;
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorSystem::activecalledonparent)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::activecalledonparent)
|
||||||
{
|
{
|
||||||
CEventDescriptorActiveCalledOnParent &activeEvent = (CEventDescriptorActiveCalledOnParent &) eventDesc;
|
NLGUI::CEventDescriptorActiveCalledOnParent &activeEvent = (NLGUI::CEventDescriptorActiveCalledOnParent &) eventDesc;
|
||||||
if (activeEvent.getActive() == false && _ResetFocusOnHide)
|
if (activeEvent.getActive() == false && _ResetFocusOnHide)
|
||||||
{
|
{
|
||||||
CInterfaceManager::getInstance()->resetCaptureKeyboard();
|
CInterfaceManager::getInstance()->resetCaptureKeyboard();
|
||||||
|
|
|
@ -22,8 +22,10 @@
|
||||||
#include "interface_group.h"
|
#include "interface_group.h"
|
||||||
#include "nel/3d/u_texture.h"
|
#include "nel/3d/u_texture.h"
|
||||||
|
|
||||||
|
namespace NLGUI
|
||||||
|
{
|
||||||
class CEventDescriptor;
|
class CEventDescriptor;
|
||||||
|
}
|
||||||
class CViewText;
|
class CViewText;
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
class CGroupEditBox : public CInterfaceGroup
|
class CGroupEditBox : public CInterfaceGroup
|
||||||
|
@ -41,7 +43,7 @@ public:
|
||||||
|
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
|
|
||||||
virtual bool handleEvent (const CEventDescriptor& eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
|
||||||
|
|
||||||
/// Accessors
|
/// Accessors
|
||||||
ucstring getInputString() const { return _InputString; }
|
ucstring getInputString() const { return _InputString; }
|
||||||
|
@ -290,8 +292,8 @@ protected:
|
||||||
private:
|
private:
|
||||||
void setupDisplayText();
|
void setupDisplayText();
|
||||||
void makeTopWindow();
|
void makeTopWindow();
|
||||||
void handleEventChar(const CEventDescriptorKey &event);
|
void handleEventChar(const NLGUI::CEventDescriptorKey &event);
|
||||||
void handleEventString(const CEventDescriptorKey &event);
|
void handleEventString(const NLGUI::CEventDescriptorKey &event);
|
||||||
void setup();
|
void setup();
|
||||||
void triggerOnChangeAH();
|
void triggerOnChangeAH();
|
||||||
void appendStringFromClipboard(const ucstring &str);
|
void appendStringFromClipboard(const ucstring &str);
|
||||||
|
|
|
@ -255,17 +255,17 @@ public:
|
||||||
if (getParent()->getParent() == _Parent->getParentPos()) return NULL; // leftmost header
|
if (getParent()->getParent() == _Parent->getParentPos()) return NULL; // leftmost header
|
||||||
return dynamic_cast<CInterfaceGroup *>(getParent()->getParentPos());
|
return dynamic_cast<CInterfaceGroup *>(getParent()->getParentPos());
|
||||||
}
|
}
|
||||||
bool handleEvent (const CEventDescriptor &event)
|
bool handleEvent (const NLGUI::CEventDescriptor &event)
|
||||||
{
|
{
|
||||||
CInterfaceManager *im = CInterfaceManager::getInstance();
|
CInterfaceManager *im = CInterfaceManager::getInstance();
|
||||||
if (_Parent)
|
if (_Parent)
|
||||||
{
|
{
|
||||||
if (event.getType() == CEventDescriptor::system)
|
if (event.getType() == NLGUI::CEventDescriptor::system)
|
||||||
{
|
{
|
||||||
const CEventDescriptorSystem &eds = (const CEventDescriptorSystem &) event;
|
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) event;
|
||||||
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
|
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::setfocus)
|
||||||
{
|
{
|
||||||
const CEventDescriptorSetFocus &edsf = (const CEventDescriptorSetFocus &) eds;
|
const NLGUI::CEventDescriptorSetFocus &edsf = (const NLGUI::CEventDescriptorSetFocus &) eds;
|
||||||
if (edsf.hasFocus() == false)
|
if (edsf.hasFocus() == false)
|
||||||
{
|
{
|
||||||
release();
|
release();
|
||||||
|
@ -273,10 +273,10 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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 (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
|
||||||
{
|
{
|
||||||
if (!this->isIn(eventDesc.getX(), eventDesc.getY())) return false;
|
if (!this->isIn(eventDesc.getX(), eventDesc.getY())) return false;
|
||||||
_TargetGroup = getTargetGroup();
|
_TargetGroup = getTargetGroup();
|
||||||
|
@ -286,11 +286,11 @@ public:
|
||||||
_OffsetX = _TargetGroup->getW() - eventDesc.getX();
|
_OffsetX = _TargetGroup->getW() - eventDesc.getX();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
{
|
{
|
||||||
release();
|
release();
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove)
|
||||||
{
|
{
|
||||||
if (_Moving && im->getCapturePointerLeft() == this)
|
if (_Moving && im->getCapturePointerLeft() == this)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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);
|
bool traited = CGroupScrollText::handleEvent (eventDesc);
|
||||||
|
|
||||||
if (eventDesc.getType() == CEventDescriptor::system)
|
if (eventDesc.getType() == NLGUI::CEventDescriptor::system)
|
||||||
{
|
{
|
||||||
const CEventDescriptorSystem &systemEvent = (const CEventDescriptorSystem &) eventDesc;
|
const NLGUI::CEventDescriptorSystem &systemEvent = (const NLGUI::CEventDescriptorSystem &) eventDesc;
|
||||||
if (systemEvent.getEventTypeExtended() == CEventDescriptorSystem::clocktick)
|
if (systemEvent.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::clocktick)
|
||||||
{
|
{
|
||||||
// Handle now
|
// Handle now
|
||||||
handle ();
|
handle ();
|
||||||
|
|
|
@ -73,7 +73,7 @@ public:
|
||||||
virtual void draw ();
|
virtual void draw ();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
virtual bool handleEvent (const CEventDescriptor& eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
|
||||||
|
|
||||||
// Browse
|
// Browse
|
||||||
virtual void browse (const char *url);
|
virtual void browse (const char *url);
|
||||||
|
|
|
@ -663,16 +663,16 @@ void CGroupList::draw ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool CGroupList::handleEvent (const CEventDescriptor& event)
|
bool CGroupList::handleEvent (const NLGUI::CEventDescriptor& event)
|
||||||
{
|
{
|
||||||
if (!_Active)
|
if (!_Active)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool bReturn = CInterfaceGroup::handleEvent(event);
|
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;
|
_OverElt = -1;
|
||||||
if (!isIn(eventDesc.getX(), eventDesc.getY()))
|
if (!isIn(eventDesc.getX(), eventDesc.getY()))
|
||||||
|
|
|
@ -121,7 +121,7 @@ public:
|
||||||
|
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
|
|
||||||
virtual bool handleEvent (const CEventDescriptor& eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
|
||||||
|
|
||||||
virtual void clearViews();
|
virtual void clearViews();
|
||||||
virtual void clearControls();
|
virtual void clearControls();
|
||||||
|
|
|
@ -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 (CCtrlBase::handleEvent(event)) return true;
|
||||||
if (event.getType() == CEventDescriptor::mouse)
|
if (event.getType() == NLGUI::CEventDescriptor::mouse)
|
||||||
{
|
{
|
||||||
CInterfaceManager *im = CInterfaceManager::getInstance();
|
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)
|
if (im->getCapturePointerLeft() != this)
|
||||||
return false;
|
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())))
|
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();
|
CInterfaceManager *im = CInterfaceManager::getInstance();
|
||||||
// if R2 editor editor is on, give it a chance to handle the event first
|
// 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 handled = false;
|
||||||
bool panEnd = false;
|
bool panEnd = false;
|
||||||
// handle standard clicks
|
// handle standard clicks
|
||||||
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;
|
||||||
panEnd = eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup && _Panning && _HasMoved;
|
panEnd = eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup && _Panning && _HasMoved;
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup && !panEnd)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup && !panEnd)
|
||||||
{
|
{
|
||||||
//if (im->getCapturePointerLeft() == this)
|
//if (im->getCapturePointerLeft() == this)
|
||||||
// NB : don't test capture of mouse here, because
|
// 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)
|
if (im->getCapturePointerRight() == this)
|
||||||
{
|
{
|
||||||
|
@ -1784,13 +1784,13 @@ bool CGroupMap::handleEvent(const CEventDescriptor &event)
|
||||||
|
|
||||||
// left button can be used to 'pan' the map
|
// left button can be used to 'pan' the map
|
||||||
// mouse wheel can be used to zoom in/out
|
// mouse wheel can be used to zoom in/out
|
||||||
if (event.getType() == CEventDescriptor::mouse)
|
if (event.getType() == NLGUI::CEventDescriptor::mouse)
|
||||||
{
|
{
|
||||||
if (!_Active)
|
if (!_Active)
|
||||||
return false;
|
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)
|
if (im->getCapturePointerLeft() != this)
|
||||||
{
|
{
|
||||||
|
@ -1801,13 +1801,13 @@ bool CGroupMap::handleEvent(const CEventDescriptor &event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
|
||||||
{
|
{
|
||||||
im->setCapturePointerRight(this);
|
im->setCapturePointerRight(this);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
|
||||||
{
|
{
|
||||||
if (isIn(eventDesc.getX(), eventDesc.getY()))
|
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)
|
if (im->getCapturePointerLeft() != this || !_Panning)
|
||||||
return CInterfaceGroup::handleEvent(event);
|
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();
|
sint32 wheel = eventDesc.getWheel();
|
||||||
float newScale = _UserScale;
|
float newScale = _UserScale;
|
||||||
|
@ -1907,7 +1907,7 @@ bool CGroupMap::handleEvent(const CEventDescriptor &event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
|
||||||
{
|
{
|
||||||
// convert click pos into map pos
|
// convert click pos into map pos
|
||||||
if (_MapTexW == 0 || _MapTexH == 0)
|
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;
|
NLGUI::CEventDescriptorSystem &es = (NLGUI::CEventDescriptorSystem &) event;
|
||||||
if (es.getEventTypeExtended() == CEventDescriptorSystem::activecalledonparent)
|
if (es.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::activecalledonparent)
|
||||||
{
|
{
|
||||||
bool visible = getActive();
|
bool visible = getActive();
|
||||||
if (visible)
|
if (visible)
|
||||||
|
|
|
@ -119,7 +119,7 @@ public:
|
||||||
virtual void updateCoords();
|
virtual void updateCoords();
|
||||||
virtual void checkCoords();
|
virtual void checkCoords();
|
||||||
virtual void draw ();
|
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 parse(xmlNodePtr cur, CInterfaceGroup * parentGroup);
|
||||||
virtual bool getCtrlsUnder (sint32 x, sint32 y, sint32 clipX, sint32 clipY, sint32 clipW, sint32 clipH, std::vector<CCtrlBase*> &vICL);
|
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:
|
public:
|
||||||
CPolyButton();
|
CPolyButton();
|
||||||
virtual bool handleEvent (const CEventDescriptor &event);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
|
||||||
virtual void updateCoords();
|
virtual void updateCoords();
|
||||||
virtual void draw () {}
|
virtual void draw () {}
|
||||||
void drawPolyButton();
|
void drawPolyButton();
|
||||||
|
@ -258,7 +258,7 @@ private:
|
||||||
CContLandMark::TContLMType Type;
|
CContLandMark::TContLMType Type;
|
||||||
bool HandleEvents;
|
bool HandleEvents;
|
||||||
public:
|
public:
|
||||||
virtual bool handleEvent (const CEventDescriptor& event)
|
virtual bool handleEvent (const NLGUI::CEventDescriptor& event)
|
||||||
{
|
{
|
||||||
if (!HandleEvents) return false;
|
if (!HandleEvents) return false;
|
||||||
return CCtrlButton::handleEvent(event);
|
return CCtrlButton::handleEvent(event);
|
||||||
|
|
|
@ -933,7 +933,7 @@ void CGroupSubMenu::draw()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
bool CGroupSubMenu::handleEvent (const CEventDescriptor &event)
|
bool CGroupSubMenu::handleEvent (const NLGUI::CEventDescriptor &event)
|
||||||
{
|
{
|
||||||
if (!_Active)
|
if (!_Active)
|
||||||
return false;
|
return false;
|
||||||
|
@ -942,9 +942,9 @@ bool CGroupSubMenu::handleEvent (const CEventDescriptor &event)
|
||||||
if(_GroupList)
|
if(_GroupList)
|
||||||
textDYPos= -(1+_GroupList->getSpace())/2;
|
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;
|
_Selected = -1;
|
||||||
|
|
||||||
// TODO First check sub menus that can be not in the area of this menu
|
// 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 a line is selected and the line is not grayed
|
||||||
if ((_Selected != -1) && (!_Lines[i].ViewText->getGrayed()))
|
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 (_GroupList && _ScrollBar)
|
||||||
{
|
{
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
|
||||||
{
|
{
|
||||||
if (isIn(eventDesc.getX(), eventDesc.getY()))
|
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)
|
if (!_Active)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -107,7 +107,7 @@ public:
|
||||||
|
|
||||||
virtual void draw ();
|
virtual void draw ();
|
||||||
|
|
||||||
virtual bool handleEvent (const CEventDescriptor &eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
|
||||||
|
|
||||||
virtual CInterfaceElement* getElement (const std::string &id);
|
virtual CInterfaceElement* getElement (const std::string &id);
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ public:
|
||||||
|
|
||||||
void recurseDraw(CGroupSubMenu *pSubMenu);
|
void recurseDraw(CGroupSubMenu *pSubMenu);
|
||||||
|
|
||||||
virtual bool handleEvent (const CEventDescriptor &eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
|
||||||
|
|
||||||
virtual CInterfaceElement* getElement (const std::string &id);
|
virtual CInterfaceElement* getElement (const std::string &id);
|
||||||
|
|
||||||
|
|
|
@ -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;
|
NLGUI::CEventDescriptorKey &edk = (NLGUI::CEventDescriptorKey &)event;
|
||||||
if (edk.getKeyEventType() == CEventDescriptorKey::keydown)
|
if (edk.getKeyEventType() == NLGUI::CEventDescriptorKey::keydown)
|
||||||
{
|
{
|
||||||
// if ((edk.getKey() != KeyCONTROL) && (edk.getKey() != KeyMENU) && (edk.getKey() != KeySHIFT))
|
// if ((edk.getKey() != KeyCONTROL) && (edk.getKey() != KeyMENU) && (edk.getKey() != KeySHIFT))
|
||||||
// {
|
// {
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
CGroupModalGetKey(const TCtorParam ¶m);
|
CGroupModalGetKey(const TCtorParam ¶m);
|
||||||
|
|
||||||
virtual bool handleEvent (const CEventDescriptor &event);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
|
||||||
|
|
||||||
virtual void setActive(bool state);
|
virtual void setActive(bool state);
|
||||||
|
|
||||||
|
|
|
@ -841,16 +841,16 @@ void CGroupParagraph::draw ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool CGroupParagraph::handleEvent (const CEventDescriptor& event)
|
bool CGroupParagraph::handleEvent (const NLGUI::CEventDescriptor& event)
|
||||||
{
|
{
|
||||||
if (!_Active)
|
if (!_Active)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool bReturn = CInterfaceGroup::handleEvent(event);
|
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;
|
_OverElt = -1;
|
||||||
if (!isIn(eventDesc.getX(), eventDesc.getY()))
|
if (!isIn(eventDesc.getX(), eventDesc.getY()))
|
||||||
|
|
|
@ -139,7 +139,7 @@ public:
|
||||||
|
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
|
|
||||||
virtual bool handleEvent (const CEventDescriptor& eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
|
||||||
|
|
||||||
virtual void clearViews();
|
virtual void clearViews();
|
||||||
virtual void clearControls();
|
virtual void clearControls();
|
||||||
|
|
|
@ -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 (_List && _ScrollBar)
|
||||||
{
|
{
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
|
||||||
{
|
{
|
||||||
if (isIn(eventDesc.getX(), eventDesc.getY()))
|
if (isIn(eventDesc.getX(), eventDesc.getY()))
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
virtual void checkCoords ();
|
virtual void checkCoords ();
|
||||||
virtual void draw ();
|
virtual void draw ();
|
||||||
virtual void clearViews ();
|
virtual void clearViews ();
|
||||||
virtual bool handleEvent (const CEventDescriptor &eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
|
||||||
|
|
||||||
// get the list associated to this group
|
// get the list associated to this group
|
||||||
CGroupList *getList() const { return _List; }
|
CGroupList *getList() const { return _List; }
|
||||||
|
|
|
@ -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;
|
const NLGUI::CEventDescriptorSystem &systemEvent = (const NLGUI::CEventDescriptorSystem &) event;
|
||||||
if (systemEvent.getEventTypeExtended() == CEventDescriptorSystem::clocktick)
|
if (systemEvent.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::clocktick)
|
||||||
if (_Blinking)
|
if (_Blinking)
|
||||||
{
|
{
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||||
|
|
|
@ -155,7 +155,7 @@ public:
|
||||||
|
|
||||||
virtual void setActive(bool state);
|
virtual void setActive(bool state);
|
||||||
|
|
||||||
virtual bool handleEvent (const CEventDescriptor &event);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
|
||||||
|
|
||||||
void setBlink (bool b);
|
void setBlink (bool b);
|
||||||
|
|
||||||
|
|
|
@ -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 (!_Active) return false;
|
||||||
if (CInterfaceGroup::handleEvent(event)) return true;
|
if (CInterfaceGroup::handleEvent(event)) return true;
|
||||||
// The line must be over (pre-selected)
|
// 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()))
|
if (!isIn(eventDesc.getX(), eventDesc.getY()))
|
||||||
return false;
|
return false;
|
||||||
|
@ -799,7 +799,7 @@ bool CGroupTree::handleEvent (const CEventDescriptor& event)
|
||||||
(x < (_XReal+getHrcIconXEnd(_Lines[_OverLine].Depth + _Lines[_OverLine].getNumAdditionnalBitmap()))))
|
(x < (_XReal+getHrcIconXEnd(_Lines[_OverLine].Depth + _Lines[_OverLine].getNumAdditionnalBitmap()))))
|
||||||
bIcon = true;
|
bIcon = true;
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
|
||||||
{
|
{
|
||||||
if (bText)
|
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
|
// line selection
|
||||||
if (bText)
|
if (bText)
|
||||||
|
|
|
@ -213,7 +213,7 @@ public:
|
||||||
|
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
|
|
||||||
virtual bool handleEvent (const CEventDescriptor& eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
|
|
@ -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 (CInterfaceGroup::handleEvent(event)) return true;
|
||||||
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 (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
|
||||||
{
|
{
|
||||||
CInterfaceManager *im = CInterfaceManager::getInstance();
|
CInterfaceManager *im = CInterfaceManager::getInstance();
|
||||||
if (eventDesc.getWheel() > 0 && _AHWheelUp)
|
if (eventDesc.getWheel() > 0 && _AHWheelUp)
|
||||||
|
|
|
@ -31,7 +31,7 @@ public:
|
||||||
CInterfaceGroupWheel(const TCtorParam ¶m);
|
CInterfaceGroupWheel(const TCtorParam ¶m);
|
||||||
/// Coming from CInterfaceElement
|
/// Coming from CInterfaceElement
|
||||||
virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup);
|
virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup);
|
||||||
virtual bool handleEvent (const CEventDescriptor &event);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
|
||||||
private:
|
private:
|
||||||
IActionHandler *_AHWheelUp;
|
IActionHandler *_AHWheelUp;
|
||||||
CStringShared _AHWheelUpParams;
|
CStringShared _AHWheelUpParams;
|
||||||
|
|
|
@ -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 there was some control capturing the mouse, warn them that they lost the focus
|
||||||
if (pIM->getCapturePointerLeft())
|
if (pIM->getCapturePointerLeft())
|
||||||
{
|
{
|
||||||
pIM->getCapturePointerLeft()->handleEvent(CEventDescriptorSetFocus(pEvent->Get));
|
pIM->getCapturePointerLeft()->handleEvent(NLGUI::CEventDescriptorSetFocus(pEvent->Get));
|
||||||
}
|
}
|
||||||
pIM->setCapturePointerLeft(NULL);
|
pIM->setCapturePointerLeft(NULL);
|
||||||
if (pIM->getCapturePointerRight())
|
if (pIM->getCapturePointerRight())
|
||||||
{
|
{
|
||||||
pIM->getCapturePointerRight()->handleEvent(CEventDescriptorSetFocus(pEvent->Get));
|
pIM->getCapturePointerRight()->handleEvent(NLGUI::CEventDescriptorSetFocus(pEvent->Get));
|
||||||
}
|
}
|
||||||
pIM->setCapturePointerRight(NULL);
|
pIM->setCapturePointerRight(NULL);
|
||||||
UserControls.stopFreeLook();
|
UserControls.stopFreeLook();
|
||||||
|
@ -191,7 +191,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
|
||||||
&& (ClientCfg.R2EDEnabled || R2::getEditor().getCurrentTool())
|
&& (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)
|
event == EventStringId)
|
||||||
{
|
{
|
||||||
// if not handled, post to Action Manager
|
// 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
|
// See if handled by editor
|
||||||
bool handled = false;
|
bool handled = false;
|
||||||
|
@ -232,7 +232,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
|
||||||
&& (ClientCfg.R2EDEnabled || R2::getEditor().getCurrentTool())
|
&& (ClientCfg.R2EDEnabled || R2::getEditor().getCurrentTool())
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
handled = R2::getEditor().handleEvent(CEventDescriptorKey((const CEventKey &) event) );
|
handled = R2::getEditor().handleEvent(NLGUI::CEventDescriptorKey((const CEventKey &) event) );
|
||||||
}
|
}
|
||||||
if (!handled)
|
if (!handled)
|
||||||
{
|
{
|
||||||
|
@ -282,7 +282,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
|
||||||
|
|
||||||
CViewPointer &rIP = *pIM->getPointer();
|
CViewPointer &rIP = *pIM->getPointer();
|
||||||
|
|
||||||
CEventDescriptorMouse eventDesc;
|
NLGUI::CEventDescriptorMouse eventDesc;
|
||||||
sint32 x,y;
|
sint32 x,y;
|
||||||
rIP.getPointerDispPos (x, y);
|
rIP.getPointerDispPos (x, y);
|
||||||
eventDesc.setX (x);
|
eventDesc.setX (x);
|
||||||
|
@ -326,12 +326,12 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
|
||||||
// handle Event
|
// handle Event
|
||||||
if(pEvent->Button & leftButton)
|
if(pEvent->Button & leftButton)
|
||||||
{
|
{
|
||||||
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftdown);
|
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouseleftdown);
|
||||||
handled|= pIM->handleEvent (eventDesc);
|
handled|= pIM->handleEvent (eventDesc);
|
||||||
}
|
}
|
||||||
if(pEvent->Button & rightButton)
|
if(pEvent->Button & rightButton)
|
||||||
{
|
{
|
||||||
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightdown);
|
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouserightdown);
|
||||||
handled|= pIM->handleEvent (eventDesc);
|
handled|= pIM->handleEvent (eventDesc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -350,12 +350,12 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
|
||||||
// handle Event
|
// handle Event
|
||||||
if(pEvent->Button & leftButton)
|
if(pEvent->Button & leftButton)
|
||||||
{
|
{
|
||||||
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftup);
|
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouseleftup);
|
||||||
handled|= pIM->handleEvent (eventDesc);
|
handled|= pIM->handleEvent (eventDesc);
|
||||||
}
|
}
|
||||||
if(pEvent->Button & rightButton)
|
if(pEvent->Button & rightButton)
|
||||||
{
|
{
|
||||||
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightup);
|
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouserightup);
|
||||||
handled|= pIM->handleEvent (eventDesc);
|
handled|= pIM->handleEvent (eventDesc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,12 +369,12 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
|
||||||
// handle Event
|
// handle Event
|
||||||
if(pEvent->Button & leftButton)
|
if(pEvent->Button & leftButton)
|
||||||
{
|
{
|
||||||
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftdblclk);
|
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouseleftdblclk);
|
||||||
handled|= pIM->handleEvent (eventDesc);
|
handled|= pIM->handleEvent (eventDesc);
|
||||||
}
|
}
|
||||||
if(pEvent->Button & rightButton)
|
if(pEvent->Button & rightButton)
|
||||||
{
|
{
|
||||||
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightdblclk);
|
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mouserightdblclk);
|
||||||
handled|= pIM->handleEvent (eventDesc);
|
handled|= pIM->handleEvent (eventDesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +395,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
|
||||||
// handle Event now.
|
// handle Event now.
|
||||||
if (_MouseWheel != 0)
|
if (_MouseWheel != 0)
|
||||||
{
|
{
|
||||||
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mousewheel);
|
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mousewheel);
|
||||||
eventDesc.setWheel(_MouseWheel);
|
eventDesc.setWheel(_MouseWheel);
|
||||||
handled|= pIM->handleEvent (eventDesc);
|
handled|= pIM->handleEvent (eventDesc);
|
||||||
_MouseWheel = 0;
|
_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())
|
if (!IsMouseFreeLook())
|
||||||
{
|
{
|
||||||
|
@ -461,7 +461,7 @@ bool CInputHandlerManager::updateMousePos(NLMISC::CEventMouse &event, CEventDes
|
||||||
eventDesc.setY (y);
|
eventDesc.setY (y);
|
||||||
|
|
||||||
// handle Event now.
|
// handle Event now.
|
||||||
eventDesc.setEventTypeExtended(CEventDescriptorMouse::mousemove);
|
eventDesc.setEventTypeExtended(NLGUI::CEventDescriptorMouse::mousemove);
|
||||||
return pIM->handleEvent (eventDesc);
|
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();
|
Key= rDK.getKey();
|
||||||
CtrlFlags= 0;
|
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;
|
CComboKey ckey;
|
||||||
ckey.init(edk);
|
ckey.init(edk);
|
||||||
|
|
|
@ -96,7 +96,7 @@ public:
|
||||||
* Basics events such as KeyA, KeyB etc.. should be in this config file.
|
* 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.
|
* 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).
|
/** Pump The Events of The setuped EventServer (ie Driver->EventServer).
|
||||||
|
@ -165,7 +165,7 @@ private:
|
||||||
{
|
{
|
||||||
CtrlFlags= 0;
|
CtrlFlags= 0;
|
||||||
}
|
}
|
||||||
void init(const CEventDescriptorKey &rDK);
|
void init(const NLGUI::CEventDescriptorKey &rDK);
|
||||||
bool operator<(const CComboKey &c) const;
|
bool operator<(const CComboKey &c) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ private:
|
||||||
void parseKey(xmlNodePtr cur, std::vector<CComboKey> &out);
|
void parseKey(xmlNodePtr cur, std::vector<CComboKey> &out);
|
||||||
|
|
||||||
// return true if handled
|
// return true if handled
|
||||||
bool updateMousePos(NLMISC::CEventMouse &event, CEventDescriptorMouse &eventDesc);
|
bool updateMousePos(NLMISC::CEventMouse &event, NLGUI::CEventDescriptorMouse &eventDesc);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -546,7 +546,7 @@ void CInterface3DScene::draw ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool CInterface3DScene::handleEvent (const CEventDescriptor &event)
|
bool CInterface3DScene::handleEvent (const NLGUI::CEventDescriptor &event)
|
||||||
{
|
{
|
||||||
if (!_UserInteraction)
|
if (!_UserInteraction)
|
||||||
return false;
|
return false;
|
||||||
|
@ -554,12 +554,12 @@ bool CInterface3DScene::handleEvent (const CEventDescriptor &event)
|
||||||
if (!_Active)
|
if (!_Active)
|
||||||
return false;
|
return false;
|
||||||
// if focus is lost then cancel rotation / zoom
|
// 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;
|
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) event;
|
||||||
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
|
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::setfocus)
|
||||||
{
|
{
|
||||||
const CEventDescriptorSetFocus &edsf = (const CEventDescriptorSetFocus &) eds;
|
const NLGUI::CEventDescriptorSetFocus &edsf = (const NLGUI::CEventDescriptorSetFocus &) eds;
|
||||||
if (edsf.hasFocus() == false)
|
if (edsf.hasFocus() == false)
|
||||||
{
|
{
|
||||||
_MouseLDown = 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) &&
|
if ((CInterfaceManager::getInstance()->getCapturePointerLeft() != this) &&
|
||||||
(CInterfaceManager::getInstance()->getCapturePointerRight() != this) &&
|
(CInterfaceManager::getInstance()->getCapturePointerRight() != this) &&
|
||||||
(!((eventDesc.getX() >= _XReal) &&
|
(!((eventDesc.getX() >= _XReal) &&
|
||||||
|
@ -579,7 +579,7 @@ bool CInterface3DScene::handleEvent (const CEventDescriptor &event)
|
||||||
(eventDesc.getY() <= (_YReal+ _HReal)))))
|
(eventDesc.getY() <= (_YReal+ _HReal)))))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
|
||||||
{
|
{
|
||||||
_MouseLDown = true;
|
_MouseLDown = true;
|
||||||
_MouseLDownX = eventDesc.getX();
|
_MouseLDownX = eventDesc.getX();
|
||||||
|
@ -588,12 +588,12 @@ bool CInterface3DScene::handleEvent (const CEventDescriptor &event)
|
||||||
pIM->setCapturePointerLeft(this); // Because we are not just a control
|
pIM->setCapturePointerLeft(this); // Because we are not just a control
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
{
|
{
|
||||||
_MouseLDown = false;
|
_MouseLDown = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
|
||||||
{
|
{
|
||||||
_MouseRDown = true;
|
_MouseRDown = true;
|
||||||
_MouseRDownX = eventDesc.getX();
|
_MouseRDownX = eventDesc.getX();
|
||||||
|
@ -602,12 +602,12 @@ bool CInterface3DScene::handleEvent (const CEventDescriptor &event)
|
||||||
pIM->setCapturePointerRight(this); // Because we are not just a control
|
pIM->setCapturePointerRight(this); // Because we are not just a control
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
|
||||||
{
|
{
|
||||||
_MouseRDown = false;
|
_MouseRDown = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousemove)
|
||||||
{
|
{
|
||||||
if (_MouseLDown)
|
if (_MouseLDown)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,7 +60,7 @@ public:
|
||||||
|
|
||||||
virtual void draw ();
|
virtual void draw ();
|
||||||
|
|
||||||
virtual bool handleEvent (const CEventDescriptor &eventDesc);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc);
|
||||||
|
|
||||||
virtual CInterfaceElement* getElement (const std::string &id);
|
virtual CInterfaceElement* getElement (const std::string &id);
|
||||||
|
|
||||||
|
|
|
@ -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
|
// notify children that the 'active' state of this group has changed
|
||||||
for(std::vector<CInterfaceGroup*>::iterator it = _ChildrenGroups.begin(); it != _ChildrenGroups.end(); ++it)
|
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);
|
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 (CCtrlBase::handleEvent(event)) return true;
|
||||||
if (!_Active)
|
if (!_Active)
|
||||||
|
@ -693,19 +693,19 @@ bool CInterfaceGroup::handleEvent (const CEventDescriptor &event)
|
||||||
|
|
||||||
CInterfaceManager *im = CInterfaceManager::getInstance();
|
CInterfaceManager *im = CInterfaceManager::getInstance();
|
||||||
|
|
||||||
if (event.getType() == CEventDescriptor::system)
|
if (event.getType() == NLGUI::CEventDescriptor::system)
|
||||||
{
|
{
|
||||||
CEventDescriptorSystem &eds = (CEventDescriptorSystem&)event;
|
NLGUI::CEventDescriptorSystem &eds = (NLGUI::CEventDescriptorSystem&)event;
|
||||||
if (eds.getEventTypeExtended() == CEventDescriptorSystem::activecalledonparent)
|
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::activecalledonparent)
|
||||||
{
|
{
|
||||||
// notify all childrens
|
// 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()))
|
if (!isIn(eventDesc.getX(), eventDesc.getY()))
|
||||||
return false;
|
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)
|
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)
|
if (_AHOnRightClick != NULL)
|
||||||
{
|
{
|
||||||
|
@ -750,7 +750,7 @@ bool CInterfaceGroup::handleEvent (const CEventDescriptor &event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousewheel)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel)
|
||||||
{
|
{
|
||||||
// handle the Mouse Wheel only if interesting
|
// handle the Mouse Wheel only if interesting
|
||||||
if (_H>_MaxH)
|
if (_H>_MaxH)
|
||||||
|
|
|
@ -76,7 +76,7 @@ public:
|
||||||
sint32 getMinUsedW() const;
|
sint32 getMinUsedW() const;
|
||||||
|
|
||||||
/// Coming from CCtrlBase
|
/// Coming from CCtrlBase
|
||||||
virtual bool handleEvent (const CEventDescriptor &event);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
|
||||||
|
|
||||||
void executeControl (const std::string &sControlName);
|
void executeControl (const std::string &sControlName);
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ protected:
|
||||||
void doUpdateCoords();
|
void doUpdateCoords();
|
||||||
|
|
||||||
// notify children controls & groups that 'active' has been called on one of their parent
|
// 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:
|
protected:
|
||||||
|
|
||||||
|
|
|
@ -1332,8 +1332,8 @@ void CInterfaceManager::updateFrameEvents()
|
||||||
}
|
}
|
||||||
|
|
||||||
// send clock tick msg to ctrl that are captured
|
// send clock tick msg to ctrl that are captured
|
||||||
CEventDescriptorSystem clockTick;
|
NLGUI::CEventDescriptorSystem clockTick;
|
||||||
clockTick.setEventTypeExtended(CEventDescriptorSystem::clocktick);
|
clockTick.setEventTypeExtended(NLGUI::CEventDescriptorSystem::clocktick);
|
||||||
if (_CapturePointerLeft)
|
if (_CapturePointerLeft)
|
||||||
{
|
{
|
||||||
_CapturePointerLeft->handleEvent(clockTick);
|
_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;
|
bool handled= false;
|
||||||
|
|
||||||
|
@ -2680,18 +2680,18 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
if (_ActiveAnims[i]->isDisableButtons())
|
if (_ActiveAnims[i]->isDisableButtons())
|
||||||
return false;
|
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;
|
_LastEventKeyDesc = eventDesc;
|
||||||
|
|
||||||
// Any Key event disable the ContextHelp
|
// Any Key event disable the ContextHelp
|
||||||
disableContextHelp();
|
disableContextHelp();
|
||||||
|
|
||||||
// Hide menu if the key is pushed
|
// 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
|
// 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)
|
if(_ModalStack.size() > 0)
|
||||||
{
|
{
|
||||||
|
@ -2702,7 +2702,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manage "quit window" If the Key is ESCAPE, no captureKeyboard
|
// 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.
|
// Get the last escapable active top window. NB: this is ergonomically better.
|
||||||
CInterfaceGroup *win= getLastEscapableTopWindow();
|
CInterfaceGroup *win= getLastEscapableTopWindow();
|
||||||
|
@ -2729,7 +2729,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manage complex "Enter"
|
// 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
|
// If the top window has Enter AH
|
||||||
CInterfaceGroup *tw= getTopWindow();
|
CInterfaceGroup *tw= getTopWindow();
|
||||||
|
@ -2802,9 +2802,9 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
return result;
|
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
|
// First thing to do : Capture handling
|
||||||
if (_CapturePointerLeft != NULL)
|
if (_CapturePointerLeft != NULL)
|
||||||
|
@ -2817,7 +2817,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
_WindowUnder = ptr?ptr->getId():"";
|
_WindowUnder = ptr?ptr->getId():"";
|
||||||
|
|
||||||
// Any Mouse event but move disable the ContextHelp
|
// Any Mouse event but move disable the ContextHelp
|
||||||
if(eventDesc.getEventTypeExtended() != CEventDescriptorMouse::mousemove)
|
if(eventDesc.getEventTypeExtended() != NLGUI::CEventDescriptorMouse::mousemove)
|
||||||
{
|
{
|
||||||
disableContextHelp();
|
disableContextHelp();
|
||||||
}
|
}
|
||||||
|
@ -2844,8 +2844,8 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
{
|
{
|
||||||
// If there is a handler on click out launch it
|
// If there is a handler on click out launch it
|
||||||
if (pNewCurrentWnd != mwi.ModalWindow)
|
if (pNewCurrentWnd != mwi.ModalWindow)
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown ||
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown ||
|
||||||
(eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown))
|
(eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown))
|
||||||
if (!mwi.ModalHandlerClickOut.empty())
|
if (!mwi.ModalHandlerClickOut.empty())
|
||||||
runActionHandler(mwi.ModalHandlerClickOut,NULL,mwi.ModalClickOutParams);
|
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
|
// NB: don't force handle==true because to quit a modal does not avoid other actions
|
||||||
|
|
||||||
// quit if click outside
|
// quit if click outside
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown ||
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown ||
|
||||||
(eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown))
|
(eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown))
|
||||||
{
|
{
|
||||||
clickedOutModalWindow = dynamic_cast<CGroupModal *>((CInterfaceGroup*)mwi.ModalWindow);
|
clickedOutModalWindow = dynamic_cast<CGroupModal *>((CInterfaceGroup*)mwi.ModalWindow);
|
||||||
// disable the modal
|
// disable the modal
|
||||||
|
@ -2885,7 +2885,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manage LeftClick.
|
// Manage LeftClick.
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown)
|
||||||
{
|
{
|
||||||
if ((pNewCurrentWnd != NULL) && (_ModalStack.empty()) && (pNewCurrentWnd->getOverlappable()))
|
if ((pNewCurrentWnd != NULL) && (_ModalStack.empty()) && (pNewCurrentWnd->getOverlappable()))
|
||||||
{
|
{
|
||||||
|
@ -2937,7 +2937,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manage RightClick
|
// Manage RightClick
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
|
||||||
{
|
{
|
||||||
if ((pNewCurrentWnd != NULL) && (_ModalStack.empty()) && (pNewCurrentWnd->getOverlappable()))
|
if ((pNewCurrentWnd != NULL) && (_ModalStack.empty()) && (pNewCurrentWnd->getOverlappable()))
|
||||||
{
|
{
|
||||||
|
@ -2981,7 +2981,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
handled |= _CapturePointerRight->handleEvent(event);
|
handled |= _CapturePointerRight->handleEvent(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
|
||||||
{
|
{
|
||||||
if (!handled)
|
if (!handled)
|
||||||
if (pNewCurrentWnd != NULL)
|
if (pNewCurrentWnd != NULL)
|
||||||
|
@ -3001,7 +3001,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
{
|
{
|
||||||
if (((pNewCurrentWnd != NULL) && _ModalStack.empty()) || ((!_ModalStack.empty() && _ModalStack.back().ModalWindow == pNewCurrentWnd)))
|
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();
|
sint32 x= eventDesc.getX(), y = eventDesc.getY();
|
||||||
if (pNewCurrentWnd)
|
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...)
|
// 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);
|
// setTopWindow(pNewCurrentWnd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put here to let a chance to the window to handle if the capture dont
|
// 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)
|
if (_CapturePointerLeft != NULL)
|
||||||
{
|
{
|
||||||
|
@ -3039,7 +3039,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
if(mwi.ModalExitClickR)
|
if(mwi.ModalExitClickR)
|
||||||
{
|
{
|
||||||
// quit if click right
|
// quit if click right
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup)
|
||||||
// disable the modal
|
// disable the modal
|
||||||
disableModalWindow();
|
disableModalWindow();
|
||||||
}
|
}
|
||||||
|
@ -3048,7 +3048,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
|
||||||
if(mwi.ModalExitClickL)
|
if(mwi.ModalExitClickL)
|
||||||
{
|
{
|
||||||
// quit if click right
|
// quit if click right
|
||||||
if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup)
|
||||||
// disable the modal
|
// disable the modal
|
||||||
disableModalWindow();
|
disableModalWindow();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
/// 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,
|
void runActionHandler (const std::string &AHName, CCtrlBase *pCaller,
|
||||||
const std::string &Params=std::string(""));
|
const std::string &Params=std::string(""));
|
||||||
void runActionHandler (IActionHandler *ah, CCtrlBase *pCaller,
|
void runActionHandler (IActionHandler *ah, CCtrlBase *pCaller,
|
||||||
|
@ -704,7 +704,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Description of the last key event that called an action handler
|
// 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 notifyMailAvailable();
|
||||||
void notifyForumUpdated();
|
void notifyForumUpdated();
|
||||||
|
@ -1034,7 +1034,7 @@ private:
|
||||||
sint32 _CurrentPlayerCharac[CHARACTERISTICS::NUM_CHARACTERISTICS];
|
sint32 _CurrentPlayerCharac[CHARACTERISTICS::NUM_CHARACTERISTICS];
|
||||||
|
|
||||||
// Description of the last key event that called an action handler
|
// Description of the last key event that called an action handler
|
||||||
CEventDescriptorKey _LastEventKeyDesc;
|
NLGUI::CEventDescriptorKey _LastEventKeyDesc;
|
||||||
|
|
||||||
// observers for copying database branch changes
|
// observers for copying database branch changes
|
||||||
CServerToLocalAutoCopy ServerToLocalAutoCopyInventory;
|
CServerToLocalAutoCopy ServerToLocalAutoCopyInventory;
|
||||||
|
|
|
@ -131,7 +131,7 @@ public:
|
||||||
_Parent->getCorner(winX, winY, _ParentPosRef);
|
_Parent->getCorner(winX, winY, _ParentPosRef);
|
||||||
return contains(x - winX, y - winY);
|
return contains(x - winX, y - winY);
|
||||||
}
|
}
|
||||||
virtual bool handleEvent (const CEventDescriptor &/* event */)
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &/* event */)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 )
|
//H_AUTO(R2_CEditor_handleEvent )
|
||||||
CHECK_EDITOR
|
CHECK_EDITOR
|
||||||
if (ConnectionWanted || !_CurrentTool) return false; // TMP special case for connection
|
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;
|
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) eventDesc;
|
||||||
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
|
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::setfocus)
|
||||||
{
|
{
|
||||||
const CEventDescriptorSetFocus &edsf = (const CEventDescriptorSetFocus &) eds;
|
const NLGUI::CEventDescriptorSetFocus &edsf = (const NLGUI::CEventDescriptorSetFocus &) eds;
|
||||||
if (edsf.hasFocus() == false)
|
if (edsf.hasFocus() == false)
|
||||||
{
|
{
|
||||||
// cancel current tool
|
// cancel current tool
|
||||||
|
|
|
@ -250,7 +250,7 @@ public:
|
||||||
* Handle an user input event
|
* Handle an user input event
|
||||||
* \return true if the event was handled by the editor
|
* \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
|
// Handle copy, reaches the editor if no edit box is currently active
|
||||||
void copy();
|
void copy();
|
||||||
|
|
|
@ -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)
|
//H_AUTO(R2_CCtrlButtonEntity_handleEvent)
|
||||||
return false; // just a display with tooltip capability
|
return false; // just a display with tooltip capability
|
||||||
|
|
|
@ -80,7 +80,7 @@ private:
|
||||||
CCtrlButtonEntity(CInstance &instance) : CCtrlButton(TCtorParam()), _Instance(instance) {}
|
CCtrlButtonEntity(CInstance &instance) : CCtrlButton(TCtorParam()), _Instance(instance) {}
|
||||||
// from IDisplayerUIHandle
|
// from IDisplayerUIHandle
|
||||||
virtual CInstance &getDisplayedInstance() { return _Instance; }
|
virtual CInstance &getDisplayedInstance() { return _Instance; }
|
||||||
virtual bool handleEvent (const CEventDescriptor &event);
|
virtual bool handleEvent (const NLGUI::CEventDescriptor &event);
|
||||||
private:
|
private:
|
||||||
CInstance &_Instance;
|
CInstance &_Instance;
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -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)
|
//H_AUTO(R2_CTool_handleEvent)
|
||||||
bool handled = false;
|
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())
|
switch(eventDesc.getEventTypeExtended())
|
||||||
{
|
{
|
||||||
case CEventDescriptorMouse::mousemove:
|
case NLGUI::CEventDescriptorMouse::mousemove:
|
||||||
handled = onMouseMove();
|
handled = onMouseMove();
|
||||||
break;
|
break;
|
||||||
case CEventDescriptorMouse::mouseleftdown:
|
case NLGUI::CEventDescriptorMouse::mouseleftdown:
|
||||||
handled = onMouseLeftButtonDown();
|
handled = onMouseLeftButtonDown();
|
||||||
//if (handled) nlwarning("onMouseLeftButtonDown handled");
|
//if (handled) nlwarning("onMouseLeftButtonDown handled");
|
||||||
break;
|
break;
|
||||||
case CEventDescriptorMouse::mouserightdown:
|
case NLGUI::CEventDescriptorMouse::mouserightdown:
|
||||||
handled = onMouseRightButtonDown();
|
handled = onMouseRightButtonDown();
|
||||||
//if (handled) nlwarning("onMouseRightButtonDown handled");
|
//if (handled) nlwarning("onMouseRightButtonDown handled");
|
||||||
break;
|
break;
|
||||||
case CEventDescriptorMouse::mouseleftup:
|
case NLGUI::CEventDescriptorMouse::mouseleftup:
|
||||||
handled = onMouseLeftButtonUp();
|
handled = onMouseLeftButtonUp();
|
||||||
//if (handled) nlwarning("onMouseLeftButtonUp handled");
|
//if (handled) nlwarning("onMouseLeftButtonUp handled");
|
||||||
break;
|
break;
|
||||||
case CEventDescriptorMouse::mouserightup:
|
case NLGUI::CEventDescriptorMouse::mouserightup:
|
||||||
handled = onMouseRightButtonUp();
|
handled = onMouseRightButtonUp();
|
||||||
//if (handled) nlwarning("onMouseRightButtonUp handled");
|
//if (handled) nlwarning("onMouseRightButtonUp handled");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (event.getType() == CEventDescriptor::system)
|
if (event.getType() == NLGUI::CEventDescriptor::system)
|
||||||
{
|
{
|
||||||
const CEventDescriptorSystem &eds = (const CEventDescriptorSystem &) event;
|
const NLGUI::CEventDescriptorSystem &eds = (const NLGUI::CEventDescriptorSystem &) event;
|
||||||
if (eds.getEventTypeExtended() == CEventDescriptorSystem::setfocus)
|
if (eds.getEventTypeExtended() == NLGUI::CEventDescriptorSystem::setfocus)
|
||||||
{
|
{
|
||||||
const CEventDescriptorSetFocus &edsf = (const CEventDescriptorSetFocus &) eds;
|
const NLGUI::CEventDescriptorSetFocus &edsf = (const NLGUI::CEventDescriptorSetFocus &) eds;
|
||||||
if (edsf.hasFocus() == true)
|
if (edsf.hasFocus() == true)
|
||||||
{
|
{
|
||||||
onFocusGained();
|
onFocusGained();
|
||||||
|
|
|
@ -26,7 +26,10 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
class CInterfaceManager;
|
class CInterfaceManager;
|
||||||
|
namespace NLGUI
|
||||||
|
{
|
||||||
class CEventDescriptor;
|
class CEventDescriptor;
|
||||||
|
}
|
||||||
class CLuaObject;
|
class CLuaObject;
|
||||||
class CGroupMap;
|
class CGroupMap;
|
||||||
|
|
||||||
|
@ -119,7 +122,7 @@ public:
|
||||||
*
|
*
|
||||||
* \return true if the event has been handled by the tool
|
* \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)
|
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,
|
// IMPORTANT : Reacting to this should be unnecessary, as lost focus reset the current tool,
|
||||||
|
|
Loading…
Reference in a new issue