Author: mordante
Date: Sat Jul 30 12:43:45 2011
New Revision: 50496
URL: http://svn.gna.org/viewcvs/wesnoth?rev=50496&view=rev
Log:
Use some more automatic registered types.
Modified:
trunk/src/gui/dialogs/simple_item_selector.cpp
trunk/src/gui/dialogs/simple_item_selector.hpp
Modified: trunk/src/gui/dialogs/simple_item_selector.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/simple_item_selector.cpp?rev=50496&r1=50495&r2=50496&view=diff
==============================================================================
--- trunk/src/gui/dialogs/simple_item_selector.cpp (original)
+++ trunk/src/gui/dialogs/simple_item_selector.cpp Sat Jul 30 12:43:45 2011
@@ -65,33 +65,19 @@
tsimple_item_selector::tsimple_item_selector(const std::string& title, const
std::string& message, list_type const& items, bool title_uses_markup, bool
message_uses_markup)
: index_(-1)
- , title_(title)
- , msg_(message)
- , markup_title_(title_uses_markup)
- , markup_msg_(message_uses_markup)
, single_button_(false)
, items_(items)
, ok_label_()
, cancel_label_()
{
+ register_label2("title", true, title, title_uses_markup);
+ register_label2("message", true, message, message_uses_markup);
}
void tsimple_item_selector::pre_show(CVideo& /*video*/, twindow& window)
{
- tlabel& ltitle = find_widget<tlabel>(&window, "title", false);
- tcontrol& lmessage = find_widget<tcontrol>(&window, "message", false);
tlistbox& list = find_widget<tlistbox>(&window, "listbox", false);
window.keyboard_capture(&list);
-
- ltitle.set_label(title_);
- ltitle.set_use_markup(markup_title_);
-
- lmessage.set_label(msg_);
- lmessage.set_use_markup(markup_msg_);
-
- if(msg_.empty()) {
- lmessage.set_visible(gui2::twidget::INVISIBLE);
- }
foreach(const tsimple_item_selector::item_type& it, items_) {
std::map<std::string, string_map> data;
Modified: trunk/src/gui/dialogs/simple_item_selector.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/simple_item_selector.hpp?rev=50496&r1=50495&r2=50496&view=diff
==============================================================================
--- trunk/src/gui/dialogs/simple_item_selector.hpp (original)
+++ trunk/src/gui/dialogs/simple_item_selector.hpp Sat Jul 30 12:43:45 2011
@@ -59,8 +59,7 @@
private:
int index_;
- std::string title_, msg_;
- bool markup_title_, markup_msg_, single_button_;
+ bool single_button_;
list_type items_;
std::string ok_label_, cancel_label_;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits