/*
    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 edit_number_suite
{
    view dialog(name: "Edit Number Suite")
    {
            column()
            {
                /*
                    this tests the code for the single-unit case
                    (as described inlined)
                */
                edit_number(name: "Celsius:", bind: @celsius, format: "#.##", min_value: -273.15);

                /*
                    this tests the code for the single-unit case
                    (as described by the units array)
                */
                edit_number(name: "Inches:", format: "#.##",
                            units: [
                                { name: "inches", bind: @inches, min_value: 0, max_value: 42 }
                            ]);

                /*
                    this tests the code for the multi-unit, multi-base-unit
                    unit cases (no scaling required)
                */
                edit_number(name: "Mixed:", format: "#.##",
                            units: [
                                { name: "inches", bind: @inches, min_value: 0, max_value: 42 },
                                { name: "celsius", bind: @celsius, min_value: -273.15 }
                            ]);

                /*
                    this tests the code for the multi-unit, single-base-unit
                    unit cases (scaling required, no b factor)
                */
                edit_number(name: "Width:", format: "#.##", min_value: 0, max_value: 42,
                            units: [
                                { name: "inches", bind: @inches },
                                { name: "pixels", bind: @inches, scale: [ 72, 0 ] },
                                { name: "cm", bind: @inches, scale: [ 2.54, 0 ]  }
                            ]);

                /*
                    this tests the code for the multi-unit, single-base-unit
                    unit cases (scaling required with b factor)
                */
                edit_number(name: "Temperature:", format: "#.##", min_value: -273.15,
                            units: [
                                { name: "fahrenheit", bind: @celsius, scale: [ 1.8, 32 ] },
                                { name: "celsius", bind: @celsius },
                                { name: "kelvin", bind: @celsius, scale: [ 1, 273.15 ]  }
                            ]);
            }
            column(child_horizontal: align_fill)
            {
                button(name: "OK", action: @cancel, default: true);
            }
        }
    }
}
