mail[Wesnoth-commits] r40295 - in /trunk/src/gui/widgets: listbox.cpp listbox.hpp


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

Header


Content

Posted by koraq on December 20, 2009 - 16:55:
Author: mordante
Date: Sun Dec 20 16:55:24 2009
New Revision: 40295

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40295&view=rev
Log:
Add set_row_visible function to the listbox.

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

Modified: trunk/src/gui/widgets/listbox.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/listbox.cpp?rev=40295&r1=40294&r2=40295&view=diff
==============================================================================
--- trunk/src/gui/widgets/listbox.cpp (original)
+++ trunk/src/gui/widgets/listbox.cpp Sun Dec 20 16:55:24 2009
@@ -89,6 +89,14 @@
 {
        assert(generator_);
        generator_->get_item(row).set_active(active);
+}
+
+void tlistbox::set_row_visible(const unsigned row, const bool visible)
+{
+       assert(generator_);
+       generator_->set_item_shown(row, visible);
+       content_resize_request();
+       set_dirty();
 }
 
 const tgrid* tlistbox::get_row_grid(const unsigned row) const

Modified: trunk/src/gui/widgets/listbox.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/listbox.hpp?rev=40295&r1=40294&r2=40295&view=diff
==============================================================================
--- trunk/src/gui/widgets/listbox.hpp (original)
+++ trunk/src/gui/widgets/listbox.hpp Sun Dec 20 16:55:24 2009
@@ -98,6 +98,20 @@
         * @param active              true activate, false deactivate.
         */
        void set_row_active(const unsigned row, const bool active);
+
+       /**
+        * Makes a row visible or invisible.
+        *
+        * @todo maybe change the name to show row due to the fact that it's
+        * different from the twidget::tvisible the row is only visible or
+        * invisible not hidden.
+        *
+        * show_row(row, show)
+        *
+        * @param row                 The row to show or hide.
+        * @param visible             true visible, false invisible.
+        */
+       void set_row_visible(const unsigned row, const bool visible);
 
        /**
         * Returns the grid of the wanted row.




Related Messages


Powered by MHonArc, Updated Sun Dec 20 17:00:18 2009