| 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 | { |
nothing calls this directly
no test coverage detected