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

Method createSkin

Tools/SkinEditor/TestWindow.cpp:67–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 void TestWindow::createSkin()
68 {
69 if (mSkinItem == nullptr)
70 return;
71
72 MyGUI::IntSize canvasSize = mBackgroundControl->getCanvas()->getSize();
73
74 generateSkin();
75
76 mSkinButton = mBackgroundControl->getCanvas()->createWidget<MyGUI::Button>(
77 mSkinName,
78 MyGUI::IntCoord(0, 0, canvasSize.width, canvasSize.height),
79 MyGUI::Align::Stretch);
80 mSkinButton->setFontName(mDefaultFontName);
81 mSkinButton->setTextAlign(MyGUI::Align::Center);
82 mSkinButton->setCaption("Caption");
83 mSkinButton->eventMouseButtonPressed += MyGUI::newDelegate(this, &TestWindow::notifyMouseButtonPressed);
84
85 MyGUI::IntCoord coord = mSkinItem->getPropertyValue<MyGUI::IntCoord>("Size");
86 MyGUI::IntSize windowSize = coord.size() + mMainWidget->getSize() - canvasSize;
87 MyGUI::IntSize parentSize = mMainWidget->getParentSize();
88
89 mMainWidget->setCoord(
90 (parentSize.width - windowSize.width) / 2,
91 (parentSize.height - windowSize.height) / 2,
92 windowSize.width,
93 windowSize.height);
94 }
95
96 void TestWindow::deleteSkin()
97 {

Callers

nothing calls this directly

Calls 10

newDelegateFunction · 0.85
getCanvasMethod · 0.80
getParentSizeMethod · 0.80
IntCoordFunction · 0.50
getSizeMethod · 0.45
setFontNameMethod · 0.45
setTextAlignMethod · 0.45
setCaptionMethod · 0.45
sizeMethod · 0.45
setCoordMethod · 0.45

Tested by

no test coverage detected