blob: 10f564591b105699d868b50b239ae8a5c72f979d (
plain)
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
// ########### pianoroll procedures -- ydegoyon@free.fr #########
sys_gui("proc pianoroll_apply {id} {\n");
// strip "." from the TK id to make a variable name suffix
sys_gui("set vid [string trimleft $id .]\n");
// for each variable, make a local variable to hold its name...
sys_gui("set var_graph_name [concat graph_name_$vid]\n");
sys_gui("global $var_graph_name\n");
sys_gui("set var_graph_width [concat graph_width_$vid]\n");
sys_gui("global $var_graph_width\n");
sys_gui("set var_graph_height [concat graph_height_$vid]\n");
sys_gui("global $var_graph_height\n");
sys_gui("set var_graph_pmin [concat graph_pmin_$vid]\n");
sys_gui("global $var_graph_pmin\n");
sys_gui("set var_graph_pmax [concat graph_pmax_$vid]\n");
sys_gui("global $var_graph_pmax\n");
sys_gui("set var_graph_nbgrades [concat graph_nbgrades_$vid]\n");
sys_gui("global $var_graph_nbgrades\n");
sys_gui("set var_graph_nbsteps [concat graph_nbsteps_$vid]\n");
sys_gui("global $var_graph_nbsteps\n");
sys_gui("set var_graph_defvalue [concat graph_defvalue_$vid]\n");
sys_gui("global $var_graph_defvalue\n");
sys_gui("set var_graph_save [concat graph_save_$vid]\n");
sys_gui("global $var_graph_save\n");
sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_name] [eval concat $$var_graph_width] [eval concat $$var_graph_height] [eval concat $$var_graph_pmin] [eval concat $$var_graph_pmax] [eval concat $$var_graph_nbgrades] [eval concat $$var_graph_nbsteps] [eval concat $$var_graph_defvalue] [eval concat $$var_graph_save] \\;]\n");
// puts stderr $cmd
sys_gui("pd $cmd\n");
sys_gui("}\n");
sys_gui("proc pianoroll_cancel {id} {\n");
sys_gui("set cmd [concat $id cancel \\;]\n");
// puts stderr $cmd
sys_gui("pd $cmd\n");
sys_gui("}\n");
sys_gui("proc pianoroll_ok {id} {\n");
sys_gui("pianoroll_apply $id\n");
sys_gui("pianoroll_cancel $id\n");
sys_gui("}\n");
sys_gui("proc pdtk_pianoroll_dialog {id name width height pmin pmax nbgrades nbsteps defvalue save } {\n");
sys_gui("set vid [string trimleft $id .]\n");
sys_gui("set var_graph_name [concat graph_name_$vid]\n");
sys_gui("global $var_graph_name\n");
sys_gui("set var_graph_width [concat graph_width_$vid]\n");
sys_gui("global $var_graph_width\n");
sys_gui("set var_graph_height [concat graph_height_$vid]\n");
sys_gui("global $var_graph_height\n");
sys_gui("set var_graph_pmin [concat graph_pmin_$vid]\n");
sys_gui("global $var_graph_pmin\n");
sys_gui("set var_graph_pmax [concat graph_pmax_$vid]\n");
sys_gui("global $var_graph_pmax\n");
sys_gui("set var_graph_nbgrades [concat graph_nbgrades_$vid]\n");
sys_gui("global $var_graph_nbgrades\n");
sys_gui("set var_graph_nbsteps [concat graph_nbsteps_$vid]\n");
sys_gui("global $var_graph_nbsteps\n");
sys_gui("set var_graph_defvalue [concat graph_defvalue_$vid]\n");
sys_gui("global $var_graph_defvalue\n");
sys_gui("set var_graph_save [concat graph_save_$vid]\n");
sys_gui("global $var_graph_save\n");
sys_gui("set $var_graph_name $name\n");
sys_gui("set $var_graph_width $width\n");
sys_gui("set $var_graph_height $height\n");
sys_gui("set $var_graph_pmin $pmin\n");
sys_gui("set $var_graph_pmax $pmax\n");
sys_gui("set $var_graph_nbgrades $nbgrades\n");
sys_gui("set $var_graph_nbsteps $nbsteps\n");
sys_gui("set $var_graph_defvalue $defvalue\n");
sys_gui("set $var_graph_save $save\n");
sys_gui("toplevel $id\n");
sys_gui("wm title $id {pianoroll}\n");
sys_gui("wm protocol $id WM_DELETE_WINDOW [concat pianoroll_cancel $id]\n");
sys_gui("label $id.label -text {PIANOROLL PROPERTIES}\n");
sys_gui("pack $id.label -side top\n");
sys_gui("frame $id.buttonframe\n");
sys_gui("pack $id.buttonframe -side bottom -fill x -pady 2m\n");
sys_gui("button $id.buttonframe.cancel -text {Cancel} -command \"pianoroll_cancel $id\"\n");
sys_gui("button $id.buttonframe.apply -text {Apply} -command \"pianoroll_apply $id\"\n");
sys_gui("button $id.buttonframe.ok -text {OK} -command \"pianoroll_ok $id\"\n");
sys_gui("pack $id.buttonframe.cancel -side left -expand 1\n");
sys_gui("pack $id.buttonframe.apply -side left -expand 1\n");
sys_gui("pack $id.buttonframe.ok -side left -expand 1\n");
sys_gui("frame $id.1rangef\n");
sys_gui("pack $id.1rangef -side top\n");
sys_gui("label $id.1rangef.lname -text \"Name :\"\n");
sys_gui("entry $id.1rangef.name -textvariable $var_graph_name -width 15\n");
sys_gui("pack $id.1rangef.lname $id.1rangef.name -side left\n");
sys_gui("frame $id.2rangef\n");
sys_gui("pack $id.2rangef -side top\n");
sys_gui("label $id.2rangef.lwidth -text \"Width :\"\n");
sys_gui("entry $id.2rangef.width -textvariable $var_graph_width -width 7\n");
sys_gui("pack $id.2rangef.lwidth $id.2rangef.width -side left\n");
sys_gui("frame $id.3rangef\n");
sys_gui("pack $id.3rangef -side top\n");
sys_gui("label $id.3rangef.lheight -text \"Height :\"\n");
sys_gui("entry $id.3rangef.height -textvariable $var_graph_height -width 7\n");
sys_gui("pack $id.3rangef.lheight $id.3rangef.height -side left\n");
sys_gui("frame $id.4rangef\n");
sys_gui("pack $id.4rangef -side top\n");
sys_gui("label $id.4rangef.lpmin -text \"Pitch low :\"\n");
sys_gui("entry $id.4rangef.pmin -textvariable $var_graph_pmin -width 7\n");
sys_gui("pack $id.4rangef.lpmin $id.4rangef.pmin -side left\n");
sys_gui("frame $id.5rangef\n");
sys_gui("pack $id.5rangef -side top\n");
sys_gui("label $id.5rangef.lpmax -text \"Pitch high :\"\n");
sys_gui("entry $id.5rangef.pmax -textvariable $var_graph_pmax -width 7\n");
sys_gui("pack $id.5rangef.lpmax $id.5rangef.pmax -side left\n");
sys_gui("frame $id.6rangef\n");
sys_gui("pack $id.6rangef -side top\n");
sys_gui("label $id.6rangef.lnbgrades -text \"Grades :\"\n");
sys_gui("entry $id.6rangef.nbgrades -textvariable $var_graph_nbgrades -width 7\n");
sys_gui("pack $id.6rangef.lnbgrades $id.6rangef.nbgrades -side left\n");
sys_gui("frame $id.7rangef\n");
sys_gui("pack $id.7rangef -side top\n");
sys_gui("label $id.7rangef.lnbsteps -text \"Steps :\"\n");
sys_gui("entry $id.7rangef.nbsteps -textvariable $var_graph_nbsteps -width 7\n");
sys_gui("pack $id.7rangef.lnbsteps $id.7rangef.nbsteps -side left\n");
sys_gui("frame $id.8rangef\n");
sys_gui("pack $id.8rangef -side top\n");
sys_gui("label $id.8rangef.ldefvalue -text \"Default Value :\"\n");
sys_gui("entry $id.8rangef.defvalue -textvariable $var_graph_defvalue -width 7\n");
sys_gui("pack $id.8rangef.ldefvalue $id.8rangef.defvalue -side left\n");
sys_gui("checkbutton $id.save -text {Save contents} -variable $var_graph_save -anchor w\n");
sys_gui("pack $id.save -side top\n");
sys_gui("bind $id.1rangef.name <KeyPress-Return> [concat pianoroll_ok $id]\n");
sys_gui("bind $id.2rangef.width <KeyPress-Return> [concat pianoroll_ok $id]\n");
sys_gui("bind $id.3rangef.height <KeyPress-Return> [concat pianoroll_ok $id]\n");
sys_gui("bind $id.4rangef.pmin <KeyPress-Return> [concat pianoroll_ok $id]\n");
sys_gui("bind $id.5rangef.pmax <KeyPress-Return> [concat pianoroll_ok $id]\n");
sys_gui("bind $id.6rangef.nbgrades <KeyPress-Return> [concat pianoroll_ok $id]\n");
sys_gui("bind $id.7rangef.nbsteps <KeyPress-Return> [concat pianoroll_ok $id]\n");
sys_gui("bind $id.8rangef.defvalue <KeyPress-Return> [concat pianoroll_ok $id]\n");
sys_gui("focus $id.1rangef.name\n");
sys_gui("}\n");
// ########### pianoroll procedures END -- ydegoyon@free.fr #########
|