| 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 | { |
no test coverage detected