mail[Wesnoth-commits] r28888 - in /trunk/data/gui/default/widget: button_25x25.cfg button_down_arrow.cfg button_up_arrow.cfg


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

Header


Content

Posted by koraq on August 23, 2008 - 19:40:
Author: mordante
Date: Sat Aug 23 19:39:58 2008
New Revision: 28888

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28888&view=rev
Log:
Merge the up and down arrow in one file. With some macros it can be made quite
the same and easier to add more buttons in the future. Also added a tiny gui
version.

Added:
    trunk/data/gui/default/widget/button_25x25.cfg   (contents, props changed)
      - copied, changed from r28887, 
trunk/data/gui/default/widget/button_down_arrow.cfg
Removed:
    trunk/data/gui/default/widget/button_down_arrow.cfg
    trunk/data/gui/default/widget/button_up_arrow.cfg

Copied: trunk/data/gui/default/widget/button_25x25.cfg (from r28887, 
trunk/data/gui/default/widget/button_down_arrow.cfg)
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/default/widget/button_25x25.cfg?p2=trunk/data/gui/default/widget/button_25x25.cfg&p1=trunk/data/gui/default/widget/button_down_arrow.cfg&r1=28887&r2=28888&rev=28888&view=diff
==============================================================================
--- trunk/data/gui/default/widget/button_down_arrow.cfg (original)
+++ trunk/data/gui/default/widget/button_25x25.cfg Sat Aug 23 19:39:58 2008
@@ -1,33 +1,28 @@
 ###
-### Definition of a button with the down arrow image.
-###
+### Definition of buttons which have a 25 x 25 pixels image.
+### - down arrow button for the listbox.
+### - up arrow button for the listbox.
 
-[button_definition]
-
-       id = "down_arrow"
-       description = "Down arrow button for a scrollbar."
-
+#define _GUI_RESOLUTION RESOLUTION SIZE IMAGE
        [resolution]
 
-               min_width = 25
-               min_height = 25
+               min_width = {SIZE}
+               min_height = {SIZE}
 
-               default_width = 25
-               default_height = 25
+               default_width = {SIZE}
+               default_height = {SIZE}
 
-               max_width = 25
-               max_height = 25
-
-               text_extra_width = 0
-               text_extra_height = 0
-               text_font_size = 0
+               max_width = {SIZE}
+               max_height = {SIZE}
 
                [state_enabled]
 
                        [draw]
 
                                [image]
-                                       name = "buttons/downarrow-button.png"
+                                       w = {SIZE}
+                                       h = {SIZE}
+                                       name = {IMAGE} + ".png"
                                [/image]
 
                        [/draw]
@@ -39,7 +34,9 @@
                        [draw]
 
                                [image]
-                                       name = 
"buttons/downarrow-button-disabled.png"
+                                       w = {SIZE}
+                                       h = {SIZE}
+                                       name = {IMAGE} + "-disabled.png"
                                [/image]
 
                        [/draw]
@@ -51,7 +48,9 @@
                        [draw]
 
                                [image]
-                                       name = 
"buttons/downarrow-button-pressed.png"
+                                       w = {SIZE}
+                                       h = {SIZE}
+                                       name = {IMAGE} + "-pressed.png"
                                [/image]
 
                        [/draw]
@@ -63,7 +62,9 @@
                        [draw]
 
                                [image]
-                                       name = 
"buttons/downarrow-button-active.png"
+                                       w = {SIZE}
+                                       h = {SIZE}
+                                       name = {IMAGE} + "-active.png"
                                [/image]
 
                        [/draw]
@@ -71,5 +72,30 @@
                [/state_focussed]
 
        [/resolution]
+#enddef
+
+#define _GUI_DEFINITION ID DESCRIPTION IMAGE
+[button_definition]
+       id = {ID}
+       description = {DESCRIPTION}
+
+       {_GUI_RESOLUTION ({GUI_TINY__RESOLUTION}) 12 ({IMAGE}) }
+       {_GUI_RESOLUTION ()                       25 ({IMAGE}) }
 
 [/button_definition]
+#enddef
+
+{_GUI_DEFINITION
+       "down_arrow"
+       "Down arrow button for a scrollbar."
+       "buttons/downarrow-button"
+}
+
+{_GUI_DEFINITION
+       "up_arrow"
+       "Up arrow button for a scrollbar."
+       "buttons/uparrow-button"
+}
+
+#undef _GUI_DEFINITION
+#undef _GUI_RESOLUTION

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

Propchange: trunk/data/gui/default/widget/button_25x25.cfg
------------------------------------------------------------------------------
    svn:mergeinfo = 

Removed: trunk/data/gui/default/widget/button_down_arrow.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/default/widget/button_down_arrow.cfg?rev=28887&view=auto
==============================================================================
--- trunk/data/gui/default/widget/button_down_arrow.cfg (original)
+++ trunk/data/gui/default/widget/button_down_arrow.cfg (removed)
@@ -1,75 +1,0 @@
-###
-### Definition of a button with the down arrow image.
-###
-
-[button_definition]
-
-       id = "down_arrow"
-       description = "Down arrow button for a scrollbar."
-
-       [resolution]
-
-               min_width = 25
-               min_height = 25
-
-               default_width = 25
-               default_height = 25
-
-               max_width = 25
-               max_height = 25
-
-               text_extra_width = 0
-               text_extra_height = 0
-               text_font_size = 0
-
-               [state_enabled]
-
-                       [draw]
-
-                               [image]
-                                       name = "buttons/downarrow-button.png"
-                               [/image]
-
-                       [/draw]
-
-               [/state_enabled]
-
-               [state_disabled]
-
-                       [draw]
-
-                               [image]
-                                       name = 
"buttons/downarrow-button-disabled.png"
-                               [/image]
-
-                       [/draw]
-
-               [/state_disabled]
-
-               [state_pressed]
-
-                       [draw]
-
-                               [image]
-                                       name = 
"buttons/downarrow-button-pressed.png"
-                               [/image]
-
-                       [/draw]
-
-               [/state_pressed]
-
-               [state_focussed]
-
-                       [draw]
-
-                               [image]
-                                       name = 
"buttons/downarrow-button-active.png"
-                               [/image]
-
-                       [/draw]
-
-               [/state_focussed]
-
-       [/resolution]
-
-[/button_definition]

Removed: trunk/data/gui/default/widget/button_up_arrow.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/default/widget/button_up_arrow.cfg?rev=28887&view=auto
==============================================================================
--- trunk/data/gui/default/widget/button_up_arrow.cfg (original)
+++ trunk/data/gui/default/widget/button_up_arrow.cfg (removed)
@@ -1,76 +1,0 @@
-###
-### Definition of a button with the up arrow image.
-###
-
-[button_definition]
-
-       id = "up_arrow"
-       description = "Up arrow button for a scrollbar."
-
-       [resolution]
-
-               min_width = 25
-               min_height = 25
-
-               default_width = 25
-               default_height = 25
-
-               max_width = 25
-               max_height = 25
-
-               text_extra_width = 0
-               text_extra_height = 0
-               text_font_size = 0
-
-               [state_enabled]
-
-                       [draw]
-
-                               [image]
-                                       name = "buttons/uparrow-button.png"
-                               [/image]
-
-                       [/draw]
-
-               [/state_enabled]
-
-               [state_disabled]
-
-                       [draw]
-
-                               [image]
-                                       name = 
"buttons/uparrow-button-disabled.png"
-                               [/image]
-
-                       [/draw]
-
-               [/state_disabled]
-
-               [state_pressed]
-
-                       [draw]
-
-                               [image]
-                                       name = 
"buttons/uparrow-button-pressed.png"
-                               [/image]
-
-                       [/draw]
-
-               [/state_pressed]
-
-               [state_focussed]
-
-                       [draw]
-
-                               [image]
-                                       name = 
"buttons/uparrow-button-active.png"
-                               [/image]
-
-                       [/draw]
-
-               [/state_focussed]
-
-       [/resolution]
-
-[/button_definition]
-




Related Messages


Powered by MHonArc, Updated Sat Aug 23 22:01:54 2008