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/menu.cpp src/widgets/textbo...


From: ott
Subject: [Wesnoth-cvs-commits] wesnoth src/widgets/menu.cpp src/widgets/textbo...
Date: Wed, 20 Apr 2005 13:27:39 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     ott <address@hidden>    05/04/20 17:27:39

Modified files:
        src/widgets    : menu.cpp textbox.cpp 
        .              : changelog 

Log message:
        Home/End support in menus; in textboxes support Ctrl-a/e/u but ignore 
PgUp/PgDn

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/menu.cpp.diff?tr1=1.86&tr2=1.87&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/textbox.cpp.diff?tr1=1.75&tr2=1.76&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/changelog.diff?tr1=1.605&tr2=1.606&r1=text&r2=text

Patches:
Index: wesnoth/changelog
diff -u wesnoth/changelog:1.605 wesnoth/changelog:1.606
--- wesnoth/changelog:1.605     Mon Apr 18 18:53:06 2005
+++ wesnoth/changelog   Wed Apr 20 17:27:39 2005
@@ -43,7 +43,8 @@
  * fixed bug #12611: modifying villages with [terrain] interacting badly with 
capturing them.
  * fixed user-campaigns not being translatable anymore
  * fixed the formatting of wrapped text lines being lost
- 
+ * added support for Home/End in menus, ctrl-a/e/u in textboxes
+
 Version 0.9.0:
  * user interface improvements:
    * added alternative theme: DFool
Index: wesnoth/src/widgets/menu.cpp
diff -u wesnoth/src/widgets/menu.cpp:1.86 wesnoth/src/widgets/menu.cpp:1.87
--- wesnoth/src/widgets/menu.cpp:1.86   Wed Mar 23 21:30:46 2005
+++ wesnoth/src/widgets/menu.cpp        Wed Apr 20 17:27:39 2005
@@ -235,6 +235,12 @@
                case SDLK_PAGEDOWN:
                        move_selection_down(max_items_onscreen());
                        break;
+               case SDLK_HOME:
+                       move_selection(0);
+                       break;
+               case SDLK_END:
+                       move_selection(items_.size() - 1);
+                       break;
                //case SDLK_RETURN:
                //      double_clicked_ = true;
                //      break;
Index: wesnoth/src/widgets/textbox.cpp
diff -u wesnoth/src/widgets/textbox.cpp:1.75 
wesnoth/src/widgets/textbox.cpp:1.76
--- wesnoth/src/widgets/textbox.cpp:1.75        Sat Mar 26 17:10:32 2005
+++ wesnoth/src/widgets/textbox.cpp     Wed Apr 20 17:27:39 2005
@@ -1,4 +1,4 @@
-/* $Id: textbox.cpp,v 1.75 2005/03/26 17:10:32 silene Exp $ */
+/* $Id: textbox.cpp,v 1.76 2005/04/20 17:27:39 ott Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -421,10 +421,10 @@
        if(c == SDLK_RIGHT && cursor_ < text_.size())
                ++cursor_;
 
-       if(c == SDLK_END)
+       if(c == SDLK_END || (c == SDLK_e && (modifiers & KMOD_CTRL)))
                cursor_ = text_.size();
        
-       if(c == SDLK_HOME)
+       if(c == SDLK_HOME || (c == SDLK_a && (modifiers & KMOD_CTRL)))
                cursor_ = 0;
 
        if((old_cursor != cursor_) && (modifiers & KMOD_SHIFT)) {
@@ -443,6 +443,12 @@
                }
        }
 
+       if(c == SDLK_u && (modifiers & KMOD_CTRL)) {
+               changed = true;
+               cursor_ = 0;
+               text_.resize(0);
+       }
+
        if(c == SDLK_DELETE && !text_.empty()) {
                changed = true;
                if(is_selection()) {
@@ -461,7 +467,8 @@
 
        //movement characters may have a "Unicode" field on some platforms, so 
ignore it.
        if(!(c == SDLK_UP || c == SDLK_DOWN || c == SDLK_LEFT || c == 
SDLK_RIGHT ||
-          c == SDLK_DELETE || c == SDLK_BACKSPACE || c == SDLK_END || c == 
SDLK_HOME)) {
+          c == SDLK_DELETE || c == SDLK_BACKSPACE || c == SDLK_END || c == 
SDLK_HOME ||
+          c == SDLK_PAGEUP || c == SDLK_PAGEDOWN)) {
                if(character != 0)
                        LOG_STREAM(info, display) << "Char: " << character << 
", c = " << c << "\n";
        




reply via email to

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