aboutsummaryrefslogtreecommitdiff
path: root/scrolllist/scrolllist.tk2c
blob: 97129fb49b3d96922b3b88d3da6455d33b2216d6 (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
// ########### scrolllist procedures -- ydegoyon@free.fr #########
sys_gui("proc scrolllist_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_capacity [concat graph_capacity_$vid]\n");
sys_gui("global $var_graph_capacity\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_font [concat graph_font$vid]\n");
sys_gui("global $var_graph_font\n");
sys_gui("set var_graph_bgcolor [concat graph_bgcolor$vid]\n");
sys_gui("global $var_graph_bgcolor\n");
sys_gui("set var_graph_fgcolor [concat graph_fgcolor$vid]\n");
sys_gui("global $var_graph_fgcolor\n");
sys_gui("set var_graph_secolor [concat graph_secolor$vid]\n");
sys_gui("global $var_graph_secolor\n");
sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_capacity] [eval concat $$var_graph_width] [eval concat $$var_graph_height] [eval concat $$var_graph_font] [eval concat $$var_graph_bgcolor] [eval concat $$var_graph_fgcolor] [eval concat $$var_graph_secolor] \\;]\n");
// puts stderr $cmd
sys_gui("pd $cmd\n");
sys_gui("}\n");
sys_gui("proc scrolllist_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 scrolllist_ok {id} {\n");
sys_gui("scrolllist_apply $id\n");
sys_gui("scrolllist_cancel $id\n");
sys_gui("}\n");
sys_gui("proc pdtk_scrolllist_dialog {id capacity width height font bgcolor fgcolor secolor} {\n");
sys_gui("set vid [string trimleft $id .]\n");
sys_gui("set var_graph_capacity [concat graph_capacity_$vid]\n");
sys_gui("global $var_graph_capacity\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_font [concat graph_font$vid]\n");
sys_gui("global $var_graph_font\n");
sys_gui("set var_graph_bgcolor [concat graph_bgcolor$vid]\n");
sys_gui("global $var_graph_bgcolor\n");
sys_gui("set var_graph_fgcolor [concat graph_fgcolor$vid]\n");
sys_gui("global $var_graph_fgcolor\n");
sys_gui("set var_graph_secolor [concat graph_secolor$vid]\n");
sys_gui("global $var_graph_secolor\n");
sys_gui("set $var_graph_capacity $capacity\n");
sys_gui("set $var_graph_width $width\n");
sys_gui("set $var_graph_height $height\n");
sys_gui("set $var_graph_font $font\n");
sys_gui("set $var_graph_bgcolor $bgcolor\n");
sys_gui("set $var_graph_fgcolor $fgcolor\n");
sys_gui("set $var_graph_secolor $secolor\n");
sys_gui("toplevel $id\n");
sys_gui("wm title $id {scrolllist}\n");
sys_gui("wm protocol $id WM_DELETE_WINDOW [concat scrolllist_cancel $id]\n");
sys_gui("label $id.label -text {SCROLLLIST 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 \"scrolllist_cancel $id\"\n");
sys_gui("button $id.buttonframe.apply -text {Apply} -command \"scrolllist_apply $id\"\n");
sys_gui("button $id.buttonframe.ok -text {OK} -command \"scrolllist_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.lcapacity -text \"Capacity :\"\n");
sys_gui("entry $id.1rangef.capacity -textvariable $var_graph_capacity -width 7\n");
sys_gui("pack $id.1rangef.lcapacity $id.1rangef.capacity -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.3_5rangef\n");
sys_gui("pack $id.3_5rangef -side top\n");
sys_gui("label $id.3_5rangef.lfont -text \"Font :\"\n");
sys_gui("entry $id.3_5rangef.font -textvariable $var_graph_font -width 30\n");
sys_gui("pack $id.3_5rangef.lfont $id.3_5rangef.font -side left\n");
sys_gui("frame $id.4rangef\n");
sys_gui("pack $id.4rangef -side top\n");
sys_gui("label $id.4rangef.lbgcolor -text \"Background Color :\"\n");
sys_gui("entry $id.4rangef.bgcolor -textvariable $var_graph_bgcolor -width 7\n");
sys_gui("pack $id.4rangef.lbgcolor $id.4rangef.bgcolor -side left\n");
sys_gui("frame $id.5rangef\n");
sys_gui("pack $id.5rangef -side top\n");
sys_gui("label $id.5rangef.lfgcolor -text \"Foreground Color :\"\n");
sys_gui("entry $id.5rangef.fgcolor -textvariable $var_graph_fgcolor -width 7\n");
sys_gui("pack $id.5rangef.lfgcolor $id.5rangef.fgcolor -side left\n");
sys_gui("frame $id.6rangef\n");
sys_gui("pack $id.6rangef -side top\n");
sys_gui("label $id.6rangef.lsecolor -text \"Selection Color :\"\n");
sys_gui("entry $id.6rangef.secolor -textvariable $var_graph_secolor -width 7\n");
sys_gui("pack $id.6rangef.lsecolor $id.6rangef.secolor -side left\n");
sys_gui("bind $id.1rangef.capacity <KeyPress-Return> [concat scrolllist_ok $id]\n");
sys_gui("bind $id.2rangef.width <KeyPress-Return> [concat scrolllist_ok $id]\n");
sys_gui("bind $id.3rangef.height <KeyPress-Return> [concat scrolllist_ok $id]\n");
sys_gui("bind $id.3_5rangef.font <KeyPress-Return> [concat scrolllist_ok $id]\n");
sys_gui("bind $id.4rangef.bgcolor <KeyPress-Return> [concat scrolllist_ok $id]\n");
sys_gui("bind $id.5rangef.fgcolor <KeyPress-Return> [concat scrolllist_ok $id]\n");
sys_gui("bind $id.6rangef.secolor <KeyPress-Return> [concat scrolllist_ok $id]\n");
sys_gui("}\n");
// ########### scrolllist procedures END -- ydegoyon@free.fr #########