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

Method setTextSelection

MyGUIEngine/src/MyGUI_EditBox.cpp:928–954  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

926 }
927
928 void EditBox::setTextSelection(size_t _start, size_t _end)
929 {
930 if (_start > mTextLength)
931 _start = mTextLength;
932 if (_end > mTextLength)
933 _end = mTextLength;
934
935 mStartSelect = _start;
936 mEndSelect = _end;
937
938 if (mClientText != nullptr)
939 {
940 if (mStartSelect > mEndSelect)
941 mClientText->setTextSelection(mEndSelect, mStartSelect);
942 else
943 mClientText->setTextSelection(mStartSelect, mEndSelect);
944 }
945
946 if (mCursorPosition == mEndSelect)
947 return;
948 // курсор на конец выделения
949 mCursorPosition = mEndSelect;
950
951 // обновляем по позиции
952 if (mClientText != nullptr)
953 mClientText->setCursorPosition(mCursorPosition);
954 }
955
956 bool EditBox::deleteTextSelect(bool _history)
957 {

Callers 11

notifyButtonPressedMethod · 0.45
addToConsoleMethod · 0.45
notifyMouseDragMethod · 0.45
frameEnteredMethod · 0.45
resetSelectMethod · 0.45
updateSelectTextMethod · 0.45
setTextSelectMethod · 0.45
onDoModalMethod · 0.45

Calls 1

setCursorPositionMethod · 0.80

Tested by

no test coverage detected