[Scummvm-cvs-logs] SF.net SVN: scummvm:[45340] scummvm/trunk/engines/sci/gui/gui_gfx.cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Thu Oct 22 23:04:46 CEST 2009


Revision: 45340
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45340&view=rev
Author:   m_kiewitz
Date:     2009-10-22 21:04:45 +0000 (Thu, 22 Oct 2009)

Log Message:
-----------
SCI/newgui: make cursor left work in textedit control. some wip changes, because i need to backlevel

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui_gfx.cpp

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-22 19:48:20 UTC (rev 45339)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-22 21:04:45 UTC (rev 45340)
@@ -835,6 +835,7 @@
 	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 @@
 				if (cursorPos > 0) {
 					cursorPos--; textChanged = true;
 				}
+				break;
 			case SCI_K_RIGHT: // RIGHT
 				if (cursorPos + 1 <= textSize) {
 					cursorPos++; textChanged = true;
@@ -879,6 +881,8 @@
 			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 @@
 	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();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list