MCPcopy Create free account
hub / github.com/MyGUI/mygui / ColourWindow

Method ColourWindow

Demos/Demo_Gui/ColourWindow.cpp:25–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 }
24
25 ColourWindow::ColourWindow(MyGUI::Widget* _parent) :
26 BaseLayout("ColourWindow.layout", _parent)
27 {
28 assignWidget(mSliderRed, "Red");
29 assignWidget(mSliderGreen, "Green");
30 assignWidget(mSliderBlue, "Blue");
31 assignWidget(mColour, "Colour");
32 assignWidget(mAdd, "Add");
33 assignWidget(mLine, "Line");
34 assignBase(mBox, "Box");
35
36 mSliderRed->eventScrollChangePosition += MyGUI::newDelegate(this, &ColourWindow::notifyScrollChangePosition);
37 mSliderGreen->eventScrollChangePosition += MyGUI::newDelegate(this, &ColourWindow::notifyScrollChangePosition);
38 mSliderBlue->eventScrollChangePosition += MyGUI::newDelegate(this, &ColourWindow::notifyScrollChangePosition);
39
40 mAdd->eventMouseButtonClick += MyGUI::newDelegate(this, &ColourWindow::notifyMouseButtonClick);
41 mLine->eventEditSelectAccept += MyGUI::newDelegate(this, &ColourWindow::notifyEditSelectAccept);
42
43 if (_parent)
44 {
45 const MyGUI::IntCoord& coord = _parent->getClientCoord();
46 const MyGUI::IntSize& size = mMainWidget->getSize();
47 mMainWidget->setPosition(
48 MyGUI::IntPoint(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height)));
49 }
50
51 // update
52 notifyScrollChangePosition(nullptr, 0);
53 }
54
55 void ColourWindow::notifyScrollChangePosition(MyGUI::ScrollBar* _sender, size_t _position)
56 {

Callers

nothing calls this directly

Calls 7

assignWidgetFunction · 0.85
newDelegateFunction · 0.85
getRandFunction · 0.85
getClientCoordMethod · 0.80
IntPointFunction · 0.50
getSizeMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected