Author: mordante
Date: Fri Jul 25 19:38:14 2008
New Revision: 28191
URL: http://svn.gna.org/viewcvs/wesnoth?rev=28191&view=rev
Log:
Add getter and setters without a window and make the type CT intead of T.
Modified:
trunk/src/gui/dialogs/field.hpp
Modified: trunk/src/gui/dialogs/field.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/field.hpp?rev=28191&r1=28190&r2=28191&view=diff
==============================================================================
--- trunk/src/gui/dialogs/field.hpp (original)
+++ trunk/src/gui/dialogs/field.hpp Fri Jul 25 19:38:14 2008
@@ -228,13 +228,24 @@
* Sets the value of the widget.
*
* @param window The window containing the widget.
- */
- void set_value(twindow& window, const T value)
+ * @param value The new value.
+ */
+ void set_value(twindow& window, CT value)
{
value_ = value;
restore(window);
}
+ /**
+ * Sets the value of the widget.
+ *
+ * @param value The new value.
+ */
+ void set_value(CT value)
+ {
+ value_ = value;
+ }
+
/** Inherited from tfield_. */
void widget_save(twindow& window)
{
@@ -249,6 +260,14 @@
T get_value(twindow& window)
{
save(window, false);
+ return value_;
+ }
+
+ /**
+ * Gets the value of the widget.
+ */
+ T get_value()
+ {
return value_;
}
@@ -287,7 +306,6 @@
if(callback_save_value_) {
callback_save_value_(value_);
}
-
}
/**
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits