Author: mordante
Date: Tue Sep  2 20:04:35 2008
New Revision: 29205

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29205&view=rev
Log:
Call change callback upon keyboard actions.

When changing the selection with the keyboard also call the change
callback. Also remove a now obsolete todo item.

Modified:
    trunk/src/gui/widgets/listbox.cpp

Modified: trunk/src/gui/widgets/listbox.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/listbox.cpp?rev=29205&r1=29204&r2=29205&view=diff
==============================================================================
--- trunk/src/gui/widgets/listbox.cpp (original)
+++ trunk/src/gui/widgets/listbox.cpp Tue Sep  2 20:04:35 2008
@@ -256,12 +256,6 @@
 {
        DBG_G_E << "Listbox: key press.\n";
 
-       /** 
-        * @todo Proof of concept only handles up and down and not too elegant.
-        * Ignores the modifiers and also whether or not rows are active.  When
-        * moving out of visible range we don't scroll down and possibly more 
minor
-        * glitches exist in this hack.
-        */
        tscrollbar_* sb = scrollbar();
        int row = get_selected_row();
        switch(key) {
@@ -286,6 +280,9 @@
                                if(row < sb->get_item_position()) {
                                        sb->set_item_position(row);
                                        set_scrollbar_button_status();
+                               }
+                               if(callback_value_change_) {
+                                       callback_value_change_(this);
                                }
                        }
                        break;
@@ -310,6 +307,9 @@
 
                                        sb->set_item_position(row + 1 - 
sb->get_visible_items());
                                        set_scrollbar_button_status();
+                               }
+                               if(callback_value_change_) {
+                                       callback_value_change_(this);
                                }
                        }
                        break;


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to