* XML Widget Templates

    TODO

* XML-Usable Widgets:

** Widget - <widget />

	Doesn't do anything fancy except draw the background/ninepatch.
    Forms the base class of the Widget hierarchy. Any value you can
    set for this can also be set for any Widget.

	- Lua functions:

	  TODO

	- Parameters:

	  - background - Background image, or a .ninepatch file.

	  - width,height - Initial soft size. It'll only stay at this size
        if it's a top-level Widget, or a child to something
        specifically designed to not mess with children sizes.

	  - minWidth,minHeight - Minimum size. Parent Widgets will stretch
        themselves to accommodate the Widget being this size and this
        Widget will not shrink below that.

	  - name - Name of the Widget.

	- Use:

	  <widget minWidth="256" minHeight="256"
              background="thing.ninepatch" />

	- Subclasses:

	  WidgetSingleParent
	  WidgetText
	  WidgetContainer

** WidgetPaddedBox - <paddedbox />
  
    Contains a single child, with padding on the sides.

	- Lua functions:

	  TODO

	- Parameters:

	  - padding - Sets all padding values.

	  - left,right,top,bottom - Padding for each side individually.

	- Use:

	  <paddedbox padding="16">
	    <widget />
	  </paddedbox>

** WidgetScrollable - <scrollable />
   
    Shows a clipped area of a child Widget. Can clip on either axis or
    both. Stretches child to fill the other axis or stretches self to
    hold the other axis. Defaults to scrolling vertically and not
    horizontally.

	- Lua functions:

	  TODO

	- Parameters:

	  - scrollHorizontally - Set to 1 to enable scrolling horizontally
        (defaults to 0).

	  - scrollVertically - Set to 0 to disable vertical scrolling
        (defaults to 1).

** WidgetContainer - <container />

    A multi-child layout Widget. Similar (sort of) to an HTML table.

	Child Widgets will be shrunk or expanded to the size (on each
    axis) of the largest thing it shares a row or column with. For
    example, if you had a Widget of size 32,32 sharing a column with a
    Widget of size 256,256, the smaller Widget would be expanded to
    256,32.

	The exception to this is the "stretchable" row or column. It uses
    the same rule for determining the minimum size, but rather than
    shrinking the size to the largest thing it contains, it stretches
    to fill all the space left over not used by anything in a
    non-stretchable row or column.

	For example, take a container with 3 rows and columns (Fig 1).

	Fig 1.
    |---+---+---|
    |   |   |   |
    |---+---+---|
    |   |   |   |
    |---+---+---|
    |   |   |   |
    |---+---+---|

	If we want to actually resize this larger, we need to pick a row
    and column to be stretchable. Fig 2 shows what would happen if you
    set the second row and second column (index 1 and 1) as the
    stretchable ones before resizing it.

	Fig 2.
    |---+-------------+---|
    |   | (stretched) |   |
    |---+-------------+---|
    |   | (stretched) |   |
    |   | .           |   |
    |   | .           |   |
    |---+-------------+---|
    |   | (stretched) |   |
    |---+-------------+---|

	Fig 3 shows how it would look if you set the first colum and the
    third row (0, 2) as stretchable, then resized it.

	Fig 3.
    |-------------+---+---|
    | (stretched) |   |   |
    |-------------+---+---|
    | (stretched) |   |   |
    |-------------+---+---|
    | (stretched) |   |   |
    | .           |   |   |
    | .           |   |   |
    |-------------+---+---|

	The container will enforce a minimum size to accommodate all child
    widgets, plus padding between rows and columns.

	- Lua functions:

	  TODO

	- Parameters:

	  - rows - Number of rows in the layout.

	  - cols - Number of columns in the layout.

	  - stretchableRow - Which row is stretchable (0 being the top, 1
        being the second from the top, and so on.)

	  - stretchableColumn - Which column is stretchable.

	  - cellSpacing - Padding between rows and columns.

	- Use:

	  Widgets are placed into cells on the container left-to-right,
      then top-to-bottom.

	  <container rows="2" cols="2" stretchableRow="0" stretchableColumn="0">
	    <widget name="A" />
	    <widget name="B" />
		<null/>
	    <widget name="C" />
	  </container>

	  This would result in a layout like this:

      |---+---|
      | A | B |
      |---+---|
      |   | C |
      |---+---|

** WidgetText - <text/>

    Text display and text editing Widget.

	- Lua functions:

	  TODO

	- Parameters:

	  - preformatted - Set to 1 to enable preformatted mode. In
        preformatted mode all whitespace is preserved. Otherwise it is
        all clumped together like HTML would do.

	  - wordWrap - Set to 1 to enable word wrapping at the edge of the
        Widget (at its own width value). It will wrap at word
        boundaries. Words that are too long for one line will be
        clipped.

	  - editable - Set to 1 to enable editing on this Widget. When
        enabled, the user may click to position a cursor, keystrokes
        are inserted as characters, arrow keys can be used to navigate
        the text, and the Widget will accept focus when determining
        focus.

	  - scale - Drawn text will be scaled by the value given here.

	  - font - Filename of an SFont-formatted bitmap font to
        use. Defaults to "defaultfont.tga".

	- Use:
	  
	  <text editable="1" font="soemthing.tga">Your text here.</text>

** NULL - <null/>

    This isn't really a Widget. But it does represent a gap in a place
    where a Widget would normally go.

	When there is an error in XML parsing, or it encounters a Widget
    it doesn't know about, it will be replaced with this. This keeps
    containers and such from laying out cells inconsistently if
    there's an error.

	- Lua functions:

	  Nothing.

	- Use:

	  <null/>	  

* Widgets with no XML tag:

** WidgetSingleParent

    This isn't meant to be used directly, but some classes subclass
    off of it. You can use any of its settings or features in any of
    those subclasses.

	- Lua functions:

	  TODO

	- Use: (Also applies to children.)
	  
	  Using WidgetPaddedBox as an example, you use children of this
      Widget type as such:

	  <paddedbox>
	    <widget />
	  </paddedbox>

	  Any extra Widgets will be ignored.
	
	- Subclasses:

	  WidgetScrollable
	  WidgetPaddedBox
	  WidgetTransform
		
** WidgetTransfom
   
   Doesn't have an XML tag yet because I haven't written a constructor
   for it to use. Use to apply arbitrary 3D transformations to a child
   Widget. Clipping area will still be this Wiget's size, though.

