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

Method notifyEditTextChange

Tools/EditorFramework/ColourPanel.cpp:202–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200 }
201
202 void ColourPanel::notifyEditTextChange(MyGUI::EditBox* _sender)
203 {
204 MyGUI::EditBox* edit = static_cast<MyGUI::EditBox*>(_sender);
205 size_t cursor = edit->getTextCursor();
206 size_t num = MyGUI::utility::parseSizeT(edit->getOnlyText());
207 if (num > 255)
208 num = 255;
209 edit->setCaption(MyGUI::utility::toString(num));
210 if (cursor < edit->getTextLength())
211 edit->setTextCursor(cursor);
212
213 MyGUI::Colour colour(
214 MyGUI::utility::parseFloat(mEditRed->getOnlyText()) / 255.0f,
215 MyGUI::utility::parseFloat(mEditGreen->getOnlyText()) / 255.0f,
216 MyGUI::utility::parseFloat(mEditBlue->getOnlyText()) / 255.0f);
217
218 updateFromColour(colour);
219 }
220
221 void ColourPanel::setColour(const MyGUI::Colour& _colour)
222 {

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