wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src/widgets textbox.cpp


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth/src/widgets textbox.cpp
Date: Mon, 30 May 2005 17:48:29 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    05/05/30 21:48:28

Modified files:
        src/widgets    : textbox.cpp 

Log message:
        fixed textbox not showing cursor when it's moved

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/textbox.cpp.diff?tr1=1.79&tr2=1.80&r1=text&r2=text

Patches:
Index: wesnoth/src/widgets/textbox.cpp
diff -u wesnoth/src/widgets/textbox.cpp:1.79 
wesnoth/src/widgets/textbox.cpp:1.80
--- wesnoth/src/widgets/textbox.cpp:1.79        Mon May 30 04:41:52 2005
+++ wesnoth/src/widgets/textbox.cpp     Mon May 30 21:48:27 2005
@@ -1,4 +1,4 @@
-/* $Id: textbox.cpp,v 1.79 2005/05/30 04:41:52 Sirp Exp $ */
+/* $Id: textbox.cpp,v 1.80 2005/05/30 21:48:27 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -350,7 +350,10 @@
        scrollarea::handle_event(event);
 
        bool changed = false;
-       
+
+       const int old_selstart = selstart_;
+       const int old_selend = selend_;
+
        //Sanity check: verify that selection start and end are within text
        //boundaries
        if(is_selection() && !(size_t(selstart_) <= text_.size() && 
size_t(selend_) <= text_.size())) {
@@ -426,7 +429,7 @@
        const SDLMod modifiers = SDL_GetModState();
        
        const int c = key.sym;
-       int old_cursor = cursor_;
+       const int old_cursor = cursor_;
        
        if(c == SDLK_LEFT && cursor_ > 0) 
                --cursor_;
@@ -545,7 +548,7 @@
        show_cursor_ = true;
        show_cursor_at_ = SDL_GetTicks();
 
-       if(changed) {
+       if(changed || old_cursor != cursor_ || old_selstart != selstart_ || 
old_selend != selend_) {
                text_image_ = NULL;
        }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]