/*
    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)


    ANOMALIES WRT ORIGINAL DIALOG: (OD stands for Original Dialog)
        - Popup menu with 0 width for applying values to an Adam field.

    DESIRED BEHAVIORS:
        - We want to be able to disable (i.e., grey-out) static text fields.
        - Disabled edit text fields are still editable and selectable.
        - Disabled edit text fields should have greyed out text.
*/

layout sort_lines
{
    view dialog(name: "Sort Lines", placement: place_column, spacing: 10)
    {
        row(horizontal: align_fill)
        {
            group(name: 'Sorting Options', horizontal: align_fill)
            {
                checkbox(name: 'Numbers Match by Value', bind: @numbers_match_by_value, value: true);
                checkbox(name: 'Ignore Leading White Space', bind: @ignore_leading_white_space, value: true);
                checkbox(name: 'Reverse Sort', bind: @reverse_sort, value: true);
                checkbox(name: 'Use Pattern', bind: @sort_using_pattern, value: true);
            }
            group(name: 'Result Destinations', vertical: align_fill, horizontal: align_fill)
            {
                checkbox(name: 'Clipboard', bind: @lines_to_clipboard, value: true);
                checkbox(name: 'New Document', bind: @lines_to_new_doc, value: true);
                checkbox(name: 'Replace Selection', bind: @lines_replace_selection, value: true);
            }
        }
        group(name: 'Pattern Options', placement: place_column, horizontal: align_fill)
        {
            row(horizontal: align_fill)
            {
                static_text(name: 'Search Pattern:');
                popup(  name: ' ', popup_bind: @search_pattern, popup_placement: @down,
                            items: [
                                { name: 'Add...', value: @pattern_add },
                                { name: '-', value: @pattern_separator },
                                { name: 'Pascal Comment to C Comment', value: @pattern_p_to_c },
                                { name: 'C++ Comment to C Comment', value: @pattern_cpp_to_c },
                                { name: 'Run of Spaces to One Tab', value: @pattern_spaces_to_tab },
                                { name: 'C Function Header', value: @pattern_c_header },
                                { name: 'C Comment to Pascal Comment', value: @pattern_pascal_to_c },
                                { name: 'Shift Variables Right', value: @pattern_var_right },
                                { name: 'Lower Case SRC values in IMG tags', value: @pattern_img_tag_process },
                                { name: 'Lower Case HREF values in A tags', value: @pattern_a_tag_process },
                                { name: 'Column #2', value: @pattern_column_2 }
                            ]);
                column(horizontal: align_fill)
                {
                    edit_text(bind: @search_string, horizontal: align_fill, characters: 40);
                    checkbox(name: 'Case Sensitive', bind: @case_sensitive, value: true);
                }
            }
            row(horizontal: align_fill)
            {
                static_text(name: 'Sort Using:');
                column(horizontal: align_fill)
                {
                    radio_button(name: 'Entire Search Pattern', bind: @sort_using, value: @entire_search_pattern);
                    radio_button(name: 'All Sub-Patterns (\1\2...\N)', bind: @sort_using, value: @all_subpatterns);
                    radio_button(name: 'Specific Sub-Patterns:', bind: @sort_using, value: @subpattern);
                    edit_text(bind: @subpattern_expression, horizontal: align_fill);
                }
            }
        }
        row(horizontal: align_fill)
        {
            button(name: "Don't Sort", action: @cancel);
            button(name: "Cancel", cancel: true, action: @cancel, horizontal: align_right);
            button(name: "Sort", default: true, horizontal: align_right);
        }
    }
}
