I think the GUI elements can (and probably will) be improved in many ways. I just quickly fixed the selection behaviour of the EditBox. It had 2 problems.
1. Selecting backwards with SHIFT-LEFT would not work as expected. It is selecting characters to the right of the cursor instead of to the left (and thus is not the opposite of SHIFT-RIGHT).
2. It is not checking the bounds of the text. You are able to select an invisible non-existing character at the end (making MarkEnd>MarkBegin without actual selected text). It has no effect so far but might produce bugs in future.
CGUIEditBox.cpp line 239:
Change:
Code: Select all
case KEY_LEFT:
if (event.KeyInput.Shift)
{
if (MarkBegin == MarkEnd)
MarkBegin = CursorPos+1;
MarkEnd = CursorPos;
}
Code: Select all
case KEY_LEFT:
if (event.KeyInput.Shift)
{
if (CursorPos > 0) {
if (MarkBegin == MarkEnd)
MarkBegin = CursorPos;
MarkEnd = CursorPos-1;
}
}
Code: Select all
case KEY_RIGHT:
if (event.KeyInput.Shift)
{
if (MarkBegin == MarkEnd)
MarkBegin = CursorPos;
MarkEnd = CursorPos+1;
}
Code: Select all
case KEY_RIGHT:
if (event.KeyInput.Shift)
{
if (Text.size() > CursorPos) {
if (MarkBegin == MarkEnd)
MarkBegin = CursorPos;
MarkEnd = CursorPos+1;
}
}
jox