当前位置: 首页>>代码示例>>C++>>正文


C++ Sheet::fireSheetEvent方法代码示例

本文整理汇总了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);
		}
	}
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:13,代码来源:QuickGUIMouseCursor.cpp

示例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);
		}
	}
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:17,代码来源:QuickGUIMouseCursor.cpp

示例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);
		}
	}
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:18,代码来源:QuickGUIMouseCursor.cpp

示例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);
			}
		}
	}
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:95,代码来源:QuickGUIMouseCursor.cpp


注:本文中的Sheet::fireSheetEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。