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


C++ Widget::setColour方法代码示例

本文整理汇总了C++中mygui::Widget::setColour方法的典型用法代码示例。如果您正苦于以下问题:C++ Widget::setColour方法的具体用法?C++ Widget::setColour怎么用?C++ Widget::setColour使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mygui::Widget的用法示例。


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

示例1: setHoverSlotsColor

	void StashPanel::setHoverSlotsColor(Game::InventorySlot* _slot, Game::InventorySize* _size, MyGUI::Colour color)
	{
		bool set_all_red = false;
		for (int r = _slot->R; r < (_slot->R +_size->Height); r++)
		{
			for (int c = _slot->C; c < (_slot->C + _size->Width); c++)
			{
				Game::InventorySlot temp_slot(r,c);
				MyGUI::Widget* wg = this->getWidgetSlotByRC(r,c);
				if (wg != 0)
					wg->setColour(color);
				else
					set_all_red = true;
			}
		}

		if (set_all_red)
		{
			for (int r = _slot->R; r < (_slot->R +_size->Height); r++)
			{
				for (int c = _slot->C; c < (_slot->C + _size->Width); c++)
				{
					MyGUI::Widget* wg = this->getWidgetSlotByRC(r,c);
					if (wg != 0)
						wg->setColour(MyGUI::Colour::Red);
				}
			}
		}
	}
开发者ID:Alex-G,项目名称:MuOnline,代码行数:29,代码来源:StashPanel.cpp

示例2: initialiseByAttributes

	CurveEditor::CurveEditor(MyGUI::Widget* _parent)
	{
        initialiseByAttributes(this, _parent);

        mEditTimeEditBox->setEditReadOnly(true);
        mEditValueEditBox->setEditReadOnly(true);

        mRangeMinEditBox->eventKeyLostFocus     += MyGUI::newDelegate(this, &CurveEditor::NotifyRangeLostFocus);
        mRangeMinEditBox->eventEditSelectAccept += MyGUI::newDelegate(this, &CurveEditor::NotifyRangeEditAccept);
        mRangeMaxEditBox->eventKeyLostFocus     += MyGUI::newDelegate(this, &CurveEditor::NotifyRangeLostFocus);
        mRangeMaxEditBox->eventEditSelectAccept += MyGUI::newDelegate(this, &CurveEditor::NotifyRangeEditAccept);

        MyGUI::PolygonalSkin::CreateLineSets = false;
        MyGUI::Widget* widget = mCurveCanvasWidget->createWidget<MyGUI::Widget>("PolygonalSkin",
            MyGUI::IntCoord(MyGUI::IntPoint(), mCurveCanvasWidget->getSize()), MyGUI::Align::Stretch);
        widget->setColour(MyGUI::Colour::Red);
        MyGUI::ISubWidget* main = widget->getSubWidgetMain();
        mCurveLines = main->castType<MyGUI::PolygonalSkin>();

        MyGUI::PolygonalSkin::CreateLineSets = true;
        widget = mCurveCanvasWidget->createWidget<MyGUI::Widget>("PolygonalSkin",
            MyGUI::IntCoord(MyGUI::IntPoint(), mCurveCanvasWidget->getSize()), MyGUI::Align::Stretch);
        widget->setColour(MyGUI::Colour::Red);
        main = widget->getSubWidgetMain();
        mCurveCanvas = main->castType<MyGUI::PolygonalSkin>();
        widget->eventMouseButtonPressed += MyGUI::newDelegate(this, &CurveEditor::NotifyMousePressed);
        MyGUI::PolygonalSkin::CreateLineSets = false;
        mCanvasWidget = widget;

        mCurveCanvas->setWidth(5.0f);
        std::vector<MyGUI::FloatPoint> mLinePoints;
        mLinePoints.push_back(MyGUI::FloatPoint(0, 0));
        mLinePoints.push_back(MyGUI::FloatPoint(0, 1));
        mCurveCanvas->setPoints(mLinePoints);
        mLinePoints.clear();
        mCurveCanvas->setPoints(mLinePoints); // todo fix it 

        mCurveLines->_setColour(MyGUI::Colour(0.2f, 0.2f, 0.2f));

        // default range
        mValueRange.x = 0;
        mValueRange.y = 10;
        mRangeMinEditBox->setCaption("0");
        mRangeMaxEditBox->setCaption("10");

        InitGrid();

        RefreshNumbers();

        MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>(false);
        if (window != nullptr) 
            window->eventWindowButtonPressed += newDelegate(this, &CurveEditor::NotifyWindowButtonPressed);

        mSplineButton = mMainWidget->createWidget<MyGUI::Button>("CheckBox",
            MyGUI::IntCoord(15, 10, 95, 25),
            MyGUI::Align::Left | MyGUI::Align::Top);
        mSplineButton->setCaption("Use Spline");
        mSplineButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CurveEditor::NotifySplineChecked);
    }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:59,代码来源:CurveEditor.cpp

示例3: createScene

	void DemoKeeper::createScene()
	{
		base::BaseDemoManager::createScene();
		MyGUI::ResourceManager::getInstance().load("SplineSkin.xml");

		const MyGUI::VectorWidgetPtr& root = MyGUI::LayoutManager::getInstance().loadLayout("HelpPanel.layout");
		root.at(0)->findWidget("Text")->castType<MyGUI::TextBox>()->setCaption("PolygonalSkin usage. Drag white rectangles to move points for bezier curve.");

		MyGUI::VectorWidgetPtr widgets = MyGUI::LayoutManager::getInstance().loadLayout("SplineWindow.layout");
		mQualityText = widgets.at(0)->findWidget("SplineText")->castType<MyGUI::TextBox>();
		MyGUI::ScrollBar* qualityScroll = widgets.at(0)->findWidget("SplineQuality")->castType<MyGUI::ScrollBar>();
		qualityScroll->eventScrollChangePosition += MyGUI::newDelegate(this, &DemoKeeper::notifyChangeQuality);
		mClient = widgets.at(0)->findWidget("SplineClient");

		// create widget with skin that contain specific sub skin - PolygonalSkin
		MyGUI::Widget* widget = mClient->createWidget<MyGUI::Widget>("PolygonalSkin", MyGUI::IntCoord(MyGUI::IntPoint(), mClient->getSize()), MyGUI::Align::Stretch);
		widget->setColour(MyGUI::Colour::Red);
		// get main subskin
		MyGUI::ISubWidget* main = widget->getSubWidgetMain();
		mPolygonalSkin = main->castType<MyGUI::PolygonalSkin>();

		// set PolygonalSkin properties and points
		mPolygonalSkin->setWidth(8.0f);

		for (int i = 0; i < PointsCount; ++i)
		{
			point[i] = mClient->createWidget<MyGUI::Button>("Button", MyGUI::IntCoord(10 + (i + i % 2 * 3) * 40, 10 + (i + i / 2 * 3) * 40, 16, 16), MyGUI::Align::Default);
			point[i]->eventMouseDrag += newDelegate(this, &DemoKeeper::notifyPointMove);
			point[i]->eventMouseButtonPressed += newDelegate(this, &DemoKeeper::notifyPointPressed);
		}

		notifyChangeQuality(qualityScroll, 12);
		updateSpline();
	}
开发者ID:blunted2night,项目名称:MyGUI,代码行数:34,代码来源:DemoKeeper.cpp

示例4: setAllSlotsColor

	void StashPanel::setAllSlotsColor(MyGUI::Colour color)
	{
		int slot_count = this->mslot_container_panelWidget->getChildCount();
		for (int i = 0; i < slot_count; i++)
		{
			MyGUI::Widget* widget = this->mslot_container_panelWidget->getChildAt(i);
			widget->setColour(color);
		}
	}
开发者ID:Alex-G,项目名称:MuOnline,代码行数:9,代码来源:StashPanel.cpp


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