diff options
author | N.N. <sevyves@users.sourceforge.net> | 2004-05-18 00:58:15 +0000 |
---|---|---|
committer | N.N. <sevyves@users.sourceforge.net> | 2004-05-18 00:58:15 +0000 |
commit | 607f5de1bd0ff0452f940772d3391fe0418de6c8 (patch) | |
tree | 112b1449f1b75e26d19629acc1ffdc286b629ba4 /modules/pdp_colorgrid.tk | |
parent | 07d4617fc2d96022fd097f8785dfca6206b1c6df (diff) |
Colorgrid object by Lluis Gomez
svn path=/trunk/externals/pidip/; revision=1736
Diffstat (limited to 'modules/pdp_colorgrid.tk')
-rw-r--r-- | modules/pdp_colorgrid.tk | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/modules/pdp_colorgrid.tk b/modules/pdp_colorgrid.tk new file mode 100644 index 0000000..293885d --- /dev/null +++ b/modules/pdp_colorgrid.tk @@ -0,0 +1,87 @@ +############ pdp_colorgrid procedures -- ydegoyon@free.fr ######### + +proc pdp_colorgrid_apply {id} { +# strip "." from the TK id to make a variable name suffix + set vid [string trimleft $id .] +# for each variable, make a local variable to hold its name... + set var_graph_pdp_colorgrid [concat graph_pdp_colorgrid_$vid] + global $var_graph_pdp_colorgrid + set var_graph_xlines [concat graph_xlines_$vid] + global $var_graph_xlines + set var_graph_ylines [concat graph_ylines_$vid] + global $var_graph_ylines + + set cmd [concat $id dialog \ + [eval concat $$var_graph_xlines] \ + [eval concat $$var_graph_ylines] \ + [eval concat $$var_graph_pdp_colorgrid] \ + \;] + #puts stderr $cmd + pd $cmd +} + +proc pdp_colorgrid_cancel {id} { + set cmd [concat $id cancel \;] + #puts stderr $cmd + pd $cmd +} + +proc pdp_colorgrid_ok {id} { + pdp_colorgrid_apply $id + pdp_colorgrid_cancel $id +} + +proc pdtk_pdp_colorgrid_dialog {id xlines ylines pdp_colorgrid} { + set vid [string trimleft $id .] + set var_graph_pdp_colorgrid [concat graph_pdp_colorgrid_$vid] + global $var_graph_pdp_colorgrid + set var_graph_xlines [concat graph_xlines_$vid] + global $var_graph_xlines + set var_graph_ylines [concat graph_ylines_$vid] + global $var_graph_ylines + + set $var_graph_pdp_colorgrid $pdp_colorgrid + set $var_graph_xlines $xlines + set $var_graph_ylines $ylines + + toplevel $id + wm title $id {pdp_colorgrid} + wm protocol $id WM_DELETE_WINDOW [concat pdp_colorgrid_cancel $id] + + label $id.label -text {COLORGRID PROPERTIES} + pack $id.label -side top + + frame $id.buttonframe + pack $id.buttonframe -side bottom -fill x -pady 2m + button $id.buttonframe.cancel -text {Cancel}\ + -command "pdp_colorgrid_cancel $id" + button $id.buttonframe.apply -text {Apply}\ + -command "pdp_colorgrid_apply $id" + button $id.buttonframe.ok -text {OK}\ + -command "pdp_colorgrid_ok $id" + pack $id.buttonframe.cancel -side left -expand 1 + pack $id.buttonframe.apply -side left -expand 1 + pack $id.buttonframe.ok -side left -expand 1 + + frame $id.42rangef + pack $id.42rangef -side top + label $id.42rangef.lxlines -text "X sections :" + entry $id.42rangef.xlines -textvariable $var_graph_xlines -width 7 + pack $id.42rangef.lxlines $id.42rangef.xlines -side left + + frame $id.72rangef + pack $id.72rangef -side top + label $id.72rangef.lylines -text "Y sections :" + entry $id.72rangef.ylines -textvariable $var_graph_ylines -width 7 + pack $id.72rangef.lylines $id.72rangef.ylines -side left + + checkbutton $id.showpdp_colorgrid -text {Show Grid} -variable $var_graph_pdp_colorgrid \ + -anchor w + pack $id.showpdp_colorgrid -side top + + bind $id.42rangef.xlines <KeyPress-Return> [concat pdp_colorgrid_ok $id] + bind $id.72rangef.ylines <KeyPress-Return> [concat pdp_colorgrid_ok $id] + focus $id.42rangef.xlines +} + +############ pdp_colorgrid procedures END -- lluis@artefacte.org ######### |