mail[Wesnoth-commits] r28374 - in /trunk: data/gui/default/window/ src/gui/dialogs/


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

Header


Content

Posted by kailoran on August 08, 2008 - 13:29:
Author: ilor
Date: Fri Aug  8 13:29:24 2008
New Revision: 28374

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28374&view=rev
Log:
editor2: use sliders in new map dialog 

Modified:
    trunk/data/gui/default/window/editor_new_map.cfg
    trunk/src/gui/dialogs/editor_new_map.cpp
    trunk/src/gui/dialogs/editor_new_map.hpp

Modified: trunk/data/gui/default/window/editor_new_map.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/default/window/editor_new_map.cfg?rev=28374&r1=28373&r2=28374&view=diff
==============================================================================
--- trunk/data/gui/default/window/editor_new_map.cfg (original)
+++ trunk/data/gui/default/window/editor_new_map.cfg Fri Aug  8 13:29:24 2008
@@ -50,11 +50,13 @@
                                                                border = "all"
                                                                border_size = 
5
                                                                
horizontal_alignment = "left"
-                                                               [text_box]
-                                                                       id = 
"width"
-                                                                       
definition = "default"
-                                                                       label 
= _ "Width"
-                                                               [/text_box]
+                                                               [slider]
+                                                                   id = 
"width"
+                                                                   
definition = "default"
+                                                                   
minimum_value = 1
+                                                                   
maximum_value = 200
+                                                                   step_size 
= 1
+                                                               [/slider]
                                                        [/column]
                                                [/row]
                                        [/grid]
@@ -83,11 +85,13 @@
                                                                border = "all"
                                                                border_size = 
5
                                                                
horizontal_alignment = "left"
-                                                               [text_box]
-                                                                       id = 
"height"
-                                                                       
definition = "default"
-                                                                       label 
= _ "Height"
-                                                               [/text_box]
+                                                               [slider]
+                                                                   id = 
"height"
+                                                                   
definition = "default"
+                                                                   
minimum_value = 1
+                                                                   
maximum_value = 200
+                                                                   step_size 
= 1
+                                                               [/slider]
                                                        [/column]
                                                [/row]
                                        [/grid]

Modified: trunk/src/gui/dialogs/editor_new_map.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/editor_new_map.cpp?rev=28374&r1=28373&r2=28374&view=diff
==============================================================================
--- trunk/src/gui/dialogs/editor_new_map.cpp (original)
+++ trunk/src/gui/dialogs/editor_new_map.cpp Fri Aug  8 13:29:24 2008
@@ -20,6 +20,7 @@
 #include "gui/widgets/listbox.hpp"
 #include "gui/widgets/settings.hpp"
 #include "gui/widgets/text_box.hpp"
+#include "gui/widgets/slider.hpp"
 #include "gui/widgets/window.hpp"
 #include "gui/widgets/window_builder.hpp"
 #include "language.hpp"
@@ -36,29 +37,29 @@
 namespace gui2 {
 
 teditor_new_map::teditor_new_map() :
-       map_width_(register_text("width", false)),
-       map_height_(register_text("height", false))
+       map_width_(register_integer("width", false)),
+       map_height_(register_integer("height", false))
 {
 }
 
 void teditor_new_map::set_map_width(int value) 
 { 
-       map_width_->set_value(lexical_cast<std::string>(value));
+       map_width_->set_value(value);
 }
 
 int teditor_new_map::map_width() const
 {
-       return lexical_cast_default<int>(map_width_->get_value());
+       return map_width_->get_value();
 }
 
 void teditor_new_map::set_map_height(int value)
 { 
-       map_height_->set_value(lexical_cast<std::string>(value));
+       map_height_->set_value(value);
 }
 
 int teditor_new_map::map_height() const
 {
-       return lexical_cast_default<int>(map_height_->get_value());
+       return map_height_->get_value();
 }
 
 twindow teditor_new_map::build_window(CVideo& video)

Modified: trunk/src/gui/dialogs/editor_new_map.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/editor_new_map.hpp?rev=28374&r1=28373&r2=28374&view=diff
==============================================================================
--- trunk/src/gui/dialogs/editor_new_map.hpp (original)
+++ trunk/src/gui/dialogs/editor_new_map.hpp Fri Aug  8 13:29:24 2008
@@ -34,8 +34,8 @@
         * NOTE the map sizes are stored in a text variable since there is no
         * integer edit widget yet.
         */
-       tfield_text* map_width_;
-       tfield_text* map_height_;
+       tfield_integer* map_width_;
+       tfield_integer* map_height_;
 
        /** Inherited from tdialog. */
        twindow build_window(CVideo& video);




Related Messages


Powered by MHonArc, Updated Fri Aug 08 13:42:00 2008