From 3148f9f94577958e208dfcfbdbf38e5bc6bf5145 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Fri, 21 Sep 2007 21:42:17 +0000 Subject: new release: added load/save/more options svn path=/trunk/externals/ffext/; revision=8745 --- tracker/tracker.tk | 125 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 70 insertions(+), 55 deletions(-) (limited to 'tracker/tracker.tk') diff --git a/tracker/tracker.tk b/tracker/tracker.tk index 9d2a844..cd21b9f 100644 --- a/tracker/tracker.tk +++ b/tracker/tracker.tk @@ -1,76 +1,91 @@ proc tracker_apply {id} { # strip "." from the TK id to make a variable name suffix - set vid [string trimleft $id .] + set vid [string trimleft $id .] # for each variable, make a local variable to hold its name... - set var_graph_width [concat graph_width_$vid] - global $var_graph_width - set var_graph_height [concat graph_height_$vid] - global $var_graph_height + set var_graph_width [concat graph_width_$vid] + global $var_graph_width + set var_graph_height [concat graph_height_$vid] + global $var_graph_height + set var_saveflag [concat saveflag_$vid] + global $var_saveflag - set cmd [concat $id dialog \ - [eval concat $$var_graph_width] \ - [eval concat $$var_graph_height] \ - \;] - #puts stderr $cmd - pd $cmd + set cmd [concat $id resize \ + [eval concat $$var_graph_height] \ + [eval concat $$var_graph_width] \ + \;] + pd $cmd + + set cmd [concat $id set_saveflag \ + [eval concat $$var_saveflag] \ + \;] + pd $cmd } proc tracker_cancel {id} { - set cmd [concat $id cancel \;] - #puts stderr $cmd - pd $cmd + set cmd [concat $id cancel \;] + #puts stderr $cmd + pd $cmd } proc tracker_ok {id} { - tracker_apply $id - tracker_cancel $id + tracker_apply $id + tracker_cancel $id } -proc pdtk_tracker_dialog {id width height} { - set vid [string trimleft $id .] +proc pdtk_tracker_dialog {id width height saveflag} { + set vid [string trimleft $id .] - set var_graph_width [concat graph_width_$vid] - global $var_graph_width - set var_graph_height [concat graph_height_$vid] - global $var_graph_height + set var_graph_width [concat graph_width_$vid] + global $var_graph_width + set var_graph_height [concat graph_height_$vid] + global $var_graph_height + set var_saveflag [concat saveflag_$vid] + global $var_saveflag - set $var_graph_width $width - set $var_graph_height $height + set $var_graph_width $width + set $var_graph_height $height + set $var_saveflag $saveflag - toplevel $id - wm title $id {tracker} - wm protocol $id WM_DELETE_WINDOW [concat tracker_cancel $id] + toplevel $id + wm title $id {tracker} + wm protocol $id WM_DELETE_WINDOW [concat tracker_cancel $id] - label $id.label -text {GRID PROPERTIES} - pack $id.label -side top + label $id.label -text {GRID 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 "tracker_cancel $id" - button $id.buttonframe.apply -text {Apply}\ - -command "tracker_apply $id" - button $id.buttonframe.ok -text {OK}\ - -command "tracker_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.buttonframe + pack $id.buttonframe -side bottom -fill x -pady 2m + button $id.buttonframe.cancel -text {Cancel}\ + -command "tracker_cancel $id" + button $id.buttonframe.apply -text {Apply}\ + -command "tracker_apply $id" + button $id.buttonframe.ok -text {OK}\ + -command "tracker_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.1rangef - pack $id.1rangef -side top - label $id.1rangef.lwidth -text "Width :" - #entry $id.1rangef.width -textvar $var_graph_width -width 7 - spinbox $id.1rangef.width -textvariable $var_graph_width -width 7 -from 1 -to 99 -increment 1 - pack $id.1rangef.lwidth $id.1rangef.width -side left + frame $id.1rangef + pack $id.1rangef -side top + label $id.1rangef.lwidth -text "Width :" + #entry $id.1rangef.width -textvar $var_graph_width -width 7 + spinbox $id.1rangef.width -textvariable $var_graph_width -width 7 -from 1 -to 99 -increment 1 + pack $id.1rangef.lwidth $id.1rangef.width -side left - frame $id.2rangef - pack $id.2rangef -side top - label $id.2rangef.lheight -text "Height :" - #entry $id.2rangef.height -textvar $var_graph_height -width 7 - spinbox $id.2rangef.height -textvariable $var_graph_height -width 7 -from 1 -to 99 -increment 1 - pack $id.2rangef.lheight $id.2rangef.height -side left + frame $id.2rangef + pack $id.2rangef -side top + label $id.2rangef.lheight -text "Height :" + #entry $id.2rangef.height -textvar $var_graph_height -width 7 + spinbox $id.2rangef.height -textvariable $var_graph_height -width 7 -from 1 -to 99 -increment 1 + pack $id.2rangef.lheight $id.2rangef.height -side left + + frame $id.3rangef + pack $id.3rangef -side top + label $id.3rangef.lsaveflag -text "" + checkbutton $id.3rangef.saveflag -variable $var_saveflag -text "save contents" + pack $id.3rangef.lsaveflag $id.3rangef.saveflag -side left - bind $id.1rangef.width [concat tracker_ok $id] - bind $id.2rangef.height [concat tracker_ok $id] - focus $id.1rangef.width + bind $id.1rangef.width [concat tracker_ok $id] + bind $id.2rangef.height [concat tracker_ok $id] + focus $id.1rangef.width } -- cgit v1.2.1