/*
    Copyright 2005-2007 Adobe Systems Incorporated
    Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
    or a copy at http://stlab.adobe.com/licenses.html)
*/

layout widget_palette
{
    view dialog(name: "Widget Details", placement: place_column, spacing: 10)
    {
        popup(name: "Widget Type:", bind: @widget_type,
              items: [
                      { name: "Button", value: @button },
                      { name: "Edit Text", value: @edit_text },
                      { name: "Edit Number", value: @edit_number },
                      { name: "Group", value: @group },
                      { name: "Tab Group", value: @tab_group },
                      { name: "Row", value: @row },
                      { name: "Column", value: @column },
                      { name: "Overlay", value: @overlay }
                  ]);

        group (name: "General Widget Properties:")
        {
            popup(name: "Horizontal Alignment:", bind: @horizontal,
                  items: [
                      { name: "Default", value: @align_default },
                      { name: "Left", value: @align_left },
                      { name: "Center", value: @align_center },
                      { name: "Right", value: @align_right },
                      { name: "Proportional", value: @align_proportional },
                      { name: "Fill", value: @align_fill }
                  ]);
            popup(name: "Vertical Alignment:", bind: @vertical,
                  items: [
                      { name: "Default", value: @align_default },
                      { name: "Top", value: @align_top },
                      { name: "Center", value: @align_center },
                      { name: "Bottom", value: @align_bottom },
                      { name: "Proportional", value: @align_proportional },
                      { name: "Fill", value: @align_fill }
                  ]);
        }

        optional(bind: @widget_type, value: @button, horizontal: align_fill, child_horizontal: align_fill)
        {
            group (name: "Button Properties:", child_horizontal: align_fill)
            {
                edit_text(name: "Name:", bind: @name);
            }
        }

        optional(bind: @widget_type, value: @edit_text, horizontal: align_fill, child_horizontal: align_fill)
        {
            group (name: "Edit Text Properties:", child_horizontal: align_fill)
            {
                edit_text(name: "Label:", bind: @name);
                edit_number(name: "Characters:", bind: @characters, min_value: 1, max_value: 100);
            }
        }

        optional(bind: @widget_type, value: @edit_number, horizontal: align_fill, child_horizontal: align_fill)
        {
            group (name: "Edit Number Properties:", child_horizontal: align_fill, guide_mask: [ @mask_label ])
            {
                edit_text(name: "Label:", bind: @name);
                edit_number(name: "Digits:", bind: @characters, min_value: 1, max_value: 100);
                edit_number(name: "Minimum Value:", bind: @min_value);
                edit_number(name: "Maximum Value:", bind: @max_value);
            }
        }

        optional(bind: @is_container)
        {
            group(name: "General Container Properties:")
            {
                popup(name: "Child Placement:", bind: @placement,
                      items: [
                          { name: "Row", value: @place_row },
                          { name: "Column", value: @place_column },
                          { name: "Overlay", value: @place_overlay }
                      ]);
    
                edit_number(name: "Spacing:", bind: @spacing, min_value: 1, max_value: 30);
    
                popup(name: "Child Horizontal:", bind: @child_horizontal,
                      items: [
                          { name: "Default", value: @align_default },
                          { name: "Left", value: @align_left },
                          { name: "Center", value: @align_center },
                          { name: "Right", value: @align_right },
                          { name: "Proportional", value: @align_proportional },
                          { name: "Fill", value: @align_fill }
                      ]);
                popup(name: "Child Vertical:", bind: @child_vertical,
                      items: [
                          { name: "Default", value: @align_default },
                          { name: "Top", value: @align_top },
                          { name: "Center", value: @align_center },
                          { name: "Bottom", value: @align_bottom },
                          { name: "Proportional", value: @align_proportional },
                          { name: "Fill", value: @align_fill }
                      ]);
            }
        }
    }
}
