mail[Wesnoth-commits] r33408 - in /trunk: src/gui/widgets/settings.cpp utils/wiki_grabber.py


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

Header


Content

Posted by koraq on March 08, 2009 - 11:24:
Author: mordante
Date: Sun Mar  8 11:24:30 2009
New Revision: 33408

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33408&view=rev
Log:
Cleaned up the widget list.

Modified:
    trunk/src/gui/widgets/settings.cpp
    trunk/utils/wiki_grabber.py

Modified: trunk/src/gui/widgets/settings.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/settings.cpp?rev=33408&r1=33407&r2=33408&view=diff
==============================================================================
--- trunk/src/gui/widgets/settings.cpp (original)
+++ trunk/src/gui/widgets/settings.cpp Sun Mar  8 11:24:30 2009
@@ -176,34 +176,37 @@
  * @end_table
  *
  * <span id="widget_list"></span>List of available widgets:
- * @start_table = widget_definition
- *     button_definition             A push button.
- *     image_definition              An image.
- *     horizontal_scrollbar_definition
- *                                   A horizontal scrollbar.
- *     menubar_definition            A menubar which is used in menus and the
- *                                   tabbar in a tabcontrol.
- *     minimap_definition            A minimap to show the gamemap, this only
+ * @start_table = widget_overview
+ *     Button                        A push button.
+ *     Image                         An image.
+ *     Horizontal_scrollbar          A horizontal scrollbar.
+ *     Label                         A label without scrollbars.
+ *     Listbox                       A listbox.
+ *     Menubar                       A menubar which is used in menus and the
+ *                                   tabbar in a tabcontrol. (NOTE this 
widget
+ *                                   is still under heavy development.)
+ *     Minimap                       A minimap to show the gamemap, this only
  *                                   shows the map and has no interaction
  *                                   options. This version is used for map
  *                                   previews, there will be a another 
version
  *                                   which allows interaction.
- *     label_definition              A label.
- *     listbox_definition            A listbox.
- *     panel_definition              A panel.
- *     scroll_label_definition       A scroll_label.
- *     slider_definition             A slider.
- *     spacer_definition             A spacer.
- *     text_box_definition           A single line text box.
- *     toggle_button_definition      A kind of button with two 'states' 
normal
+ *     Panel                         A panel is a container with can have 
it's
+ *                                   own visual attributes. 
+ *     Scroll_label                  A label which can have scrollbars.
+ *     Slider                        A slider.
+ *     Spacer                        A spacer is a dummy widget which can be
+ *                                   used if a cell in a container needs to 
be
+ *                                   empty or have a fixed size.
+ *     Text_box                      A single line text box.
+ *     Toggle_button                 A kind of button with two 'states' 
normal
  *                                   and selected. This is a more generic 
widget
  *                                   which is used for eg checkboxes and
  *                                   radioboxes.
- *     toggle_panel_definition       Like a toggle button but then as panel 
so
+ *     Toggle_panel                  Like a toggle button but then as panel 
so
  *                                   can hold multiple items in a grid.
- *     tooltip_definition            A small tooltip with help.
- *     vertical_scrollbar_definition A vertical scrollbar.
- *     window_definition             A window.
+ *     Tooltip                       A small tooltip with help.
+ *     Vertical_scrollbar            A vertical scrollbar.
+ *     Window                        A window.
  * @end_table
  *
  * <span id="window_list"></span>List of available windows:

Modified: trunk/utils/wiki_grabber.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/wiki_grabber.py?rev=33408&r1=33407&r2=33408&view=diff
==============================================================================
--- trunk/utils/wiki_grabber.py (original)
+++ trunk/utils/wiki_grabber.py Sun Mar  8 11:24:30 2009
@@ -181,7 +181,8 @@
         result += "|}"
 
         return result
-        
+    
+    # FIXME remove after create_window_definition_table has been converted.
     def create_widget_definition_table(data):
         """Creates a table for a widget definition."""
 
@@ -205,6 +206,33 @@
         result += "|}"
 
         return result
+
+    def create_widget_overview_table(data):
+        """Creates a table for all available widgets."""
+        #matches a line like
+        # Button                        A push button.
+        variable = "(?:[a-z]|[A-Z])(?:[a-z]|[A-Z]|[0-9]|_)*"
+        regex = re.compile(" *(" + variable +  ") +(.*)\n")
+        res = regex.findall(data)
+
+        # empty table
+        if(len(res) == 0):
+            sys.stderr.write("Empty table:\n" + data + "\n")
+            return "Empty table."
+
+        result = '{| border="1"'
+        result += "\n!Section\n!Description\n"
+        for i in range(len(res)):
+            result += "|-\n"
+            result += "| " + re.sub(r'_', ' ', res[i][0])
+            result += " ([[GUIWidgetDefinitionWML#" 
+            result += res[i][0]
+            result += "|definition]])\n"
+            result += "| " + format(res[i][1]) + "\n"
+        result += "|}"
+
+        return result
+
 
     def create_window_definition_table(data):
         """Creates a table for a window definition."""
@@ -286,8 +314,8 @@
             return create_formula_table(table.group(2) + "\n")
         elif(type == "variable_types"):
             return create_variable_types_table(table.group(2) + "\n")
-        elif(type == "widget_definition"):
-            return create_widget_definition_table(table.group(2) + "\n")
+        elif(type == "widget_overview"):
+            return create_widget_overview_table(table.group(2) + "\n")
         elif(type == "window_definition"):
             return create_window_definition_table(table.group(2) + "\n")
         elif(type == "container"):




Related Messages


Powered by MHonArc, Updated Sun Mar 08 11:40:24 2009