mail[Wesnoth-commits] r40309 - /trunk/src/gui/widgets/listbox.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on December 20, 2009 - 20:35:
Author: mordante
Date: Sun Dec 20 20:35:16 2009
New Revision: 40309

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40309&view=rev
Log:
Let set_row_visible call the selection update.

When the selection changes due to hiding rows the callback for a changed
value should also be called.

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=40309&r1=40308&r2=40309&view=diff
==============================================================================
--- trunk/src/gui/widgets/listbox.cpp (original)
+++ trunk/src/gui/widgets/listbox.cpp Sun Dec 20 20:35:16 2009
@@ -98,6 +98,8 @@
        twindow *window = get_window();
        assert(window);
 
+       const int selected_row = get_selected_row();
+
        bool resize_needed;
        {
                twindow::tinvalidate_layout_blocker 
invalidate_layout_blocker(*window);
@@ -110,6 +112,10 @@
                window->invalidate_layout();
        } else {
                set_dirty();
+       }
+
+       if(selected_row != get_selected_row() && callback_value_changed_) {
+               callback_value_changed_(this);
        }
 }
 




Related Messages


Powered by MHonArc, Updated Sun Dec 20 22:00:10 2009