From b93c31f3cfa5ba457f976685bf3b0e06ce99aa32 Mon Sep 17 00:00:00 2001 From: Gerhard Kitzler Date: Thu, 10 Nov 2016 01:57:46 +0100 Subject: [PATCH] removed tix widgets from ngvisual.tcl --- ng/ngvisual.tcl | 727 +++++++++++++++++++++++++++++------------------- 1 file changed, 441 insertions(+), 286 deletions(-) diff --git a/ng/ngvisual.tcl b/ng/ngvisual.tcl index 4d71e924..acacf5ca 100644 --- a/ng/ngvisual.tcl +++ b/ng/ngvisual.tcl @@ -227,35 +227,48 @@ proc lineplotdialog { } { } - tixOptionMenu $w.filesettings.latestevals -label "Use Evaluate Results: " \ - -options { - label.width 25 - label.anchor e - menubutton.width 40 - } + # tixOptionMenu $w.filesettings.latestevals -label "Use Evaluate Results: " \ + # -options { + # label.width 25 + # label.anchor e + # menubutton.width 40 + # } + # for {set i 0} {$i < [llength ${visoptions.evaluatefilenames}]} {incr i} { + # $w.filesettings.latestevals add command $i \ + # -label "[lindex ${visoptions.evaluatefiledescriptions} $i] ([lindex ${visoptions.evaluatefilenames} $i])" + # } + # $w.filesettings.latestevals config -variable visoptions.lineplotselectedeval + + # pack $w.filesettings.latestevals + ttk::frame $w.filesettings.latestevals + ttk::label $w.filesettings.latestevals.lab -text "Use Evaluate Results: " + ttk::menubutton $w.filesettings.latestevals.but -menu $w.filesettings.latestevals.menu -text "coarse" -width 40 + + menu $w.filesettings.latestevals.menu -tearoff 0 for {set i 0} {$i < [llength ${visoptions.evaluatefilenames}]} {incr i} { - $w.filesettings.latestevals add command $i \ - -label "[lindex ${visoptions.evaluatefiledescriptions} $i] ([lindex ${visoptions.evaluatefilenames} $i])" + $w.filesettings.latestevals.menu add command -label $i\ + -command "set visoptions.lineplotselectedeval $i ; $w.filesettings.latestevals.but configure -text \"[lindex ${visoptions.evaluatefiledescriptions} $i] ([lindex ${visoptions.evaluatefilenames} $i])\"" } - $w.filesettings.latestevals config -variable visoptions.lineplotselectedeval + $w.filesettings.latestevals.menu invoke ${visoptions.lineplotselectedeval} + + grid $w.filesettings.latestevals.lab $w.filesettings.latestevals.but -sticky nw pack $w.filesettings.latestevals - - frame $w.filesettings.sfn + ttk::frame $w.filesettings.sfn - button $w.filesettings.sfn.bb -text "Browse" \ + ttk::button $w.filesettings.sfn.bb -text "Browse" \ -command { set visoptions.lineplotfile [tk_getOpenFile] } - entry $w.filesettings.sfn.fn -width 50 -relief sunken \ + ttk::entry $w.filesettings.sfn.fn -width 50 \ -textvariable visoptions.lineplotfile pack $w.filesettings.sfn.bb $w.filesettings.sfn.fn -side left pack $w.filesettings.sfn - button $w.filesettings.refresh -text "Refresh" -command { + ttk::button $w.filesettings.refresh -text "Refresh" -command { if { ${visoptions.lineplotselectedeval} != 0} { set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}] } @@ -308,32 +321,61 @@ proc lineplotdialog { } { pack $w.filesettings.refresh - frame $w.filesettings.using + ttk::frame $w.filesettings.using global visoptions.lineplotdatadescr - - tixOptionMenu $w.filesettings.using.xco -label "X-Coord:"\ - -options { - label.width 8 - label.anchor e - menubutton.width 15 - } - for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } { - $w.filesettings.using.xco add command $i -label [lindex ${visoptions.lineplotdatadescr} $i] - } - $w.filesettings.using.xco config -variable visoptions.lineplotusingx - - tixOptionMenu $w.filesettings.using.yco -label "Y-Coord:"\ - -options { - label.width 8 - label.anchor e - menubutton.width 15 - } - for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } { - $w.filesettings.using.yco add command $i -label [lindex ${visoptions.lineplotdatadescr} $i] - } - $w.filesettings.using.yco config -variable visoptions.lineplotusingy + # tixOptionMenu $w.filesettings.using.xco -label "X-Coord:"\ + # -options { + # label.width 8 + # label.anchor e + # menubutton.width 15 + # } + # for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } { + # $w.filesettings.using.xco add command $i -label [lindex ${visoptions.lineplotdatadescr} $i] + # } + + ttk::frame $w.filesettings.using.xco + ttk::label $w.filesettings.using.xco.lab -text "X-Coord:" + ttk::menubutton $w.filesettings.using.xco.but -menu $w.filesettings.using.xco.menu -text "" -width 15 + + menu $w.filesettings.using.xco.menu -tearoff 0 + for {set i 0} {$i < [llength ${visoptions.lineplotdatadescr}]} {incr i} { + $w.filesettings.using.xco.menu add command -label [lindex ${visoptions.lineplotdatadescr} $i]\ + -command "set visoptions.lineplotusingx $i ; $w.filesettings.using.xco.but configure -text \"[lindex ${visoptions.lineplotdatadescr} $i]\"" + } + $w.filesettings.using.xco.menu invoke [lindex ${visoptions.lineplotdatadescr} 0] + + + grid $w.filesettings.using.xco.lab $w.filesettings.using.xco.but -sticky nw + #pack $w.filesettings.using.xco + + + + # $w.filesettings.using.xco config -variable visoptions.lineplotusingx + + # tixOptionMenu $w.filesettings.using.yco -label "Y-Coord:"\ + # -options { + # label.width 8 + # label.anchor e + # menubutton.width 15 + # } + # for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } { + # $w.filesettings.using.yco add command $i -label [lindex ${visoptions.lineplotdatadescr} $i] + # } + # $w.filesettings.using.yco config -variable visoptions.lineplotusingy + ttk::frame $w.filesettings.using.yco + ttk::label $w.filesettings.using.yco.lab -text "Y-Coord:" + ttk::menubutton $w.filesettings.using.yco.but -menu $w.filesettings.using.yco.menu -text "" -width 15 + + menu $w.filesettings.using.yco.menu -tearoff 0 + for {set i 0} {$i < [llength ${visoptions.lineplotdatadescr}]} {incr i} { + $w.filesettings.using.yco.menu add command -label [lindex ${visoptions.lineplotdatadescr} $i]\ + -command "set visoptions.lineplotusingy $i ; $w.filesettings.using.yco.but configure -text \"[lindex ${visoptions.lineplotdatadescr} $i]\"" + } + $w.filesettings.using.yco.menu invoke [lindex ${visoptions.lineplotdatadescr} 0] + grid $w.filesettings.using.yco.lab $w.filesettings.using.yco.but -sticky nw + global visoptions.lineplotxcoordselector global visoptions.lineplotycoordselector set visoptions.lineplotxcoordselector $w.filesettings.using.xco @@ -347,89 +389,136 @@ proc lineplotdialog { } { ttk::frame $w.settings -relief groove -borderwidth 3 ttk::label $w.settings.title -text "\nSettings\n" - pack $w.settings.title + pack $w.settings.title ttk::frame $w.settings.minmax ttk::checkbutton $w.settings.minmax.autoscale -text "Autoscale" -variable visoptions.lineplotautoscale - tixControl $w.settings.minmax.xmin -label "Min. x: " \ - -integer false -variable visoptions.lineplotxmin \ - -options { - entry.width 6 - label.width 8 - label.anchor e - } - tixControl $w.settings.minmax.xmax -label "Max. x: " \ - -integer false -variable visoptions.lineplotxmax \ - -options { - entry.width 6 - label.width 8 - label.anchor e - } - tixControl $w.settings.minmax.ymin -label "Min. y: " \ - -integer false -variable visoptions.lineplotymin \ - -options { - entry.width 6 - label.width 8 - label.anchor e - } - tixControl $w.settings.minmax.ymax -label "Max. y: " \ - -integer false -variable visoptions.lineplotymax \ - -options { - entry.width 6 - label.width 8 - label.anchor e - } - + # tixControl $w.settings.minmax.xmin -label "Min. x: " \ + # -integer false -variable visoptions.lineplotxmin \ + # -options { + # entry.width 6 + # label.width 8 + # label.anchor e + # } + ttk::frame $w.settings.minmax.xmin + ttk::label $w.settings.minmax.xmin.label -text "Min. x: " + ttk::spinbox $w.settings.minmax.xmin.sp -textvariable visoptions.lineplotxmin -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \ + -invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9 + # tixControl $w.settings.minmax.xmax -label "Max. x: " \ + # -integer false -variable visoptions.lineplotxmax \ + # -options { + # entry.width 6 + # label.width 8 + # label.anchor e + # } + ttk::frame $w.settings.minmax.xmax + ttk::label $w.settings.minmax.xmax.label -text "Max. x: " + ttk::spinbox $w.settings.minmax.xmax.sp -textvariable visoptions.lineplotxmax -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \ + -invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9 + + # tixControl $w.settings.minmax.ymin -label "Min. y: " \ + # -integer false -variable visoptions.lineplotymin \ + # -options { + # entry.width 6 + # label.width 8 + # label.anchor e + # } + ttk::frame $w.settings.minmax.ymin + ttk::label $w.settings.minmax.ymin.label -text "Min. y: " + ttk::spinbox $w.settings.minmax.ymin.sp -textvariable visoptions.lineplotymin -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \ + -invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9 + + # tixControl $w.settings.minmax.ymax -label "Max. y: " \ + # -integer false -variable visoptions.lineplotymax \ + # -options { + # entry.width 6 + # label.width 8 + # label.anchor e + # } + ttk::frame $w.settings.minmax.ymax + ttk::label $w.settings.minmax.ymax.label -text "Max. y: " + ttk::spinbox $w.settings.minmax.ymax.sp -textvariable visoptions.lineplotymax -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \ + -invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9 + pack $w.settings.minmax.xmin.label $w.settings.minmax.xmin.sp + pack $w.settings.minmax.xmax.label $w.settings.minmax.xmax.sp + pack $w.settings.minmax.ymin.label $w.settings.minmax.ymin.sp + pack $w.settings.minmax.ymax.label $w.settings.minmax.ymax.sp pack $w.settings.minmax.autoscale $w.settings.minmax.xmin $w.settings.minmax.xmax \ $w.settings.minmax.ymin $w.settings.minmax.ymax -side left pack $w.settings.minmax - label $w.settings.empty1 -text "" + ttk::label $w.settings.empty1 -text "" pack $w.settings.empty1 - frame $w.settings.plotsize + ttk::frame $w.settings.plotsize - tixControl $w.settings.plotsize.xsize -label "Plotsize x: "\ - -integer true -variable visoptions.lineplotsizex \ - -options { - entry.width 6 - label.width 13 - label.anchor e - } - tixControl $w.settings.plotsize.ysize -label "y: "\ - -integer true -variable visoptions.lineplotsizey \ - -options { - entry.width 6 - label.width 3 - label.anchor e - } + # tixControl $w.settings.plotsize.xsize -label "Plotsize x: "\ + # -integer true -variable visoptions.lineplotsizex \ + # -options { + # entry.width 6 + # label.width 13 + # label.anchor e + # } + + ttk::frame $w.settings.plotsize.xsize + ttk::label $w.settings.plotsize.xsize.label -text "Plotsize x: " + ttk::spinbox $w.settings.plotsize.xsize.sp -textvariable visoptions.lineplotsizex -width 6 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \ + -invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9 + pack $w.settings.plotsize.xsize.label $w.settings.plotsize.xsize.sp + + # tixControl $w.settings.plotsize.ysize -label "y: "\ + # -integer true -variable visoptions.lineplotsizey \ + # -options { + # entry.width 6 + # label.width 3 + # label.anchor e + # } + + ttk::frame $w.settings.plotsize.ysize + ttk::label $w.settings.plotsize.ysize.label -text "Plotsize y: " + ttk::spinbox $w.settings.plotsize.ysize.sp -textvariable visoptions.lineplotsizey -width 6 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \ + -invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9 + pack $w.settings.plotsize.ysize.label $w.settings.plotsize.ysize.sp pack $w.settings.plotsize.xsize $w.settings.plotsize.ysize -side left pack $w.settings.plotsize - label $w.settings.empty2 -text "" + ttk::label $w.settings.empty2 -text "" pack $w.settings.empty2 + # tixOptionMenu $w.settings.color -label "Linecolor: " \ + # -options { + # label.width 19 + # label.anchor e + # menubutton.width 15 + # } + # foreach step { red black blue green yellow } { + # $w.settings.color add command $step -label $step + # } + # $w.settings.color config -variable visoptions.lineplotcolor + ttk::frame $w.settings.color + ttk::label $w.settings.color.lab -text "Linecolor: " + ttk::menubutton $w.settings.color.but -menu $w.settings.color.menu -text "" -width 15 - tixOptionMenu $w.settings.color -label "Linecolor: " \ - -options { - label.width 19 - label.anchor e - menubutton.width 15 - } + menu $w.settings.color.menu -tearoff 0 foreach step { red black blue green yellow } { - $w.settings.color add command $step -label $step - } - $w.settings.color config -variable visoptions.lineplotcolor - + $w.settings.color.menu add command -label $step -command "set visoptions.lineplotcolor $step; $w.settings.color.but configure -text \"$step\"" + } + # for {set i 0} {$i < [llength ${visoptions.lineplotdatadescr}]} {incr i} { + # $w.filesettings.using.yco.menu add command -label [lindex ${visoptions.lineplotdatadescr} $i]\ + # -command "set visoptions.lineplotusingy $i ; $w.filesettings.using.yco.but configure -text \"[lindex ${visoptions.lineplotdatadescr} $i]\"" + # } + $w.settings.color.menu invoke "red" + grid $w.settings.color.lab $w.settings.color.but -sticky nw + pack $w.settings.color - pack $w.settings + pack $w.settings -fill x set datax "" set datay "" @@ -438,24 +527,33 @@ proc lineplotdialog { } { set ymin 0 set ymax 0 - frame $w.plots -relief groove -borderwidth 3 + ttk::frame $w.plots -relief groove -borderwidth 3 - tixOptionMenu $w.plots.selplot -label "Selected Plot: " \ - -options { - label.width 19 - label.anchor e - menubutton.width 15 - } - $w.plots.selplot add command none -label "None" + # tixOptionMenu $w.plots.selplot -label "Selected Plot: " \ + # -options { + # label.width 19 + # label.anchor e + # menubutton.width 15 + # } + # $w.plots.selplot add command none -label "None" - $w.plots.selplot config -variable visoptions.lineplotselected + # $w.plots.selplot config -variable visoptions.lineplotselected + ttk::frame $w.plots.selplot + ttk::label $w.plots.selplot.lab -text "Linecolor: " + ttk::menubutton $w.plots.selplot.but -menu $w.plots.selplot.menu -text "" -width 15 + + menu $w.plots.selplot.menu -tearoff 0 + $w.plots.selplot.menu add command -label "None" -command "set visoptions.lineplotselected \"None\"; $w.plots.selplot.but configure -text \"None\"" + grid $w.plots.selplot.lab $w.plots.selplot.but -sticky nw + $w.plots.selplot.menu invoke "None" + global visoptions.lineplotselector - set visoptions.lineplotselector $w.plots.selplot + set visoptions.lineplotselector $w.plots.selplot.menu - button $w.plots.new -text "Generate New Plot" -command { + ttk::button $w.plots.new -text "Generate New Plot" -command { if { ${visoptions.lineplotselectedeval} != 0} { set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}] } @@ -491,7 +589,7 @@ proc lineplotdialog { } { addplotline $ident $datax $datay $plotinfo ${visoptions.lineplotcolor} } - button $w.plots.addto -text "Add to Selected Plot" -command { + ttk::button $w.plots.addto -text "Add to Selected Plot" -command { if { ${visoptions.lineplotselectedeval} != 0} { set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}] } @@ -516,7 +614,7 @@ proc lineplotdialog { } { - button $w.close -text "Close" -command "destroy $w" + ttk::button $w.close -text "Close" -command "destroy $w" pack $w.close wm withdraw $w @@ -629,13 +727,35 @@ proc fieldlinesdialog { } { - tixOptionMenu $f.vecfun -label "Vector Function: " \ - -options { - label.width 18 - label.anchor e - menubutton.width 12 - } - $f.vecfun add command none -label None + # tixOptionMenu $f.vecfun -label "Vector Function: " \ + # -options { + # label.width 18 + # label.anchor e + # menubutton.width 12 + # } + # $f.vecfun add command none -label None + # for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } { + # set fname [Ng_Vis_Field getfieldname $i] + # set fcomp [Ng_Vis_Field getfieldcomponents $i] + # set iscomplex [Ng_Vis_Field iscomplex $i] + # set sdim [Ng_Vis_Field getdimension] + # if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] } + # if { ($fcomp == $sdim) || ($fcomp == 3) } { + # $f.vecfun add command $fname -label $fname + # } + # } + # $f.vecfun configure -variable visoptions.fieldlinesvecfunction + # $f.vecfun configure -command { Ng_Vis_Set parameters; redraw } + + ttk::frame $f.vecfun + ttk::label $f.vecfun.lab -text "Vector Function: " + ttk::menubutton $f.vecfun.but -menu $f.vecfun.menu -text "" -width 12 + + menu $f.vecfun.menu -tearoff 0 + # for {set i 0} {$i < [llength ${visoptions.evaluatefilenames}]} {incr i} { + # $w.filesettings.latestevals.menu add command -label $i\ + # -command "set visoptions.lineplotselectedeval $i ; $w.filesettings.latestevals.but configure -text \"[lindex ${visoptions.evaluatefiledescriptions} $i] ([lindex ${visoptions.evaluatefilenames} $i])\"" + # } for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } { set fname [Ng_Vis_Field getfieldname $i] set fcomp [Ng_Vis_Field getfieldcomponents $i] @@ -643,12 +763,11 @@ proc fieldlinesdialog { } { set sdim [Ng_Vis_Field getdimension] if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] } if { ($fcomp == $sdim) || ($fcomp == 3) } { - $f.vecfun add command $fname -label $fname - } - } - $f.vecfun configure -variable visoptions.fieldlinesvecfunction - $f.vecfun configure -command { Ng_Vis_Set parameters; redraw } + $f.vecfun.menu add command -label $fname -command "set visoptions.fieldlinesvecfunction $fname;Ng_Vis_Set parameters; redraw;$f.vecfun.but configure -text \"$fname\" " + } + } + grid $f.vecfun.lab $f.vecfun.but -sticky nw pack $f.vecfun @@ -784,30 +903,48 @@ proc fieldlinesdialog { } { frame $g.linesettings -relief groove -borderwidth 3 label $g.linesettings.title -text "\nLine Settings\n" - tixControl $g.linesettings.length -label "rel. Length: " -integer false \ - -variable visoptions.fieldlineslength -min 0.00001 -max 10000 -step 0.1 \ - -options { - entry.width 6 - label.width 25 - label.anchor e - } + # tixControl $g.linesettings.length -label "rel. Length: " -integer false \ + # -variable visoptions.fieldlineslength -min 0.00001 -max 10000 -step 0.1 \ + # -options { + # entry.width 6 + # label.width 25 + # label.anchor e + # } - tixControl $g.linesettings.maxpoints -label "max. Points: " -integer true \ - -variable visoptions.fieldlinesmaxpoints -min 0 -max 10000 -step 1 \ - -options { - entry.width 6 - label.width 25 - label.anchor e - } - - tixControl $g.linesettings.thick -label "rel. Thickness: " -integer false \ - -variable visoptions.fieldlinesthickness -min 1e-10 -max 0.5 -step 0.001 \ - -options { - entry.width 6 - label.width 25 - label.anchor e - } + ttk::frame $g.linesettings.length + ttk::label $g.linesettings.length.lab -text "rel. Length: " + ttk::spinbox $g.linesettings.length.sp -textvariable visoptions.fieldlineslength -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 4" \ + -invalidcommand "my_invalidspinbox %W" -from 0.00001 -to 10000 + grid $g.linesettings.length.lab $g.linesettings.length.sp -sticky nw + + # tixControl $g.linesettings.maxpoints -label "max. Points: " -integer true \ + # -variable visoptions.fieldlinesmaxpoints -min 0 -max 10000 -step 1 \ + # -options { + # entry.width 6 + # label.width 25 + # label.anchor e + # } + ttk::frame $g.linesettings.maxpoints + ttk::label $g.linesettings.maxpoints.lab -text "max. Points: " + ttk::spinbox $g.linesettings.maxpoints.sp -textvariable visoptions.fieldlinesmaxpoints -width 6 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \ + -invalidcommand "my_invalidspinbox %W" -from 0 -to 10000 + grid $g.linesettings.maxpoints.lab $g.linesettings.maxpoints.sp -sticky nw + + # tixControl $g.linesettings.thick -label "rel. Thickness: " -integer false \ + # -variable visoptions.fieldlinesthickness -min 1e-10 -max 0.5 -step 0.001 \ + # -options { + # entry.width 6 + # label.width 25 + # label.anchor e + # } + + ttk::frame $g.linesettings.thick + ttk::label $g.linesettings.thick.lab -text "rel. Thickness: " + ttk::spinbox $g.linesettings.thick.sp -textvariable visoptions.fieldlinesthickness -width 6 -increment 0.001 -validate focus -validatecommand "my_validatespinbox %W %P 5" \ + -invalidcommand "my_invalidspinbox %W" -from 1e-10 -to 0.5 + grid $g.linesettings.thick.lab $g.linesettings.thick.sp -stick nw + pack $g.linesettings.title $g.linesettings.length $g.linesettings.maxpoints $g.linesettings.thick pack $g.linesettings -fill x -ipady 3 @@ -820,28 +957,46 @@ proc fieldlinesdialog { } { frame $g.odesettings -relief groove -borderwidth 3 label $g.odesettings.title -text "\nODE Settings\n" - tixControl $g.odesettings.tol -label "rel. Tolerance: " -integer false \ - -variable visoptions.fieldlinestolerance -min 0.00001 -max 1 -step 0.01 \ - -options { - entry.width 6 - label.width 25 - label.anchor e - } + # tixControl $g.odesettings.tol -label "rel. Tolerance: " -integer false \ + # -variable visoptions.fieldlinestolerance -min 0.00001 -max 1 -step 0.01 \ + # -options { + # entry.width 6 + # label.width 25 + # label.anchor e + # } + + ttk::frame $g.odesettings.tol + ttk::label $g.odesettings.tol.lab -text "rel. Thickness: " + ttk::spinbox $g.odesettings.tol.sp -textvariable visoptions.fieldlinestolerance -width 6 -increment 0.01 -validate focus -validatecommand "my_validatespinbox %W %P 2" \ + -invalidcommand "my_invalidspinbox %W" -from 0.00001 -to 1 + grid $g.odesettings.tol.lab $g.odesettings.tol.sp -stick nw - - tixOptionMenu $g.odesettings.rktype -label "RK-Type " \ - -options { - label.width 20 - label.anchor e - menubutton.width 25 - } - $g.odesettings.rktype add command euler -label "Euler, order 1" - $g.odesettings.rktype add command eulercauchy -label "Euler-Cauchy, order 2" - $g.odesettings.rktype add command simpson -label "Simpson, order 3" - $g.odesettings.rktype add command crungekutta -label "classical Runge-Kutta, order 4" - $g.odesettings.rktype configure -variable visoptions.fieldlinesrktype - $g.odesettings.rktype configure -command { Ng_Vis_Set parameters; redraw } + + # tixOptionMenu $g.odesettings.rktype -label "RK-Type " \ + # -options { + # label.width 20 + # label.anchor e + # menubutton.width 25 + # } + + # $g.odesettings.rktype add command euler -label "Euler, order 1" + # $g.odesettings.rktype add command eulercauchy -label "Euler-Cauchy, order 2" + # $g.odesettings.rktype add command simpson -label "Simpson, order 3" + # $g.odesettings.rktype add command crungekutta -label "classical Runge-Kutta, order 4" + # $g.odesettings.rktype configure -variable visoptions.fieldlinesrktype + # $g.odesettings.rktype configure -command { Ng_Vis_Set parameters; redraw } + ttk::frame $g.odesettings.rktype + ttk::label $g.odesettings.rktype.lab -text "RK-Type " + ttk::menubutton $g.odesettings.rktype.but -menu $g.odesettings.rktype.menu -text "" -width 25 + + menu $g.odesettings.rktype.menu -tearoff 0 + $g.odesettings.rktype.menu add command -label "Euler, order 1" -command "set visoptions.fieldlinesrktype \"euler\" ;Ng_Vis_Set parameters; redraw;$g.odesettings.rktype.but configure -text \"Euler,order 1\" " + $g.odesettings.rktype.menu add command -label "Euler-Cauchy, order 2" -command "set visoptions.fieldlinesrktype \"eulercauchy\" ;Ng_Vis_Set parameters; redraw;$g.odesettings.rktype.but configure -text \"Euler-Cauchy,order 2\" " + $g.odesettings.rktype.menu add command -label "Simpson, order 3" -command "set visoptions.fieldlinesrktype \"simpson\" ;Ng_Vis_Set parameters; redraw;$g.odesettings.rktype.but configure -text \"Simpson,order 3\"" + $g.odesettings.rktype.menu add command -label "classical Runge-Kutta, order 4" -command "set visoptions.fieldlinesrktype \"crungekutta\" ;Ng_Vis_Set parameters; redraw; $g.odesettings.rktype.but configure -text \"classical Runge-Kutta,order 4\"" + $g.odesettings.rktype.menu invoke "classical Runge-Kutta, order 4" + grid $g.odesettings.rktype.lab $g.odesettings.rktype.but -sticky nw pack $g.odesettings.title $g.odesettings.tol $g.odesettings.rktype pack $g.odesettings -fill x -ipady 3 @@ -1496,177 +1651,177 @@ proc visual_dialog { } { -proc reset_visual_dialog { } { +# proc reset_visual_dialog { } { - set w .visoptions_dlg + # set w .visoptions_dlg - if {[winfo exists .visoptions_dlg] == 1} { + # if {[winfo exists .visoptions_dlg] == 1} { - destroy $w.scalfun $w.vecfun $w.evaluate $w.multidimcomp - destroy $w.imaginary $w.logscale $w.texframe.usetexture $w.texframe.lintexture - destroy $w.texframe - destroy $w.invcolor $w.redrawperiodic - destroy $w.bu -pady 5 - destroy $w.bu.showsol $w.bu.clipping $w.bu.fieldlines $w.bu.lineplot $w.bu.done -side left -expand yes + # destroy $w.scalfun $w.vecfun $w.evaluate $w.multidimcomp + # destroy $w.imaginary $w.logscale $w.texframe.usetexture $w.texframe.lintexture + # destroy $w.texframe + # destroy $w.invcolor $w.redrawperiodic + # destroy $w.bu -pady 5 + # destroy $w.bu.showsol $w.bu.clipping $w.bu.fieldlines $w.bu.lineplot $w.bu.done -side left -expand yes - checkbutton $w.imaginary -text "Imaginary Part" \ - -variable visoptions.imaginary \ - -command { Ng_Vis_Set parameters; redraw } + # checkbutton $w.imaginary -text "Imaginary Part" \ + # -variable visoptions.imaginary \ + # -command { Ng_Vis_Set parameters; redraw } - frame $w.texframe + # frame $w.texframe - checkbutton $w.texframe.usetexture -text "Use Textures (" \ - -variable visoptions.usetexture \ - -command { Ng_Vis_Set parameters; redraw } + # checkbutton $w.texframe.usetexture -text "Use Textures (" \ + # -variable visoptions.usetexture \ + # -command { Ng_Vis_Set parameters; redraw } - checkbutton $w.texframe.lintexture -text "Linear )" \ - -variable visoptions.lineartexture \ - -command { Ng_Vis_Set parameters; redraw } + # checkbutton $w.texframe.lintexture -text "Linear )" \ + # -variable visoptions.lineartexture \ + # -command { Ng_Vis_Set parameters; redraw } - checkbutton $w.invcolor -text "Inverse Color" \ - -variable visoptions.invcolor \ - -command { Ng_Vis_Set parameters; redraw } + # checkbutton $w.invcolor -text "Inverse Color" \ + # -variable visoptions.invcolor \ + # -command { Ng_Vis_Set parameters; redraw } - checkbutton $w.logscale -text "Log Scale" \ - -variable visoptions.logscale \ - -command { Ng_Vis_Set parameters; redraw } + # checkbutton $w.logscale -text "Log Scale" \ + # -variable visoptions.logscale \ + # -command { Ng_Vis_Set parameters; redraw } - checkbutton $w.redrawperiodic -text "Animate periodic" \ - -variable visoptions.redrawperiodic \ - -command { - redrawperiodic - Ng_Vis_Set parameters; - redraw - } + # checkbutton $w.redrawperiodic -text "Animate periodic" \ + # -variable visoptions.redrawperiodic \ + # -command { + # redrawperiodic + # Ng_Vis_Set parameters; + # redraw + # } - tixOptionMenu $w.scalfun -label "Scalar Function: " \ - -options { - label.width 18 - label.anchor e - menubutton.width 12 - } + # tixOptionMenu $w.scalfun -label "Scalar Function: " \ + # -options { + # label.width 18 + # label.anchor e + # menubutton.width 12 + # } - tixOptionMenu $w.vecfun -label "Vector Function: " \ - -options { - label.width 18 - label.anchor e - menubutton.width 12 - } + # tixOptionMenu $w.vecfun -label "Vector Function: " \ + # -options { + # label.width 18 + # label.anchor e + # menubutton.width 12 + # } - $w.scalfun add command none -label None - for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } { - set fname [Ng_Vis_Field getfieldname $i] - set fcomp [Ng_Vis_Field getfieldcomponents $i] - if { $fcomp == 1 } { - $w.scalfun add command $fname.1 -label $fname - } { - for { set j 1 } { $j <= $fcomp } { incr j } { - $w.scalfun add command $fname.$j -label "$fname ($j)" - } - $w.scalfun add command $fname.0 -label "func ($fname)" - } - } + # $w.scalfun add command none -label None + # for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } { + # set fname [Ng_Vis_Field getfieldname $i] + # set fcomp [Ng_Vis_Field getfieldcomponents $i] + # if { $fcomp == 1 } { + # $w.scalfun add command $fname.1 -label $fname + # } { + # for { set j 1 } { $j <= $fcomp } { incr j } { + # $w.scalfun add command $fname.$j -label "$fname ($j)" + # } + # $w.scalfun add command $fname.0 -label "func ($fname)" + # } + # } - $w.vecfun add command none -label None - for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } { - set fname [Ng_Vis_Field getfieldname $i] - set fcomp [Ng_Vis_Field getfieldcomponents $i] - set iscomplex [Ng_Vis_Field iscomplex $i] - set sdim [Ng_Vis_Field getdimension] - if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] } - if { ($fcomp == $sdim) || ($fcomp == 3) } { - $w.vecfun add command $fname -label $fname - } - } + # $w.vecfun add command none -label None + # for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } { + # set fname [Ng_Vis_Field getfieldname $i] + # set fcomp [Ng_Vis_Field getfieldcomponents $i] + # set iscomplex [Ng_Vis_Field iscomplex $i] + # set sdim [Ng_Vis_Field getdimension] + # if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] } + # if { ($fcomp == $sdim) || ($fcomp == 3) } { + # $w.vecfun add command $fname -label $fname + # } + # } - $w.scalfun configure -variable visoptions.scalfunction - $w.scalfun configure -command { Ng_Vis_Set parameters; redraw } - $w.vecfun configure -variable visoptions.vecfunction - $w.vecfun configure -command { Ng_Vis_Set parameters; redraw } + # $w.scalfun configure -variable visoptions.scalfunction + # $w.scalfun configure -command { Ng_Vis_Set parameters; redraw } + # $w.vecfun configure -variable visoptions.vecfunction + # $w.vecfun configure -command { Ng_Vis_Set parameters; redraw } -# puts "sclfunction = ${visoptions.scalfunction}" +# # puts "sclfunction = ${visoptions.scalfunction}" - tixOptionMenu $w.evaluate -label "Evaluate: " \ - -options { - label.width 18 - label.anchor e - menubutton.width 12 - } - $w.evaluate add command abs -label "|.|" - $w.evaluate add command abstens -label "|tensor|" - $w.evaluate add command mises -label "Mises" - $w.evaluate add command main -label "Main" - $w.evaluate configure -variable visoptions.evaluate - $w.evaluate configure -command { - Ng_Vis_Set parameters; - redraw - } + # tixOptionMenu $w.evaluate -label "Evaluate: " \ + # -options { + # label.width 18 + # label.anchor e + # menubutton.width 12 + # } + # $w.evaluate add command abs -label "|.|" + # $w.evaluate add command abstens -label "|tensor|" + # $w.evaluate add command mises -label "Mises" + # $w.evaluate add command main -label "Main" + # $w.evaluate configure -variable visoptions.evaluate + # $w.evaluate configure -command { + # Ng_Vis_Set parameters; + # redraw + # } - pack $w.scalfun $w.vecfun $w.evaluate + # pack $w.scalfun $w.vecfun $w.evaluate - tixControl $w.multidimcomp -label "multidim-component: " -integer true \ - -variable visoptions.multidimcomponent -min 0 \ - -command { Ng_Vis_Set parameters; redraw } \ - -options { - entry.width 6 - label.width 18 - label.anchor e - } + # tixControl $w.multidimcomp -label "multidim-component: " -integer true \ + # -variable visoptions.multidimcomponent -min 0 \ + # -command { Ng_Vis_Set parameters; redraw } \ + # -options { + # entry.width 6 + # label.width 18 + # label.anchor e + # } - pack $w.multidimcomp + # pack $w.multidimcomp - pack $w.imaginary $w.logscale $w.texframe $w.invcolor $w.redrawperiodic - pack $w.texframe.usetexture $w.texframe.lintexture -side left -expand yes + # pack $w.imaginary $w.logscale $w.texframe $w.invcolor $w.redrawperiodic + # pack $w.texframe.usetexture $w.texframe.lintexture -side left -expand yes - frame $w.bu - pack $w.bu -pady 5 + # frame $w.bu + # pack $w.bu -pady 5 - button $w.bu.showsol -text "Show Solution" -command { - set selectvisual solution - Ng_SetVisParameters - redraw - } - button $w.bu.clipping -text "Clipping" -command { - clippingdialog; - } - button $w.bu.fieldlines -text "Fieldlines" -command { - fieldlinesdialog; - } + # button $w.bu.showsol -text "Show Solution" -command { + # set selectvisual solution + # Ng_SetVisParameters + # redraw + # } + # button $w.bu.clipping -text "Clipping" -command { + # clippingdialog; + # } + # button $w.bu.fieldlines -text "Fieldlines" -command { + # fieldlinesdialog; + # } - button $w.bu.lineplot -text "2D Lineplot" -command { - lineplotdialog; - } + # button $w.bu.lineplot -text "2D Lineplot" -command { + # lineplotdialog; + # } - button $w.bu.done -text "Close" -command { - destroy .visoptions_dlg - } + # button $w.bu.done -text "Close" -command { + # destroy .visoptions_dlg + # } - pack $w.bu.showsol $w.bu.clipping $w.bu.fieldlines $w.bu.lineplot $w.bu.done -side left -expand yes + # pack $w.bu.showsol $w.bu.clipping $w.bu.fieldlines $w.bu.lineplot $w.bu.done -side left -expand yes - wm withdraw $w - wm deiconify $w + # wm withdraw $w + # wm deiconify $w - } + # } -} +# }