Author: mordante
Date: Sun May 18 09:47:39 2008
New Revision: 26685
URL: http://svn.gna.org/viewcvs/wesnoth?rev=26685&view=rev
Log:
Add tlistbox::set_row_active() so we can activate and deactive a row in a
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=26685&r1=26684&r2=26685&view=diff
==============================================================================
--- trunk/src/gui/widgets/listbox.cpp (original)
+++ trunk/src/gui/widgets/listbox.cpp Sun May 18 09:47:39 2008
@@ -505,6 +505,13 @@
return true;
}
+void tlistbox::set_row_active(const unsigned row, const bool active)
+{
+ assert(row < get_item_count());
+ assert(rows_[row].grid());
+ rows_[row].grid()->set_active(active);
+}
+
tlistbox::trow::trow(const tbuilder_grid& list_builder_,const t_string& label)
:
grid_(dynamic_cast<tgrid*>(list_builder_.build())),
height_(0),
Modified: trunk/src/gui/widgets/listbox.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/listbox.hpp?rev=26685&r1=26684&r2=26685&view=diff
==============================================================================
--- trunk/src/gui/widgets/listbox.hpp (original)
+++ trunk/src/gui/widgets/listbox.hpp Sun May 18 09:47:39 2008
@@ -122,6 +122,16 @@
unsigned get_selected_row() const { return selected_row_; }
+ /**
+ * Makes a row active or inactive.
+ *
+ * NOTE this doesn't change the select status of the row.
+ *
+ * @param row The row to (de)activate.
+ * @param select true activate, false deactivate.
+ */
+ void set_row_active(const unsigned row, const bool active);
+
private:
/**
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits