本文整理汇总了C++中Sheet::fireSheetEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ Sheet::fireSheetEvent方法的具体用法?C++ Sheet::fireSheetEvent怎么用?C++ Sheet::fireSheetEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sheet
的用法示例。
在下文中一共展示了Sheet::fireSheetEvent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setQueryFilter
void MouseCursor::setQueryFilter(unsigned int filter)
{
mMouseCursorDesc.queryFilter = filter;
Sheet* sheet = mMouseCursorDesc.guiManager->getActiveSheet();
if(sheet != NULL)
{
MouseEventArgs args(sheet);
args.position = getPosition();
sheet->fireSheetEvent(SHEET_EVENT_MOUSE_CURSOR_QUERY_FILTER_CHANGED,args);
}
}
示例2: setEnabled
void MouseCursor::setEnabled(bool enable)
{
if(enable == mMouseCursorDesc.enabled)
return;
mMouseCursorDesc.enabled = enable;
// Fire enabled changed event.
Sheet* sheet = mMouseCursorDesc.guiManager->getActiveSheet();
if(sheet != NULL)
{
MouseEventArgs args(sheet);
args.position = getPosition();
sheet->fireSheetEvent(SHEET_EVENT_MOUSE_CURSOR_ENABLED_CHANGED,args);
}
}
示例3: setSkinType
void MouseCursor::setSkinType(const Ogre::String type)
{
mSkinType = type;
mDefaultSkinType = type;
Ogre::Image i;
i.load(mSkinTypeManager->getSkinType("MouseCursor",mSkinType)->getSkinElement(TEXTURE)->getTextureName(),Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
// update cursor size to match texture used
setSize(i.getWidth(),i.getHeight());
Sheet* sheet = mMouseCursorDesc.guiManager->getActiveSheet();
if(sheet != NULL)
{
MouseEventArgs args(sheet);
args.position = getPosition();
sheet->fireSheetEvent(SHEET_EVENT_MOUSE_CURSOR_SKIN_CHANGED,args);
}
}
示例4: setPosition
void MouseCursor::setPosition(float xPosition, float yPosition)
{
mDimensions.position.x = xPosition - (mDimensions.size.width/2.0);
mDimensions.position.y = yPosition - (mDimensions.size.height/2.0);
bool fireBorderEnterEvent = false;
bool fireBorderLeaveEvent = false;
// If cursor horizontal position is on left edge of viewport
if(xPosition <= 0)
{
// If we haven't entered the border already, fire event
if(!mEnteredBorders[0])
{
mEnteredBorders[0] = true;
fireBorderEnterEvent = true;
}
}
// Else if cursor horizontal position is on right edge of viewport
else if(xPosition >= (mMouseCursorDesc.guiManager->getViewport()->getActualWidth() - 1))
{
// If we haven't entered the border already, fire event
if(!mEnteredBorders[2])
{
mEnteredBorders[2] = true;
fireBorderEnterEvent = true;
}
}
// Else cursor horizontal position lies in between left and right edge of viewport
else
{
if(mEnteredBorders[0] || mEnteredBorders[2])
{
mEnteredBorders[0] = false;
mEnteredBorders[2] = false;
fireBorderLeaveEvent = true;
}
}
// If cursor vertical position is on top edge of viewport
if(yPosition <= 0)
{
// If we haven't entered the border already, fire event
if(!mEnteredBorders[1])
{
mEnteredBorders[1] = true;
fireBorderEnterEvent = true;
}
}
// Else if cursor vertical position is on bottom edge of viewport
else if(yPosition >= (mMouseCursorDesc.guiManager->getViewport()->getActualHeight() - 1))
{
// If we haven't entered the border already, fire event
if(!mEnteredBorders[3])
{
mEnteredBorders[3] = true;
fireBorderEnterEvent = true;
}
}
// Else cursor vertical position lies in between top and bottom edge of viewport
else
{
if(mEnteredBorders[1] || mEnteredBorders[3])
{
mEnteredBorders[1] = false;
mEnteredBorders[3] = false;
fireBorderLeaveEvent = true;
}
}
// Fire events
if(fireBorderEnterEvent)
{
Sheet* sheet = mMouseCursorDesc.guiManager->getActiveSheet();
if(sheet != NULL)
{
MouseEventArgs args(sheet);
args.position = getPosition();
sheet->fireSheetEvent(SHEET_EVENT_MOUSE_CURSOR_ENTER_SHEET_BORDER,args);
}
}
if(fireBorderLeaveEvent)
{
Sheet* sheet = mMouseCursorDesc.guiManager->getActiveSheet();
if(sheet != NULL)
{
MouseEventArgs args(sheet);
args.position = getPosition();
sheet->fireSheetEvent(SHEET_EVENT_MOUSE_CURSOR_LEAVE_SHEET_BORDER,args);
}
}
}