Пример #1
0
	ColourPanel::ColourPanel()
	{
		initialiseByAttributes(this);

		mCurrentColour = MyGUI::Colour::Green;
		mBaseColour = MyGUI::Colour::Green;

		mColourRect->eventMouseButtonPressed += MyGUI::newDelegate(this, &ColourPanel::notifyMouseButtonPressed);
		mColourRect->eventMouseDrag += MyGUI::newDelegate(this, &ColourPanel::notifyMouseDrag);
		mImageColourPicker->eventMouseDrag += MyGUI::newDelegate(this, &ColourPanel::notifyMouseDrag);
		mScrollRange->eventScrollChangePosition += MyGUI::newDelegate(this, &ColourPanel::notifyScrollChangePosition);

		mEditRed->eventEditTextChange += MyGUI::newDelegate(this, &ColourPanel::notifyEditTextChange);
		mEditGreen->eventEditTextChange += MyGUI::newDelegate(this, &ColourPanel::notifyEditTextChange);
		mEditBlue->eventEditTextChange += MyGUI::newDelegate(this, &ColourPanel::notifyEditTextChange);

		mOk->eventMouseButtonClick += MyGUI::newDelegate(this, &ColourPanel::notifyMouseButtonClick);

		mColourRange.push_back(MyGUI::Colour(1, 0, 0));
		mColourRange.push_back(MyGUI::Colour(1, 0, 1));
		mColourRange.push_back(MyGUI::Colour(0, 0, 1));
		mColourRange.push_back(MyGUI::Colour(0, 1, 1));
		mColourRange.push_back(MyGUI::Colour(0, 1, 0));
		mColourRange.push_back(MyGUI::Colour(1, 1, 0));
		mColourRange.push_back(mColourRange[0]);

		createTexture();

		updateFirst();
	}
Пример #2
0
Kylin::OptionMenu::OptionMenu()
: GuiBase(CLASS_TO(OptionMenu))
{
	initialiseByAttributes(this);

	SetVisible(false);
}
Пример #3
0
	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);
    }
Пример #4
0
	MonitorPanel::MonitorPanel()
	{
		initialiseByAttributes(this);

		mMainWidget->setPosition(0, 0);

		CommandManager::getInstance().registerCommand("KeyboardClick", MyGUI::newDelegate(this, &MonitorPanel::notifyCommand));
	}
Пример #5
0
	FriendPanel::FriendPanel()
	{
		initialiseByAttributes(this);

		const MyGUI::IntSize& size = mMainWidget->getParentSize();
		int offset = size.width / 3;

		mMainWidget->setPosition(offset - (mMainWidget->getWidth() / 2), (size.height - mMainWidget->getHeight()) / 2);
	}
Пример #6
0
Kylin::KitbagMenu::KitbagMenu()
: GuiBase(CLASS_TO(KitbagMenu))
, m_pKitbagListener(NULL)
{
	initialiseByAttributes(this);

	m_pItemTips = KNEW TipsMenu();
	m_pItemTips->Hide();
}
LoadingWindow::LoadingWindow()
{
    initialiseByAttributes(this);

    MyGUI::IntSize gui_area = MyGUI::RenderManager::getInstance().getViewSize();
    mMainWidget->setPosition(gui_area.width / 2 - mMainWidget->getWidth() / 2, gui_area.height / 2 - mMainWidget->getHeight() / 2);
    ((MyGUI::Window*)mMainWidget)->setCaption(_L("Loading ..."));
    t = new Ogre::Timer();
    mMainWidget->setVisible(false);
}
Пример #8
0
	_3dsFileDialog::_3dsFileDialog()
	{
		setResourceGroup(ResourceGroup::MESHES);
		
		Filter filter;
		filter.setDescription("#{3dsMeshes}");
		filter.addPattern("*.3ds");
		filter.setDefaultExt(".3ds");
		addFilter(filter);

		initialiseByAttributes(this);
	}
Пример #9
0
	KeyboardPanel::KeyboardPanel()
	{
		initialiseByAttributes(this);

		mMainWidget->setPosition(0, 0);

		mButtonEngine->eventMouseButtonClick += MyGUI::newDelegate(this, &KeyboardPanel::notifyMouseButtonClick);
		mButtonGun->eventMouseButtonClick += MyGUI::newDelegate(this, &KeyboardPanel::notifyMouseButtonClick);
		mButtonAmmo->eventMouseButtonClick += MyGUI::newDelegate(this, &KeyboardPanel::notifyMouseButtonClick);
		mButtonArmor->eventMouseButtonClick += MyGUI::newDelegate(this, &KeyboardPanel::notifyMouseButtonClick);

		CommandManager::getInstance().execiteCommand("KeyboardClick", std::string(mMainWidget->getUserString("Command")));
	}
Пример #10
0
	//---------------------------------------------------------------------------
	WorldViewWindow::WorldViewWindow(World* _world)
		: mRenderTarget(nullptr), mWorld(nullptr), 
		  mCamera(nullptr), mViewport(nullptr), 
		  mClosing(false)
	{
		mWorld = _world;
		mWorldName = mWorld->getName();	
		
		initialiseByAttributes(this);

		// Read the window's coordinates from the configuration file worldedit.cfg
		WorldEditSettings& wes = WorldEditSettings::getSingleton();
		if(wes.hasSection(mWorldName))
		{
			MyGUI::FloatCoord fcoord;
			fcoord.left   = wes.getSetting<float>("WindowLeft",   mWorldName, 0.1f);
			fcoord.top    = wes.getSetting<float>("WindowTop",    mWorldName, 0.1f);
			fcoord.width  = wes.getSetting<float>("WindowWidth",  mWorldName, 0.5f);
			fcoord.height = wes.getSetting<float>("WindowHeight", mWorldName, 0.5f);
			setCoord(fcoord);
		}
		else
		{
			static int sWindowIndex = 0;
			MyGUI::FloatPoint newWindowOffset = MyGUI::FloatPoint::parse(getWindow()->getUserString("NewWindowOffset"));
			MyGUI::FloatCoord fcoord = getCoord();
			fcoord.left += newWindowOffset.left * sWindowIndex;
			fcoord.top  += newWindowOffset.top * sWindowIndex;
			sWindowIndex++;
			if(fcoord.left < 1.0f && fcoord.top < 1.0f)
			{
				fcoord.width  = std::min(fcoord.left + fcoord.width,  1.0f) - fcoord.left;
				fcoord.height = std::min(fcoord.top  + fcoord.height, 1.0f) - fcoord.top;
				setCoord(fcoord);
			}
		}
		
		getWindow()->eventKeySetFocus += MyGUI::newDelegate(this, &WorldViewWindow::notifyKeySetFocus);
		
		// TRM_PT_VIEW_ALL
		mCanvas->createTexture(MyGUI::Canvas::TRM_PT_VIEW_ALL, MyGUI::TextureUsage::RenderTarget);
		mCanvas->eventPreTextureChanges += MyGUI::newDelegate(this, &WorldViewWindow::notifyPreTextureChanges);
		mCanvas->requestUpdateCanvas = MyGUI::newDelegate(this, &WorldViewWindow::requestUpdateCanvas);
		mCanvas->updateTexture();

		updateCaption();
		updateViewportAbsCoord();

		registerWorldListener();
		registerWorldObjectListener();
	}
Пример #11
0
	BerkeliumBrowser::BerkeliumBrowser(MyGUI::Widget* _parent) :
		mWebPageBerkeliumWidget(nullptr),
		mUrlEditBox(nullptr),
		mBackButton(nullptr),
		mForwardButton(nullptr),
		mLoadingProgressBar(nullptr)
	{
		initialiseByAttributes(this, _parent);

		mWebPageBerkeliumWidget->getBerkeliumWindow()->setTransparent(true);
		mUrlEditBox->eventEditSelectAccept += MyGUI::newDelegate(this, &BerkeliumBrowser::notifyEditSelectAccept);
		mBackButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BerkeliumBrowser::notifyBackButtonClick);
		mForwardButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BerkeliumBrowser::notifyForwardButtonClick);

		mWebPageBerkeliumWidget->setWindowDelegate(this);
	}
Пример #12
0
	ColourPanel::ColourPanel() :
		Dialog(),
		mAlphaSupport(true)
	{
		initialiseByAttributes(this);
		mTextureName = MyGUI::utility::toString((size_t)this, "_ColourGradient");

		mCurrentColour = MyGUI::Colour::Green;
		mBaseColour = MyGUI::Colour::Green;

		mColourRect->eventMouseButtonPressed += MyGUI::newDelegate(this, &ColourPanel::notifyMouseButtonPressed);
		mColourRect->eventMouseDrag += MyGUI::newDelegate(this, &ColourPanel::notifyMouseDrag);
		mImageColourPicker->eventMouseDrag += MyGUI::newDelegate(this, &ColourPanel::notifyMouseDrag);
		mScrollRange->eventScrollChangePosition += MyGUI::newDelegate(this, &ColourPanel::notifyScrollChangePosition);
		mAlphaSlider->eventScrollChangePosition += MyGUI::newDelegate(this, &ColourPanel::notifyScrollChangePositionAlpha);

		mEditRed->eventEditTextChange += MyGUI::newDelegate(this, &ColourPanel::notifyEditTextChange);
		mEditGreen->eventEditTextChange += MyGUI::newDelegate(this, &ColourPanel::notifyEditTextChange);
		mEditBlue->eventEditTextChange += MyGUI::newDelegate(this, &ColourPanel::notifyEditTextChange);
		mInputAlpha->eventEditTextChange += MyGUI::newDelegate(this, &ColourPanel::notifyEditTextChangeAlpha);

		mOk->eventMouseButtonClick += MyGUI::newDelegate(this, &ColourPanel::notifyMouseButtonClickOk);
		mCancel->eventMouseButtonClick += MyGUI::newDelegate(this, &ColourPanel::notifyMouseButtonClickCancel);

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

		mColourRange.push_back(MyGUI::Colour(1, 0, 0));
		mColourRange.push_back(MyGUI::Colour(1, 0, 1));
		mColourRange.push_back(MyGUI::Colour(0, 0, 1));
		mColourRange.push_back(MyGUI::Colour(0, 1, 1));
		mColourRange.push_back(MyGUI::Colour(0, 1, 0));
		mColourRange.push_back(MyGUI::Colour(1, 1, 0));
		mColourRange.push_back(mColourRange[0]);

		mMainWidget->setVisible(false);

		createTexture();

		updateFirst();
	}
Пример #13
0
	TextureBrowseControl::TextureBrowseControl() :
		Dialog(),
		mTextures(nullptr)
	{
		initialiseByAttributes(this);

		assignBase(mTextures, "Textures");

		mOk->eventMouseButtonClick += MyGUI::newDelegate(this, &TextureBrowseControl::notifyMouseButtonClickOk);
		mCancel->eventMouseButtonClick += MyGUI::newDelegate(this, &TextureBrowseControl::notifyMouseButtonClickCancel);

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

		MyGUI::ItemBox* box = mTextures->getItemBox();
		box->eventChangeItemPosition += MyGUI::newDelegate(this, &TextureBrowseControl::notifyChangeItemPosition);

		mMainWidget->setVisible(false);
	}
Пример #14
0
	ShopPanel::ShopPanel(MyGUI::Widget* _parent)
	{
		initialiseByAttributes(this, _parent);
		this->mclose_buttonButton->eventMouseButtonClick += MyGUI::newDelegate(this, &ShopPanel::mclose_eventMouseButtonClick);
	}
Пример #15
0
	TooltipItem::TooltipItem(MyGUI::Widget* _parent)
	{
		initialiseByAttributes(this, _parent);
	}
Пример #16
0
LoginPanel::LoginPanel(MyGUI::Widget* _parent)
{
	initialiseByAttributes(this, _parent);
	this->mmu_Ok_Button->eventMouseButtonClick += MyGUI::newDelegate(this, &LoginPanel::mmu_Ok_Button_click);
}