File: choice_spec.c

package info (click to toggle)
libforms 1.0.93sp1-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,548 kB
  • ctags: 9,107
  • sloc: ansic: 97,227; sh: 9,236; makefile: 858
file content (98 lines) | stat: -rw-r--r-- 3,691 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* Form definition file generated by fdesign. */

#include <stdlib.h>
#include "choice_spec.h"


/***************************************
 ***************************************/

FD_choiceattrib *
create_form_choiceattrib( void )
{
    FL_OBJECT *obj;
    FD_choiceattrib *fdui = fl_malloc( sizeof *fdui );

    int old_bw = fl_get_border_width( );
    fl_set_border_width( -1 );

    fdui->vdata = fdui->cdata = NULL;
    fdui->ldata = 0;

    fdui->choiceattrib = fl_bgn_form( FL_NO_BOX, 520, 270 );

    obj = fl_add_box( FL_FLAT_BOX, 0, 0, 520, 270, "" );

    obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 15, 20, 480, 230, "Choice Attributes" );
    fl_set_object_lsize( obj, FL_NORMAL_SIZE );
    fl_set_object_lstyle( obj, FL_BOLD_STYLE );

    obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 25, 80, 190, 120, "Item Attributes" );
    fl_set_object_lstyle( obj, FL_BOLD_STYLE );

    obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 225, 82, 111, 140, "Action" );

    fdui->content_br = obj = fl_add_browser( FL_HOLD_BROWSER, 353, 85, 120, 140, "CurrentItems:" );
    fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP );

    fdui->input = obj = fl_add_input( FL_NORMAL_INPUT, 35, 107, 170, 25, "EditItem" );
    fl_set_input_shortcut( obj, "#E", 1 );
    fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP );

    obj = fl_add_button( FL_NORMAL_BUTTON, 235, 97, 84, 26, "Add" );
    fl_set_button_shortcut( obj, "#A", 1 );
    fl_set_object_callback( obj, add_choice_item_cb, 0 );

    obj = fl_add_button( FL_NORMAL_BUTTON, 235, 158, 84, 24, "Delete" );
    fl_set_button_shortcut( obj, "#D", 1 );
    fl_set_object_callback( obj, delete_choice_item_cb, 0 );

    obj = fl_add_button( FL_NORMAL_BUTTON, 235, 187, 84, 24, "Change" );
    fl_set_button_shortcut( obj, "#C", 1 );
    fl_set_object_callback( obj, change_choice_item_cb, 0 );

    obj = fl_add_button( FL_NORMAL_BUTTON, 115, 207, 82, 24, "ClearField" );
    fl_set_button_shortcut( obj, "#F", 1 );
    fl_set_object_callback( obj, clear_choice_field_cb, 0 );

    fdui->auto_clear = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 30, 205, 24, 27, "AutoClear" );
    fl_set_object_color( obj, FL_COL1, FL_BLUE );
    fl_set_button( obj, 1 );

    obj = fl_add_button( FL_NORMAL_BUTTON, 235, 127, 84, 26, "Replace" );
    fl_set_button_shortcut( obj, "#R", 1 );
    fl_set_object_callback( obj, replace_choice_item_cb, 0 );

    fdui->mode = obj = fl_add_choice( FL_NORMAL_CHOICE2, 106, 155, 98, 25, "Mode" );
    fl_set_object_shortcut( obj, "#M", 1 );
    fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP );

    fdui->shortcut = obj = fl_add_input( FL_NORMAL_INPUT, 35, 155, 70, 25, "Shortcut" );
    fl_set_input_shortcut( obj, "#S", 1 );
    fl_set_object_lalign( obj, FL_ALIGN_LEFT_TOP );

    fdui->align = obj = fl_add_choice( FL_NORMAL_CHOICE2, 45, 39, 150, 24, "" );
    fl_set_object_callback( obj, choice_align_cb, 0 );

    fdui->val = obj = fl_add_counter( FL_NORMAL_COUNTER, 365, 42, 100, 18, "Initial Choice" );
    fl_set_object_lalign( obj, FL_ALIGN_TOP );
    fl_set_object_callback( obj, choice_val_cb, 0 );
    fl_set_counter_precision( obj, 0 );
    fl_set_counter_value( obj, 1 );
    fl_set_counter_step( obj, 1, 2 );
    fl_set_counter_return( obj, FL_RETURN_CHANGED );

    fdui->new_menuapi = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 210, 39, 70, 25, "Use Struct" );
    fl_set_button_shortcut( obj, "#U", 1 );
    fl_set_object_callback( obj, use_struct_cb, 0 );

    fdui->scope = obj = fl_add_choice( FL_NORMAL_CHOICE2, 290, 40, 65, 22, "" );
    fl_set_object_callback( obj, choiceentry_scope_cb, 0 );

    fl_end_form( );

    fdui->choiceattrib->fdui = fdui;
    fl_set_border_width( old_bw );

    return fdui;
}