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

Method OnInitialise

Tools/EditorFramework/ColourPanel.cpp:19–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 }
18
19 void ColourPanel::OnInitialise(Control* _parent, MyGUI::Widget* _place, std::string_view /*_layoutName*/)
20 {
21 Control::OnInitialise(_parent, _place, GetLayoutName(this));
22
23 InitialiseByAttributes(this);
24
25 setDialogRoot(mMainWidget);
26
27 mTextureName = MyGUI::utility::toString((size_t)this, "_ColourGradient");
28
29 mCurrentColour = MyGUI::Colour::Green;
30 mBaseColour = MyGUI::Colour::Green;
31
32 mColourRect->eventMouseButtonPressed += MyGUI::newDelegate(this, &ColourPanel::notifyMouseButtonPressed);
33 mColourRect->eventMouseDrag += MyGUI::newDelegate(this, &ColourPanel::notifyMouseDrag);
34 mImageColourPicker->eventMouseDrag += MyGUI::newDelegate(this, &ColourPanel::notifyMouseDrag);
35 mScrollRange->eventScrollChangePosition += MyGUI::newDelegate(this, &ColourPanel::notifyScrollChangePosition);
36 mAlphaSlider->eventScrollChangePosition +=
37 MyGUI::newDelegate(this, &ColourPanel::notifyScrollChangePositionAlpha);
38
39 mEditRed->eventEditTextChange += MyGUI::newDelegate(this, &ColourPanel::notifyEditTextChange);
40 mEditGreen->eventEditTextChange += MyGUI::newDelegate(this, &ColourPanel::notifyEditTextChange);
41 mEditBlue->eventEditTextChange += MyGUI::newDelegate(this, &ColourPanel::notifyEditTextChange);
42 mInputAlpha->eventEditTextChange += MyGUI::newDelegate(this, &ColourPanel::notifyEditTextChangeAlpha);
43
44 CommandManager::getInstance().getEvent("Command_ColorAccept")->connect(this, &ColourPanel::commandColorAccept);
45 CommandManager::getInstance().getEvent("Command_ColorCancel")->connect(this, &ColourPanel::commandColorCancel);
46
47 mColourRange.emplace_back(1, 0, 0);
48 mColourRange.emplace_back(1, 0, 1);
49 mColourRange.emplace_back(0, 0, 1);
50 mColourRange.emplace_back(0, 1, 1);
51 mColourRange.emplace_back(0, 1, 0);
52 mColourRange.emplace_back(1, 1, 0);
53 mColourRange.push_back(mColourRange[0]);
54
55 mMainWidget->setVisible(false);
56
57 createTexture();
58
59 updateFirst();
60 }
61
62 void ColourPanel::updateFirst()
63 {

Callers

nothing calls this directly

Calls 7

InitialiseByAttributesFunction · 0.85
toStringFunction · 0.85
newDelegateFunction · 0.85
connectMethod · 0.45
getEventMethod · 0.45
push_backMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected