Author: mordante
Date: Thu Jul 24 18:33:20 2008
New Revision: 28177

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28177&view=rev
Log:
Renaming to make some names more generic:
ttext_::get_text() to ttext_::get_value()
ttext_::set_text() to ttext_::set_value()

Modified:
    trunk/src/gui/dialogs/addon_connect.cpp
    trunk/src/gui/dialogs/mp_connect.cpp
    trunk/src/gui/dialogs/mp_method_selection.cpp
    trunk/src/gui/widgets/text.cpp
    trunk/src/gui/widgets/text.hpp
    trunk/src/gui/widgets/text_box.cpp
    trunk/src/gui/widgets/window_builder.cpp

Modified: trunk/src/gui/dialogs/addon_connect.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/addon_connect.cpp?rev=28177&r1=28176&r2=28177&view=diff
==============================================================================
--- trunk/src/gui/dialogs/addon_connect.cpp (original)
+++ trunk/src/gui/dialogs/addon_connect.cpp Thu Jul 24 18:33:20 2008
@@ -56,7 +56,7 @@
        ttext_box* host_widget = 
dynamic_cast<ttext_box*>(window.find_widget("host_name", false));
        VALIDATE(host_widget, missing_widget("host_name"));
 
-       host_widget->set_text(host_name_);
+       host_widget->set_value(host_name_);
        window.keyboard_capture(host_widget);
 }
 
@@ -67,7 +67,7 @@
                assert(host_widget);
 
                host_widget->save_to_history();
-               host_name_= host_widget->get_text();
+               host_name_= host_widget->get_value();
        }
 }
 

Modified: trunk/src/gui/dialogs/mp_connect.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/mp_connect.cpp?rev=28177&r1=28176&r2=28177&view=diff
==============================================================================
--- trunk/src/gui/dialogs/mp_connect.cpp (original)
+++ trunk/src/gui/dialogs/mp_connect.cpp Thu Jul 24 18:33:20 2008
@@ -165,7 +165,7 @@
                dynamic_cast<ttext_box*>(window.find_widget("host_name", 
false));
        VALIDATE(host_name_widget_, missing_widget("host_name"));
 
-       host_name_widget_->set_text(preferences::network_host());
+       host_name_widget_->set_value(preferences::network_host());
        window.keyboard_capture(host_name_widget_);
 
        // Set view list callback button.
@@ -180,7 +180,7 @@
 {
        if(get_retval() == tbutton::OK) {
                host_name_widget_->save_to_history();
-               host_name_= host_name_widget_->get_text();
+               host_name_= host_name_widget_->get_value();
                preferences::set_network_host(host_name_);
        }
 
@@ -197,7 +197,7 @@
        dlg.show(*video_);
 
        if(dlg.get_retval() == tbutton::OK) {
-               host_name_widget_->set_text(dlg.host_name());
+               host_name_widget_->set_value(dlg.host_name());
        }
 }
 

Modified: trunk/src/gui/dialogs/mp_method_selection.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/mp_method_selection.cpp?rev=28177&r1=28176&r2=28177&view=diff
==============================================================================
--- trunk/src/gui/dialogs/mp_method_selection.cpp (original)
+++ trunk/src/gui/dialogs/mp_method_selection.cpp Thu Jul 24 18:33:20 2008
@@ -59,7 +59,7 @@
        ttext_box* user_widget = 
dynamic_cast<ttext_box*>(window.find_widget("user_name", false));
        VALIDATE(user_widget, missing_widget("user_name"));
 
-       user_widget->set_text(user_name_);
+       user_widget->set_value(user_name_);
        window.keyboard_capture(user_widget);
 
        tlistbox* list = 
dynamic_cast<tlistbox*>(window.find_widget("method_list", false));
@@ -83,7 +83,7 @@
 
                choice_ = list->get_selected_row();
                user_widget->save_to_history();
-               user_name_= user_widget->get_text();
+               user_name_= user_widget->get_value();
                preferences::set_login(user_name_);
        }
 }

Modified: trunk/src/gui/widgets/text.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/text.cpp?rev=28177&r1=28176&r2=28177&view=diff
==============================================================================
--- trunk/src/gui/widgets/text.cpp (original)
+++ trunk/src/gui/widgets/text.cpp Thu Jul 24 18:33:20 2008
@@ -231,7 +231,7 @@
 
 }
 
-void ttext_::set_text(const std::string& text)
+void ttext_::set_value(const std::string& text)
 { 
        if(text != text_) { 
                text_ = text; 

Modified: trunk/src/gui/widgets/text.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/text.hpp?rev=28177&r1=28176&r2=28177&view=diff
==============================================================================
--- trunk/src/gui/widgets/text.hpp (original)
+++ trunk/src/gui/widgets/text.hpp Thu Jul 24 18:33:20 2008
@@ -54,8 +54,9 @@
        void key_press(tevent_handler& event, bool& handled, SDLKey key, SDLMod 
modifier, Uint16 unicode);
 
 
-       void set_text(const std::string& text); 
-       std::string get_text() const { return text_; }
+       void set_value(const std::string& text); 
+       std::string get_value() const { return text_; }
+
        const std::string& text() const { return text_; }
 
 protected:

Modified: trunk/src/gui/widgets/text_box.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/text_box.cpp?rev=28177&r1=28176&r2=28177&view=diff
==============================================================================
--- trunk/src/gui/widgets/text_box.cpp (original)
+++ trunk/src/gui/widgets/text_box.cpp Thu Jul 24 18:33:20 2008
@@ -124,7 +124,7 @@
        wide_string tmp = utils::string_to_wstring(text());
        tmp.erase(tmp.begin() + start, tmp.begin() + start + len);
        const std::string& text = utils::wstring_to_string(tmp);
-       set_text(text);
+       set_value(text);
        set_cursor(start, false);
 }
 
@@ -278,7 +278,7 @@
 {
        handled = true;
 
-       set_text("");
+       set_value("");
 }
 
 void ttext_box::handle_key_up_arrow(SDLMod /*modifier*/, bool& handled)
@@ -286,7 +286,7 @@
        if (history_.get_enabled()) {
                std::string s = history_.up(text());
                if (!s.empty()) {
-                       set_text(s);
+                       set_value(s);
                }
                                
                handled = true;
@@ -297,7 +297,7 @@
 void ttext_box::handle_key_down_arrow(SDLMod /*modifier*/, bool& handled)
 {
        if (history_.get_enabled()) {
-               set_text(history_.down(text()));
+               set_value(history_.down(text()));
                handled = true;
        }
 }

Modified: trunk/src/gui/widgets/window_builder.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/window_builder.cpp?rev=28177&r1=28176&r2=28177&view=diff
==============================================================================
--- trunk/src/gui/widgets/window_builder.cpp (original)
+++ trunk/src/gui/widgets/window_builder.cpp Thu Jul 24 18:33:20 2008
@@ -1094,7 +1094,7 @@
        init_control(text_box);
 
        // A textbox doesn't have a label but a text
-       text_box->set_text(label);
+       text_box->set_value(label);
 
        if (!history_.empty()) {
                text_box->set_history(history_);                


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

Reply via email to