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


C++ MYGUI_ASSERT函数代码示例

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


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


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