• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ MYGUI_ASSERT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MYGUI_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ MYGUI_ASSERT函数的具体用法?C++ MYGUI_ASSERT怎么用?C++ MYGUI_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MYGUI_ASSERT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: getParent

	void MenuItem::initialiseOverride()
	{
		Base::initialiseOverride();

		// FIXME проверить смену скина ибо должно один раз вызываться
		Widget* parent = getParent();
		MYGUI_ASSERT(parent, "MenuItem must have parent MenuControl");
		if (!parent->isType<MenuControl>())
		{
			Widget* client = parent;
			parent = client->getParent();
			MYGUI_ASSERT(parent, "MenuItem must have parent MenuControl");
			MYGUI_ASSERT(parent->getClientWidget() == client, "MenuItem must have parent MenuControl");
			MYGUI_ASSERT(parent->isType<MenuControl>(), "MenuItem must have parent MenuControl");
		}
		mOwner = parent->castType<MenuControl>();

		assignWidget(mCheck, "Check");

		//if (isUserString("MinSize"))
			//mMinSize = IntSize::parse(getUserString("MinSize"));

		//FIXME нам нуженфокус клавы
		setNeedKeyFocus(true);

		updateCheck();
	}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:27,代码来源:MyGUI_MenuItem.cpp


示例2: MYGUI_ASSERT

	const Ogre::UTFString & MultiList::getSubItem(size_t _column, size_t _index)
	{
		MYGUI_ASSERT(false == mVectorColumnInfo.empty(), "multilist has no columns");
		MYGUI_ASSERT(_column < mVectorColumnInfo.size(), "column " << _column <<" out of range");
		MYGUI_ASSERT(_index < mVectorColumnInfo.begin()->list->getItemCount(), "index " << _index <<" out of range");
		return mVectorColumnInfo[_column].list->getItem(convertToSort(_index));
	}
开发者ID:twktheainur,项目名称:vortex-ee,代码行数:7,代码来源:MyGUI_MultiList.cpp


示例3: step_create_widget

	void step_create_widget()
	{
		MyGUI::Widget* widget = get_random(all_widgets);
		if (widget)
		{
			int select = random(3);
			if (select == 0)
			{
				MyGUI::Widget* child = widget->createWidget<MyGUI::Widget>(MyGUI::WidgetStyle::Child, get_skin(), get_coord(), MyGUI::Align::Default);
				MYGUI_ASSERT(child, "child nullptr");
				all_widgets.push_back(child);
			}
			else if (select == 1)
			{
				MyGUI::Widget* child = widget->createWidget<MyGUI::Widget>(MyGUI::WidgetStyle::Popup, get_skin(), get_coord(), MyGUI::Align::Default, get_layer());
				MYGUI_ASSERT(child, "child nullptr");
				all_widgets.push_back(child);
			}
			else if (select == 2)
			{
				MyGUI::Widget* child = widget->createWidget<MyGUI::Widget>(MyGUI::WidgetStyle::Overlapped, get_skin(), get_coord(), MyGUI::Align::Default);
				MYGUI_ASSERT(child, "child nullptr");
				all_widgets.push_back(child);
			}
		}
		else
		{
			MyGUI::Widget* child = MyGUI::Gui::getInstance().createWidget<MyGUI::Widget>(get_skin(), get_coord(), MyGUI::Align::Default, get_layer());
			MYGUI_ASSERT(child, "child nullptr");
			all_widgets.push_back(child);
		}
		test_widgets();
	}
开发者ID:dayongxie,项目名称:MyGUI,代码行数:33,代码来源:DemoKeeper.cpp


示例4: MYGUI_ASSERT

	void Canvas::setPixel( int _x, int _y, const Ogre::ColourValue & value )
	{
		MYGUI_ASSERT( _x >= 0 && _x < getTextureRealWidth() && _y >= 0 && _y < getTextureRealHeight(),
			"Access to non-exists pixel! Check real dimensions of texture!" );

		MYGUI_ASSERT( isLocked(), "Must lock MyGUI::Canvas before set pixel!" );

		Ogre::PixelUtil::packColour( value, getTextureFormat(), pointPixel( _x, _y ) );
	}
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:9,代码来源:MyGUI_Canvas.cpp


示例5: MYGUI_ASSERT

	void Gui::setActiveViewport(Ogre::ushort _num)
	{
		if (_num == mActiveViewport) return;
		MYGUI_ASSERT(mWindow, "Gui is not initialised.");
		MYGUI_ASSERT(mWindow->getNumViewports() >= _num, "index out of range");
		mActiveViewport = _num;
		// рассылка обновлений
		windowResized(mWindow);
	}
开发者ID:twktheainur,项目名称:vortex-ee,代码行数:9,代码来源:MyGUI_Gui.cpp


示例6: MYGUI_ASSERT

	size_t ItemBox::getIndexByWidget(Widget* _widget)
	{
		MYGUI_ASSERT(_widget, "ItemBox::getIndexByWidget : Widget == nullptr");
		if (_widget == _getClientWidget()) return ITEM_NONE;
		MYGUI_ASSERT(_widget->getParent() == _getClientWidget(), "ItemBox::getIndexByWidget : Widget is not child");

		size_t index = calcIndexByWidget(_widget);
		MYGUI_ASSERT_RANGE(index, mItemsInfo.size(), "ItemBox::getIndexByWidget");

		return index;
	}
开发者ID:DotWolff,项目名称:mygui,代码行数:11,代码来源:MyGUI_ItemBox.cpp


示例7: Widget

	ItemBox::ItemBox(const IntCoord& _coord, char _align, const WidgetSkinInfoPtr _info, CroppedRectanglePtr _parent, const Ogre::String & _name) :
		Widget(_coord, _align, _info, _parent, _name),
		mWidgetScroll(null),
		mWidgetClient(null),
		mTopIndex(0),
		mOffsetTop(0),
		mRangeIndex(-1),
		//mLastRedrawLine(0),
		//mIndexSelect(ITEM_NONE),
		mIsFocus(false),
		mCountItems(0)
	{
		// нам нужен фокус клавы
		mNeedKeyFocus = true;

		for (VectorWidgetPtr::iterator iter=mWidgetChild.begin(); iter!=mWidgetChild.end(); ++iter) {
			if ((*iter)->_getInternalString() == "VScroll") {
				mWidgetScroll = castWidget<VScroll>(*iter);
				mWidgetScroll->eventScrollChangePosition = newDelegate(this, &ItemBox::notifyScrollChangePosition);
				//mWidgetScroll->eventMouseButtonPressed = newDelegate(this, &ItemBox::notifyMousePressed);
			}
			else if ((*iter)->_getInternalString() == "Client") {
				mWidgetClient = (*iter);
				//mWidgetClient->eventMouseButtonPressed = newDelegate(this, &ItemBox::notifyMousePressed);
				mWidgetClient->eventMouseWheel = newDelegate(this, &ItemBox::notifyMouseWheel);
			}
		}
		MYGUI_ASSERT(null != mWidgetScroll, "Child VScroll not found in skin (ItemBox must have VScroll)");
		MYGUI_ASSERT(null != mWidgetClient, "Child Widget Client not found in skin (ItemBox must have Client)");

		// парсим свойства
		/*const MapString & param = _info->getParams();
		MapString::const_iterator iter = param.find("SkinLine");
		if (iter != param.end()) mSkinLine = iter->second;
		MYGUI_ASSERT(false == mSkinLine.empty(), "SkinLine property or skin not found (ItemBox must have SkinLine property)");

		iter = param.find("HeightLine");
		if (iter != param.end()) mHeightLine = utility::parseInt(iter->second);
		if (mHeightLine < 1) mHeightLine = 1;

*/
		mWidgetScroll->setScrollPage((size_t)mSizeItem.height);

		mSizeItem.set(50, 50);
		mCountItems = 200;

		updateMetrics();
		updateScroll();
		_redrawAllVisible();
		//updateLine();

	}
开发者ID:MyGUI,项目名称:mygui-historical,代码行数:52,代码来源:MyGUI_ItemBox.cpp


示例8: MYGUI_ASSERT

	void SeparatorV::notifyMouseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
	{
		MYGUI_ASSERT(mLeftPanel, "SeparatorV left panel must not be null.");
		MYGUI_ASSERT(mRightPanel, "SeparatorV left panel must not be null.");

		if (_id == MyGUI::MouseButton::Left)
		{
			mStartLeftPanel = mLeftPanel->getCoord();
			mStartRightPanel = mRightPanel->getCoord();
			mStartSeparatorV = getCoord();
			mStartMousePosition = MyGUI::InputManager::getInstance().getMousePosition();
		}
	}
开发者ID:chena1982,项目名称:mygui,代码行数:13,代码来源:MyGUI_SeparatorV.cpp


示例9: MYGUI_ASSERT

	void StateManager::pushState(StateController* _state)
	{
		MYGUI_ASSERT(_state != nullptr, "State is nullptr");
		MYGUI_ASSERT(std::find(mStates.begin(), mStates.end(), _state) == mStates.end(), "State already added");

		StateController* pauseState = getCurentState();

		mStates.push_back(_state);

		if (pauseState != nullptr)
			pauseState->pauseState();

		_state->initState();
	}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:14,代码来源:StateManager.cpp


示例10: MYGUI_ASSERT

	void InputManager::initialise()
	{
		MYGUI_ASSERT(!mIsInitialise, getClassTypeName() << " initialised twice");
		MYGUI_LOG(Info, "* Initialise: " << getClassTypeName());

		mWidgetMouseFocus = nullptr;
		mWidgetKeyFocus = nullptr;
		mLayerMouseFocus = nullptr;
		for (int i = MouseButton::Button0; i < MouseButton::MAX; ++i)
		{
			mMouseCapture[i] = false;
		}
		mIsShiftPressed = false;
		mIsControlPressed = false;
		mHoldKey = KeyCode::None;
		mHoldChar = 0;
		mFirstPressKey = true;
		mTimerKey = 0.0f;
		mOldAbsZ = 0;

		WidgetManager::getInstance().registerUnlinker(this);
		Gui::getInstance().eventFrameStart += newDelegate(this, &InputManager::frameEntered);

		MYGUI_LOG(Info, getClassTypeName() << " successfully initialized");
		mIsInitialise = true;
	}
开发者ID:MyGUI,项目名称:mygui,代码行数:26,代码来源:MyGUI_InputManager.cpp


示例11: MYGUI_ASSERT

	void MainSkin::_setUVSet(const FloatRect& _rect)
	{
		MYGUI_ASSERT(null != mOverlayContainer, "overlay is not create");
		mRectTexture = _rect;
		// если обрезаны, то просчитываем с учето обрезки
		if (mIsMargin) {

			float UV_lft = mParent->getMarginLeft() / (float)mParent->getWidth();
			float UV_top = mParent->getMarginTop() / (float)mParent->getHeight();
			float UV_rgt = (mParent->getWidth() - mParent->getMarginRight()) / (float)mParent->getWidth();
			float UV_btm = (mParent->getHeight() - mParent->getMarginBottom()) / (float)mParent->getHeight();

			float UV_sizeX = mRectTexture.right - mRectTexture.left;
			float UV_sizeY = mRectTexture.bottom - mRectTexture.top;

			float UV_lft_total = mRectTexture.left + UV_lft * UV_sizeX;
			float UV_top_total = mRectTexture.top + UV_top * UV_sizeY;
			float UV_rgt_total = mRectTexture.right - (1-UV_rgt) * UV_sizeX;
			float UV_btm_total = mRectTexture.bottom - (1-UV_btm) * UV_sizeY;

			mOverlayContainer->setUVInfo(UV_lft_total, UV_top_total, UV_rgt_total, UV_btm_total, 0);

		} else {
			// мы не обрезаны, базовые координаты
			mOverlayContainer->setUVInfo(mRectTexture.left, mRectTexture.top, mRectTexture.right, mRectTexture.bottom, 0);
		}
	}
开发者ID:MyGUI,项目名称:mygui-historical,代码行数:27,代码来源:MyGUI_MainSkin.cpp


示例12: MYGUI_ASSERT

	// удяляет неудачника
	void Gui::_destroyChildWidget(Widget* _widget)
	{
		MYGUI_ASSERT(nullptr != _widget, "invalid widget pointer");

		VectorWidgetPtr::iterator iter = std::find(mWidgetChild.begin(), mWidgetChild.end(), _widget);
		if (iter != mWidgetChild.end())
		{
			// сохраняем указатель
			MyGUI::Widget* widget = *iter;

			// удаляем из списка
			*iter = mWidgetChild.back();
			mWidgetChild.pop_back();

			// отписываем от всех
			mWidgetManager->unlinkFromUnlinkers(_widget);

			// непосредственное удаление
			WidgetManager::getInstance()._deleteWidget(widget);
		}
		else
		{
			MYGUI_EXCEPT("Widget '" << _widget->getName() << "' not found");
		}
	}
开发者ID:alexis-,项目名称:iwe,代码行数:26,代码来源:MyGUI_Gui.cpp


示例13: MYGUI_ASSERT

	void SizeDescription::setSizeBehaviour( uint8 _beh )
	{
		MYGUI_ASSERT( checkBehaviour( _beh ), "Invalid size benaviour!" );

		mSizeBehaviour = _beh;
		//mIsInitialized = true;
	}
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:7,代码来源:MyGUI_SizeDescription.cpp


示例14: MYGUI_ASSERT

	void LayerManager::initialise()
	{
		MYGUI_ASSERT(false == mIsInitialise, INSTANCE_TYPE_NAME << " initialised twice");
		MYGUI_LOG(Info, "* Initialise: " << INSTANCE_TYPE_NAME);

		WidgetManager::getInstance().registerUnlinker(this);
		Gui::getInstance().registerLoadXmlDelegate(XML_TYPE) = newDelegate(this, &LayerManager::_load);

		Ogre::SceneManagerEnumerator::SceneManagerIterator iter = Ogre::Root::getSingleton().getSceneManagerIterator();
		if (iter.hasMoreElements()) {
			mSceneManager = iter.getNext();
			mSceneManager->addRenderQueueListener(this);
		}
		else {
			mSceneManager = null;
		}

		// инициализация
		mPixScaleX = mPixScaleY = 1;
        mHOffset = mVOffset = 0;
		mAspectCoef = 1;
		mUpdate = false;

		MYGUI_LOG(Info, INSTANCE_TYPE_NAME << " successfully initialized");
		mIsInitialise = true;

		// не забывай, о великий построитель гуёв
		// Кто здесь?
		mMaximumDepth = Ogre::Root::getSingleton().getRenderSystem()->getMaximumDepthInputValue();
	}
开发者ID:twktheainur,项目名称:vortex-ee,代码行数:30,代码来源:MyGUI_LayerManager.cpp


示例15: destroyDemo

void DemoKeeper::createDemo(size_t _index)
{
    destroyDemo();

    if (_index == 0)
    {
        MyGUI::LanguageManager::getInstance().loadUserTags("core_theme_tag.xml");
        getGUI()->load("core_skin.xml");
    }
    else if (_index == 1)
    {
        MyGUI::LanguageManager::getInstance().loadUserTags("core_theme_black_blue_tag.xml");
        getGUI()->load("core_skin.xml");
    }
    else if (_index == 2)
    {
        MyGUI::LanguageManager::getInstance().loadUserTags("core_theme_black_orange_tag.xml");
        getGUI()->load("core_skin.xml");
    }

    MyGUI::VectorWidgetPtr windows = MyGUI::LayoutManager::getInstance().load("Themes.layout");
    MYGUI_ASSERT(windows.size() == 1, "Error load layout");
    mDemoView = windows[0];

    mComboSkins = getGUI()->findWidget<MyGUI::ComboBox>("Combo");
    mComboSkins->setComboModeDrop(true);
    mComboSkins->addItem("core");
    mComboSkins->addItem("black & blue");
    mComboSkins->addItem("black & orange");

    mComboSkins->setIndexSelected(_index);
    mComboSkins->eventComboAccept = MyGUI::newDelegate(this, &DemoKeeper::notifyComboAccept);
}
开发者ID:sskoruppa,项目名称:Glove_Code,代码行数:33,代码来源:DemoKeeper.cpp


示例16: MYGUI_ASSERT

	PropertyPtr Data::getProperty(const std::string& _name) const
	{
		MapProperty::const_iterator property = mProperties.find(_name);
		MYGUI_ASSERT(property != mProperties.end(), "Property " << _name << " not found");

		return (*property).second;
	}
开发者ID:Altren,项目名称:mygui,代码行数:7,代码来源:Data.cpp


示例17: MYGUI_ASSERT

	void InputManager::initialise()
	{
		MYGUI_ASSERT(false == mIsInitialise, INSTANCE_TYPE_NAME << " initialised twice");
		MYGUI_LOG(Info, "* Initialise: " << INSTANCE_TYPE_NAME);

		mWidgetMouseFocus = 0;
		mWidgetKeyFocus = 0;
		mWidgetRootMouseFocus = 0;
		mWidgetRootKeyFocus = 0;
		mIsWidgetMouseCapture = false;
		mIsShiftPressed = false;
		mIsControlPressed = false;
		mHoldKey = KC_UNASSIGNED;
		//mUseOISKeyLayout = false;
		mFirstPressKey = true;
		mTimerKey = 0.0f;
		mOldAbsZ = 0;

		createDefaultCharSet();

		WidgetManager::getInstance().registerUnlinker(this);
		Gui::getInstance().addFrameListener(this);
		Gui::getInstance().registerLoadXmlDelegate(XML_TYPE) = newDelegate(this, &InputManager::_load);

		MYGUI_LOG(Info, INSTANCE_TYPE_NAME << " successfully initialized");
		mIsInitialise = true;
	}
开发者ID:twktheainur,项目名称:vortex-ee,代码行数:27,代码来源:MyGUI_InputManager.cpp


示例18: MYGUI_ASSERT

	void MenuBar::setItem(size_t _index, const Ogre::UTFString & _item)
	{
		MYGUI_ASSERT(_index < mVectorMenuItemInfo.size(), "index '" << _index << "' out of range");
		mVectorMenuItemInfo[_index].button->setCaption(_item);

		update();
	}
开发者ID:twktheainur,项目名称:vortex-ee,代码行数:7,代码来源:MyGUI_MenuBar.cpp


示例19: IMG_Load

	void* BaseManager::loadImage(int& _width, int& _height, MyGUI::PixelFormat& _format, const std::string& _filename)
	{
		std::string fullname = MyGUI::OpenGLESDataManager::getInstance().getDataPath(_filename);
		void* result = nullptr;
		SDL_Surface *image = nullptr;
		SDL_Surface *cvtImage = nullptr;		// converted surface with RGBA/RGB pixel format
		image = IMG_Load(fullname.c_str());
		MYGUI_ASSERT(image != nullptr, "Failed to load image: " + fullname);

		_width = image->w;
		_height = image->h;

		int bpp = image->format->BytesPerPixel;
		if (bpp < 3)
		{
			result = convertPixelData(image, _format);
		}
		else
		{
			Uint32 pixelFmt = bpp == 3 ? SDL_PIXELFORMAT_BGR24 : SDL_PIXELFORMAT_ARGB8888;
			cvtImage = SDL_ConvertSurfaceFormat(image, pixelFmt, 0);
			result = convertPixelData(cvtImage, _format);
			SDL_FreeSurface(cvtImage);
		}
		SDL_FreeSurface(image);

		return result;
	}
开发者ID:atchouprakov,项目名称:mygui,代码行数:28,代码来源:BaseManager.cpp


示例20: MYGUI_ASSERT

	bool PluginManager::loadPlugin(const std::string& _file)
	{
#ifdef EMSCRIPTEN
		return false;
#endif
		MYGUI_ASSERT(mIsInitialise, getClassTypeName() << " used but not initialised");

		// Load plugin library
		DynLib* lib = DynLibManager::getInstance().load(_file);
		if (!lib)
		{
			MYGUI_LOG(Error, "Plugin '" << _file << "' not found");
			return false;
		}

		// Call startup function
		DLL_START_PLUGIN pFunc = reinterpret_cast<DLL_START_PLUGIN>(lib->getSymbol("dllStartPlugin"));
		if (!pFunc)
		{
			MYGUI_LOG(Error, "Cannot find symbol 'dllStartPlugin' in library " << _file);
			return false;
		}

		// Store for later unload
		mLibs[_file] = lib;

		// This must call installPlugin
		pFunc();

		return true;
	}
开发者ID:MyGUI,项目名称:mygui,代码行数:31,代码来源:MyGUI_PluginManager.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MYGUI_ASSERT_RANGE函数代码示例发布时间:2022-05-30
下一篇:
C++ MYF函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap