aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-22 21:04:45 +0000
committerMartin Kiewitz2009-10-22 21:04:45 +0000
commit4095d92a5e6ff7a114d7e175fc66c693de4ef5cb (patch)
treec27a154fce93658089119eb12c811b9f91358a9c
parent42068f58537c988173d4c1e018ea9a7819f13db4 (diff)
downloadscummvm-rg350-4095d92a5e6ff7a114d7e175fc66c693de4ef5cb.tar.gz
scummvm-rg350-4095d92a5e6ff7a114d7e175fc66c693de4ef5cb.tar.bz2
scummvm-rg350-4095d92a5e6ff7a114d7e175fc66c693de4ef5cb.zip
SCI/newgui: make cursor left work in textedit control. some wip changes, because i need to backlevel
svn-id: r45340
-rw-r--r--engines/sci/gui/gui_gfx.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index f2de19f9b1..b455c3832c 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -835,6 +835,7 @@ void SciGuiGfx::TexteditChange(reg_t controlObject, reg_t eventObject) {
Common::String text;
uint16 textSize, eventType, eventKey;
bool textChanged = false;
+ Common::Rect rect;
if (textReference.isNull())
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) {
cursorPos--; textChanged = true;
}
+ break;
case SCI_K_RIGHT: // RIGHT
if (cursorPos + 1 <= textSize) {
cursorPos++; textChanged = true;
@@ -879,6 +881,8 @@ void SciGuiGfx::TexteditChange(reg_t controlObject, reg_t eventObject) {
default:
if (eventKey > 31 && eventKey < 256 && textSize < maxChars) {
// insert pressed character
+ // we check, if there is space left for this character
+
text.insertChar(eventKey, cursorPos++);
textChanged = true;
}
@@ -891,7 +895,6 @@ void SciGuiGfx::TexteditChange(reg_t controlObject, reg_t eventObject) {
if (textChanged) {
GuiResourceId oldFontId = GetFontId();
GuiResourceId fontId = GET_SEL32V(segMan, controlObject, font);
- Common::Rect rect;
rect = Common::Rect(GET_SEL32V(segMan, controlObject, nsLeft), GET_SEL32V(segMan, controlObject, nsTop),
GET_SEL32V(segMan, controlObject, nsRight), GET_SEL32V(segMan, controlObject, nsBottom));
TexteditCursorErase();