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

Method notifyEditTextChange

Demos/Demo_Colour/ColourPanel.cpp:186–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184 }
185
186 void ColourPanel::notifyEditTextChange(MyGUI::EditBox* _sender)
187 {
188 MyGUI::EditBox* edit = static_cast<MyGUI::EditBox*>(_sender);
189 size_t cursor = edit->getTextCursor();
190 size_t num = MyGUI::utility::parseSizeT(edit->getOnlyText());
191 if (num > 255)
192 num = 255;
193 edit->setCaption(MyGUI::utility::toString(num));
194 if (cursor < edit->getTextLength())
195 edit->setTextCursor(cursor);
196
197 MyGUI::Colour colour(
198 MyGUI::utility::parseFloat(mEditRed->getOnlyText()) / 255.0f,
199 MyGUI::utility::parseFloat(mEditGreen->getOnlyText()) / 255.0f,
200 MyGUI::utility::parseFloat(mEditBlue->getOnlyText()) / 255.0f);
201
202 updateFromColour(colour);
203 }
204
205 void ColourPanel::setColour(const MyGUI::Colour& _colour)
206 {

Callers

nothing calls this directly

Calls 8

parseSizeTFunction · 0.85
toStringFunction · 0.85
parseFloatFunction · 0.85
getTextCursorMethod · 0.80
setTextCursorMethod · 0.80
getOnlyTextMethod · 0.45
setCaptionMethod · 0.45
getTextLengthMethod · 0.45

Tested by

no test coverage detected