本文整理汇总了C++中CInterfaceManager::getCapturePointerRight方法的典型用法代码示例。如果您正苦于以下问题:C++ CInterfaceManager::getCapturePointerRight方法的具体用法?C++ CInterfaceManager::getCapturePointerRight怎么用?C++ CInterfaceManager::getCapturePointerRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CInterfaceManager
的用法示例。
在下文中一共展示了CInterfaceManager::getCapturePointerRight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleEvent
// ***************************************************************************
bool CCtrlBase::handleEvent(const CEventDescriptor &event)
{
if (event.getType() == CEventDescriptor::system)
{
CEventDescriptorSystem &eds = (CEventDescriptorSystem&)event;
if (eds.getEventTypeExtended() == CEventDescriptorSystem::activecalledonparent)
{
if (!((CEventDescriptorActiveCalledOnParent &) eds).getActive())
{
// the mouse capture should be lost when the ctrl is hidden
CInterfaceManager *manager = CInterfaceManager::getInstance();
if (manager->getCapturePointerLeft() == this)
{
manager->setCapturePointerLeft(NULL);
}
if (manager->getCapturePointerRight() == this)
{
manager->setCapturePointerRight(NULL);
}
// NB : don't call return here because derived class may be interested
// in handling event more speciffically
}
}
}
return false;
}
示例2: draw
//.........这里部分代码省略.........
{
CViewLink *vLink = dynamic_cast<CViewLink*>(vUP[i]);
if (vLink != NULL)
{
string tooltip;
uint8 rot;
if (vLink->getMouseOverShape(tooltip, rot, col))
{
setString(ucstring(tooltip));
sint32 texId = rVR.getTextureIdFromName ("curs_pick.tga");
CInterfaceGroup *stringCursor = IsMouseCursorHardware() ? _StringCursorHardware : _StringCursor;
if (stringCursor)
{
stringCursor->setX(_PointerX);
stringCursor->setY(_PointerY);
stringCursor->updateCoords();
stringCursor->draw();
// if in hardware mode, force to draw the default cursor no matter what..
if (IsMouseCursorHardware())
drawCursor(texId, col, 0);
}
else
{
drawCursor(texId, col, 0);
}
return;
}
}
}
// Draw if capture right
pCB = pIM->getCapturePointerRight();
if (pCB != NULL)
{
// Is it a 3d scene ?
if (drawScale(pCB,col)) return;
drawCursor(_TxIdDefault, col, 0);
return;
}
bool overModalWindow = false;
// is the cursor currently over a modal window ?
CInterfaceGroup *currModal = pIM->getModalWindow();
if (currModal)
{
sint32 xPos = _XReal + _OffsetX;
sint32 yPos = _YReal + _OffsetY;
overModalWindow = currModal->isIn(xPos, yPos, _WReal, _HReal);
}
// Draw the cursor type that are under the pointer
if (pIM->isMouseHandlingEnabled())
{
// Sorts the controls according to their depth, to approximate as best the CapturePointerLeft algo.
// Especially important so that Resizers controls get the precedence over the move control (else could randomly bug like in chat group)
static vector<CCtrlDepthEntry> sortedControls;
sortedControls.clear();
for(uint i=0;i<rICL.size();i++)
{
CCtrlDepthEntry cde;
cde.Ctrl= rICL[i];
// NB: not the exact CInterfaceManager getDepth test here, but should work fine
示例3: operator
// ***************************************************************************
void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
{
HandleSystemCursorCapture(event);
if (event == EventDisplayChangeId)
{
}
// Process message to InterfaceManager
CInterfaceManager *pIM = CInterfaceManager::getInstance();
if (event==EventSetFocusId)
{
CEventSetFocus *pEvent=(CEventSetFocus *)&event;
if (!pEvent->Get)
{
// Deactivate all keys
_MouseButtonsDown = noButton;
_MouseButtonsReleased = noButton;
_MouseButtonsState = noButton;
_Focus = false;
if (!_SkipInterfaceManager)
{
// if there was some control capturing the mouse, warn them that they lost the focus
if (pIM->getCapturePointerLeft())
{
pIM->getCapturePointerLeft()->handleEvent(CEventDescriptorSetFocus(pEvent->Get));
}
pIM->setCapturePointerLeft(NULL);
if (pIM->getCapturePointerRight())
{
pIM->getCapturePointerRight()->handleEvent(CEventDescriptorSetFocus(pEvent->Get));
}
pIM->setCapturePointerRight(NULL);
UserControls.stopFreeLook();
}
// be nice with other app : let the mouse reappear (useful in direct 3D mode with no hardware cursor)
Driver->showCursor(true);
// Driver->setSystemArrow();
}
else
{
_RecoverFocusLost = true; // force to update mouse pos on next click or move
Driver->showCursor(IsMouseCursorHardware());
_Focus = true;
}
if(!_SkipInterfaceManager)
{
//
if (R2::getEditor().isInitialized()
&& (ClientCfg.R2EDEnabled || R2::getEditor().getCurrentTool())
)
{
R2::getEditor().handleEvent(CEventDescriptorSetFocus(pEvent->Get));
}
}
// re-post
FilteredEventServer.postEvent( event.clone() );
}
// If want to skip the interface Manager
if(_SkipInterfaceManager)
{
// redirect to FilteredEventServer
FilteredEventServer.postEvent( event.clone() );
/* Invalidate Actions managers by simulate keyUp on all. Else can have this scenario:
- keyDown ("forward" action valide) before teleporting
- keyUp while teleporting (=> _SkipInterfaceManager==true)
- action still valide when teleported
*/
EditActions.releaseAllKeyNoRunning();
Actions.releaseAllKeyNoRunning();
return;
}
// **** Event Focus
// **** Event Keyboard
if( event == EventKeyDownId ||
event == EventKeyUpId ||
event == EventCharId ||
event == EventStringId)
{
// if not handled, post to Action Manager
if( !pIM->handleEvent( CEventDescriptorKey((const CEventKey &) event) ) )
{
// See if handled by editor
bool handled = false;
if (R2::getEditor().isInitialized()
&& (ClientCfg.R2EDEnabled || R2::getEditor().getCurrentTool())
)
{
handled = R2::getEditor().handleEvent(CEventDescriptorKey((const CEventKey &) event) );
}
if (!handled)
//.........这里部分代码省略.........