mail[Wesnoth-commits] r28515 - in /trunk: data/gui/default/widget/ 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 koraq on August 12, 2008 - 22:06:
Author: mordante
Date: Tue Aug 12 22:05:32 2008
New Revision: 28515

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28515&view=rev
Log:
Add a new toggle button type for the resize direction in the new editor.
Also added proof-of-concept code in the editor and made a tight grid.

Added:
    trunk/data/gui/default/widget/toggle_button_icon.cfg   (with props)
Modified:
    trunk/data/gui/default/window/editor_resize_map.cfg
    trunk/src/gui/dialogs/editor_resize_map.cpp

Added: trunk/data/gui/default/widget/toggle_button_icon.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/default/widget/toggle_button_icon.cfg?rev=28515&view=auto
==============================================================================
--- trunk/data/gui/default/widget/toggle_button_icon.cfg (added)
+++ trunk/data/gui/default/widget/toggle_button_icon.cfg Tue Aug 12 22:05:32 
2008
@@ -1,0 +1,107 @@
+###
+### Definition of a toggle button with only a changing image.
+### It's used for the editor in the resize grid.
+###
+
+#define ICON
+       [image]
+               x = 0
+               y = 0
+               name = "(icon)"
+       [/image]
+#enddef
+
+[toggle_button_definition]
+
+       id = "icon"
+       description = "This toggle button is meant to be used in the resize 
grid of the editor and only has an icon."
+
+       [resolution]
+
+               min_width = 27
+               min_height = 27
+
+               default_width = 27
+               default_height = 27
+
+               max_width = 27
+               max_height = 27
+
+               text_extra_width = 0
+               text_font_size = 0
+
+               [state_enabled]
+                       full_redraw = "true"
+
+                       [draw]
+
+                               {ICON}
+
+                       [/draw]
+
+               [/state_enabled]
+
+               [state_disabled]
+                       full_redraw = "true"
+
+                       [draw]
+
+                               {ICON}
+
+                       [/draw]
+
+               [/state_disabled]
+
+               [state_focussed]
+                       full_redraw = "true"
+
+                       [draw]
+
+                               {ICON}
+
+                       [/draw]
+
+               [/state_focussed]
+
+###
+### Selected
+###
+
+               [state_enabled_selected]
+                       full_redraw = "true"
+
+                       [draw]
+
+                               {ICON}
+
+                       [/draw]
+
+               [/state_enabled_selected]
+
+               [state_disabled_selected]
+                       full_redraw = "true"
+
+                       [draw]
+
+                               {ICON}
+
+                       [/draw]
+
+               [/state_disabled_selected]
+
+               [state_focussed_selected]
+                       full_redraw = "true"
+
+                       [draw]
+
+                               {ICON}
+
+                       [/draw]
+
+               [/state_focussed_selected]
+
+       [/resolution]
+
+[/toggle_button_definition]
+
+#undef ICON

Propchange: trunk/data/gui/default/widget/toggle_button_icon.cfg
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/data/gui/default/window/editor_resize_map.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/default/window/editor_resize_map.cfg?rev=28515&r1=28514&r2=28515&view=diff
==============================================================================
--- trunk/data/gui/default/window/editor_resize_map.cfg (original)
+++ trunk/data/gui/default/window/editor_resize_map.cfg Tue Aug 12 22:05:32 
2008
@@ -151,24 +151,25 @@
                                                                grow_factor = 0
                                                                
[toggle_button]
                                                                        id = 
"expand0"
-                                                                       
definition = "default"
-                                                                       label 
= "Bottom / right"
+                                                                       
definition = "icon"
+#                                                                      label 
= "Bottom / right"
                                                                
[/toggle_button]
                                                        [/column]
                                                        [column]
                                                                grow_factor = 0
                                                                
[toggle_button]
                                                                        id = 
"expand1"
-                                                                       
definition = "default"
-                                                                       label 
= "Bottom / center"
-                                                               
[/toggle_button]
-                                                       [/column]
-                                                       [column]
-                                                               grow_factor = 0
+                                                                       
definition = "icon"
+#                                                                      label 
= "Bottom / center"
+                                                               
[/toggle_button]
+                                                       [/column]
+                                                       [column]
+                                                               grow_factor = 
1
+                                                               
horizontal_alignment = "left"
                                                                
[toggle_button]
                                                                        id = 
"expand2"
-                                                                       
definition = "default"
-                                                                       label 
= "Bottom / left"
+                                                                       
definition = "icon"
+#                                                                      label 
= "Bottom / left"
                                                                
[/toggle_button]
                                                        [/column]
                                                [/row]
@@ -178,51 +179,53 @@
                                                                grow_factor = 0
                                                                
[toggle_button]
                                                                        id = 
"expand3"
-                                                                       
definition = "default"
-                                                                       label 
= "Center / right"
+                                                                       
definition = "icon"
+#                                                                      label 
= "Center / right"
                                                                
[/toggle_button]
                                                        [/column]
                                                        [column]
                                                                grow_factor = 0
                                                                
[toggle_button]
                                                                        id = 
"expand4"
-                                                                       
definition = "default"
-                                                                       label 
= "Center"
-                                                               
[/toggle_button]
-                                                       [/column]
-                                                       [column]
-                                                               grow_factor = 0
+                                                                       
definition = "icon"
+#                                                                      label 
= "Center"
+                                                               
[/toggle_button]
+                                                       [/column]
+                                                       [column]
+                                                               grow_factor = 
1
+                                                               
horizontal_alignment = "left"
                                                                
[toggle_button]
                                                                        id = 
"expand5"
-                                                                       
definition = "default"
-                                                                       label 
= "Center / left"
-                                                               
[/toggle_button]
-                                                       [/column]
-                                               [/row]
-                                               [row]
-                                                       grow_factor = 1
-                                                       [column]
-                                                               grow_factor = 0
+                                                                       
definition = "icon"
+#                                                                      label 
= "Center / left"
+                                                               
[/toggle_button]
+                                                       [/column]
+                                               [/row]
+                                               [row]
+                                                       grow_factor = 1
+                                                       [column]
+                                                               grow_factor = 
1
+                                                               
horizontal_alignment = "left"
                                                                
[toggle_button]
                                                                        id = 
"expand6"
-                                                                       
definition = "default"
-                                                                       label 
= "Top / right"
+                                                                       
definition = "icon"
+#                                                                      label 
= "Top / right"
                                                                
[/toggle_button]
                                                        [/column]
                                                        [column]
                                                                grow_factor = 0
                                                                
[toggle_button]
                                                                        id = 
"expand7"
-                                                                       
definition = "default"
-                                                                       label 
= "Top / center"
+                                                                       
definition = "icon"
+#                                                                      label 
= "Top / center"
                                                                
[/toggle_button]
                                                        [/column]
                                                        [column]
                                                                grow_factor = 0
                                                                
[toggle_button]
                                                                        id = 
"expand8"
-                                                                       
definition = "default"
-                                                                       label 
= "Top / left"
+                                                                       
definition = "icon"
+#                                                                      label 
= "Top / left"
                                                                
[/toggle_button]
                                                        [/column]
                                                [/row]

Modified: trunk/src/gui/dialogs/editor_resize_map.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/editor_resize_map.cpp?rev=28515&r1=28514&r2=28515&view=diff
==============================================================================
--- trunk/src/gui/dialogs/editor_resize_map.cpp (original)
+++ trunk/src/gui/dialogs/editor_resize_map.cpp Tue Aug 12 22:05:32 2008
@@ -114,6 +114,15 @@
                        dialog_callback<teditor_resize_map, 
&teditor_resize_map::update_expand_direction>);
        }
        direction_buttons_[0]->set_value(true);
+       
direction_buttons_[0]->set_icon_name("buttons/resize-direction-top-left.png");
+       
direction_buttons_[1]->set_icon_name("buttons/resize-direction-top.png");
+       
direction_buttons_[2]->set_icon_name("buttons/resize-direction-top-right.png");
+       
direction_buttons_[3]->set_icon_name("buttons/resize-direction-left.png");
+       
direction_buttons_[4]->set_icon_name("buttons/resize-direction-center.png");
+       
direction_buttons_[5]->set_icon_name("buttons/resize-direction-right.png");
+       
direction_buttons_[6]->set_icon_name("buttons/resize-direction-bottom-left.png");
+       
direction_buttons_[7]->set_icon_name("buttons/resize-direction-bottom.png");
+       
direction_buttons_[8]->set_icon_name("buttons/resize-direction-bottom-right.png");
        window.recalculate_size();
 }
 




Related Messages


Powered by MHonArc, Updated Tue Aug 12 22:22:30 2008