mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-10 04:43:26 +00:00
SCI/newgui: make cursor left work in textedit control. some wip changes, because i need to backlevel
svn-id: r45340
This commit is contained in:
parent
42068f5853
commit
4095d92a5e
@ -835,6 +835,7 @@ void SciGuiGfx::TexteditChange(reg_t controlObject, reg_t eventObject) {
|
|||||||
Common::String text;
|
Common::String text;
|
||||||
uint16 textSize, eventType, eventKey;
|
uint16 textSize, eventType, eventKey;
|
||||||
bool textChanged = false;
|
bool textChanged = false;
|
||||||
|
Common::Rect rect;
|
||||||
|
|
||||||
if (textReference.isNull())
|
if (textReference.isNull())
|
||||||
error("kEditControl called on object that doesnt have a text reference");
|
error("kEditControl called on object that doesnt have a text reference");
|
||||||
@ -871,6 +872,7 @@ void SciGuiGfx::TexteditChange(reg_t controlObject, reg_t eventObject) {
|
|||||||
if (cursorPos > 0) {
|
if (cursorPos > 0) {
|
||||||
cursorPos--; textChanged = true;
|
cursorPos--; textChanged = true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case SCI_K_RIGHT: // RIGHT
|
case SCI_K_RIGHT: // RIGHT
|
||||||
if (cursorPos + 1 <= textSize) {
|
if (cursorPos + 1 <= textSize) {
|
||||||
cursorPos++; textChanged = true;
|
cursorPos++; textChanged = true;
|
||||||
@ -879,6 +881,8 @@ void SciGuiGfx::TexteditChange(reg_t controlObject, reg_t eventObject) {
|
|||||||
default:
|
default:
|
||||||
if (eventKey > 31 && eventKey < 256 && textSize < maxChars) {
|
if (eventKey > 31 && eventKey < 256 && textSize < maxChars) {
|
||||||
// insert pressed character
|
// insert pressed character
|
||||||
|
// we check, if there is space left for this character
|
||||||
|
|
||||||
text.insertChar(eventKey, cursorPos++);
|
text.insertChar(eventKey, cursorPos++);
|
||||||
textChanged = true;
|
textChanged = true;
|
||||||
}
|
}
|
||||||
@ -891,7 +895,6 @@ void SciGuiGfx::TexteditChange(reg_t controlObject, reg_t eventObject) {
|
|||||||
if (textChanged) {
|
if (textChanged) {
|
||||||
GuiResourceId oldFontId = GetFontId();
|
GuiResourceId oldFontId = GetFontId();
|
||||||
GuiResourceId fontId = GET_SEL32V(segMan, controlObject, font);
|
GuiResourceId fontId = GET_SEL32V(segMan, controlObject, font);
|
||||||
Common::Rect rect;
|
|
||||||
rect = Common::Rect(GET_SEL32V(segMan, controlObject, nsLeft), GET_SEL32V(segMan, controlObject, nsTop),
|
rect = Common::Rect(GET_SEL32V(segMan, controlObject, nsLeft), GET_SEL32V(segMan, controlObject, nsTop),
|
||||||
GET_SEL32V(segMan, controlObject, nsRight), GET_SEL32V(segMan, controlObject, nsBottom));
|
GET_SEL32V(segMan, controlObject, nsRight), GET_SEL32V(segMan, controlObject, nsBottom));
|
||||||
TexteditCursorErase();
|
TexteditCursorErase();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user