removed tix widgets from ngvisual.tcl

This commit is contained in:
Gerhard Kitzler 2016-11-10 01:57:46 +01:00
parent 9d66a0f515
commit b93c31f3cf

View File

@ -227,35 +227,48 @@ proc lineplotdialog { } {
} }
tixOptionMenu $w.filesettings.latestevals -label "Use Evaluate Results: " \ # tixOptionMenu $w.filesettings.latestevals -label "Use Evaluate Results: " \
-options { # -options {
label.width 25 # label.width 25
label.anchor e # label.anchor e
menubutton.width 40 # 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} { for {set i 0} {$i < [llength ${visoptions.evaluatefilenames}]} {incr i} {
$w.filesettings.latestevals add command $i \ $w.filesettings.latestevals.menu add command -label $i\
-label "[lindex ${visoptions.evaluatefiledescriptions} $i] ([lindex ${visoptions.evaluatefilenames} $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 pack $w.filesettings.latestevals
ttk::frame $w.filesettings.sfn
frame $w.filesettings.sfn ttk::button $w.filesettings.sfn.bb -text "Browse" \
button $w.filesettings.sfn.bb -text "Browse" \
-command { set visoptions.lineplotfile [tk_getOpenFile] } -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 -textvariable visoptions.lineplotfile
pack $w.filesettings.sfn.bb $w.filesettings.sfn.fn -side left pack $w.filesettings.sfn.bb $w.filesettings.sfn.fn -side left
pack $w.filesettings.sfn pack $w.filesettings.sfn
button $w.filesettings.refresh -text "Refresh" -command { ttk::button $w.filesettings.refresh -text "Refresh" -command {
if { ${visoptions.lineplotselectedeval} != 0} { if { ${visoptions.lineplotselectedeval} != 0} {
set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}] set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}]
} }
@ -308,31 +321,60 @@ proc lineplotdialog { } {
pack $w.filesettings.refresh pack $w.filesettings.refresh
frame $w.filesettings.using ttk::frame $w.filesettings.using
global visoptions.lineplotdatadescr global visoptions.lineplotdatadescr
tixOptionMenu $w.filesettings.using.xco -label "X-Coord:"\ # tixOptionMenu $w.filesettings.using.xco -label "X-Coord:"\
-options { # -options {
label.width 8 # label.width 8
label.anchor e # label.anchor e
menubutton.width 15 # menubutton.width 15
} # }
for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } { # 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 add command $i -label [lindex ${visoptions.lineplotdatadescr} $i]
} # }
$w.filesettings.using.xco config -variable visoptions.lineplotusingx
tixOptionMenu $w.filesettings.using.yco -label "Y-Coord:"\ ttk::frame $w.filesettings.using.xco
-options { ttk::label $w.filesettings.using.xco.lab -text "X-Coord:"
label.width 8 ttk::menubutton $w.filesettings.using.xco.but -menu $w.filesettings.using.xco.menu -text "" -width 15
label.anchor e
menubutton.width 15 menu $w.filesettings.using.xco.menu -tearoff 0
} for {set i 0} {$i < [llength ${visoptions.lineplotdatadescr}]} {incr i} {
for { set i 0 } { $i < [llength ${visoptions.lineplotdatadescr}] } { incr i } { $w.filesettings.using.xco.menu add command -label [lindex ${visoptions.lineplotdatadescr} $i]\
$w.filesettings.using.yco add command $i -label [lindex ${visoptions.lineplotdatadescr} $i] -command "set visoptions.lineplotusingx $i ; $w.filesettings.using.xco.but configure -text \"[lindex ${visoptions.lineplotdatadescr} $i]\""
} }
$w.filesettings.using.yco config -variable visoptions.lineplotusingy $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.lineplotxcoordselector
global visoptions.lineplotycoordselector global visoptions.lineplotycoordselector
@ -351,85 +393,132 @@ proc lineplotdialog { } {
ttk::frame $w.settings.minmax ttk::frame $w.settings.minmax
ttk::checkbutton $w.settings.minmax.autoscale -text "Autoscale" -variable visoptions.lineplotautoscale ttk::checkbutton $w.settings.minmax.autoscale -text "Autoscale" -variable visoptions.lineplotautoscale
tixControl $w.settings.minmax.xmin -label "Min. x: " \ # tixControl $w.settings.minmax.xmin -label "Min. x: " \
-integer false -variable visoptions.lineplotxmin \ # -integer false -variable visoptions.lineplotxmin \
-options { # -options {
entry.width 6 # entry.width 6
label.width 8 # label.width 8
label.anchor e # label.anchor e
} # }
tixControl $w.settings.minmax.xmax -label "Max. x: " \ ttk::frame $w.settings.minmax.xmin
-integer false -variable visoptions.lineplotxmax \ ttk::label $w.settings.minmax.xmin.label -text "Min. x: "
-options { ttk::spinbox $w.settings.minmax.xmin.sp -textvariable visoptions.lineplotxmin -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 3" \
entry.width 6 -invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9
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.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 \ pack $w.settings.minmax.autoscale $w.settings.minmax.xmin $w.settings.minmax.xmax \
$w.settings.minmax.ymin $w.settings.minmax.ymax -side left $w.settings.minmax.ymin $w.settings.minmax.ymax -side left
pack $w.settings.minmax pack $w.settings.minmax
label $w.settings.empty1 -text "" ttk::label $w.settings.empty1 -text ""
pack $w.settings.empty1 pack $w.settings.empty1
frame $w.settings.plotsize ttk::frame $w.settings.plotsize
tixControl $w.settings.plotsize.xsize -label "Plotsize x: "\ # tixControl $w.settings.plotsize.xsize -label "Plotsize x: "\
-integer true -variable visoptions.lineplotsizex \ # -integer true -variable visoptions.lineplotsizex \
-options { # -options {
entry.width 6 # entry.width 6
label.width 13 # label.width 13
label.anchor e # label.anchor e
} # }
tixControl $w.settings.plotsize.ysize -label "y: "\
-integer true -variable visoptions.lineplotsizey \ ttk::frame $w.settings.plotsize.xsize
-options { ttk::label $w.settings.plotsize.xsize.label -text "Plotsize x: "
entry.width 6 ttk::spinbox $w.settings.plotsize.xsize.sp -textvariable visoptions.lineplotsizex -width 6 -increment 1 -validate focus -validatecommand "my_validatespinbox %W %P 0" \
label.width 3 -invalidcommand "my_invalidspinbox %W" -from -1e9 -to 1e9
label.anchor e 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.xsize $w.settings.plotsize.ysize -side left
pack $w.settings.plotsize pack $w.settings.plotsize
label $w.settings.empty2 -text "" ttk::label $w.settings.empty2 -text ""
pack $w.settings.empty2 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: " \ menu $w.settings.color.menu -tearoff 0
-options {
label.width 19
label.anchor e
menubutton.width 15
}
foreach step { red black blue green yellow } { foreach step { red black blue green yellow } {
$w.settings.color add command $step -label $step $w.settings.color.menu add command -label $step -command "set visoptions.lineplotcolor $step; $w.settings.color.but configure -text \"$step\""
} }
$w.settings.color config -variable visoptions.lineplotcolor # 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.color
pack $w.settings pack $w.settings -fill x
set datax "" set datax ""
set datay "" set datay ""
@ -438,24 +527,33 @@ proc lineplotdialog { } {
set ymin 0 set ymin 0
set ymax 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: " \ # tixOptionMenu $w.plots.selplot -label "Selected Plot: " \
-options { # -options {
label.width 19 # label.width 19
label.anchor e # label.anchor e
menubutton.width 15 # menubutton.width 15
} # }
$w.plots.selplot add command none -label "None" # $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 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} { if { ${visoptions.lineplotselectedeval} != 0} {
set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}] set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}]
} }
@ -491,7 +589,7 @@ proc lineplotdialog { } {
addplotline $ident $datax $datay $plotinfo ${visoptions.lineplotcolor} 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} { if { ${visoptions.lineplotselectedeval} != 0} {
set visoptions.lineplotfile [lindex ${visoptions.evaluatefilenames} ${visoptions.lineplotselectedeval}] 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 pack $w.close
wm withdraw $w wm withdraw $w
@ -629,13 +727,35 @@ proc fieldlinesdialog { } {
tixOptionMenu $f.vecfun -label "Vector Function: " \ # tixOptionMenu $f.vecfun -label "Vector Function: " \
-options { # -options {
label.width 18 # label.width 18
label.anchor e # label.anchor e
menubutton.width 12 # menubutton.width 12
} # }
$f.vecfun add command none -label None # $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 } { for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {
set fname [Ng_Vis_Field getfieldname $i] set fname [Ng_Vis_Field getfieldname $i]
set fcomp [Ng_Vis_Field getfieldcomponents $i] set fcomp [Ng_Vis_Field getfieldcomponents $i]
@ -643,12 +763,11 @@ proc fieldlinesdialog { } {
set sdim [Ng_Vis_Field getdimension] set sdim [Ng_Vis_Field getdimension]
if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] } if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] }
if { ($fcomp == $sdim) || ($fcomp == 3) } { if { ($fcomp == $sdim) || ($fcomp == 3) } {
$f.vecfun add command $fname -label $fname $f.vecfun.menu add command -label $fname -command "set visoptions.fieldlinesvecfunction $fname;Ng_Vis_Set parameters; redraw;$f.vecfun.but configure -text \"$fname\" "
} }
} }
$f.vecfun configure -variable visoptions.fieldlinesvecfunction
$f.vecfun configure -command { Ng_Vis_Set parameters; redraw }
grid $f.vecfun.lab $f.vecfun.but -sticky nw
pack $f.vecfun pack $f.vecfun
@ -784,29 +903,47 @@ proc fieldlinesdialog { } {
frame $g.linesettings -relief groove -borderwidth 3 frame $g.linesettings -relief groove -borderwidth 3
label $g.linesettings.title -text "\nLine Settings\n" label $g.linesettings.title -text "\nLine Settings\n"
tixControl $g.linesettings.length -label "rel. Length: " -integer false \ # tixControl $g.linesettings.length -label "rel. Length: " -integer false \
-variable visoptions.fieldlineslength -min 0.00001 -max 10000 -step 0.1 \ # -variable visoptions.fieldlineslength -min 0.00001 -max 10000 -step 0.1 \
-options { # -options {
entry.width 6 # entry.width 6
label.width 25 # label.width 25
label.anchor e # label.anchor e
} # }
tixControl $g.linesettings.maxpoints -label "max. Points: " -integer true \ ttk::frame $g.linesettings.length
-variable visoptions.fieldlinesmaxpoints -min 0 -max 10000 -step 1 \ ttk::label $g.linesettings.length.lab -text "rel. Length: "
-options { ttk::spinbox $g.linesettings.length.sp -textvariable visoptions.fieldlineslength -width 6 -increment 0.1 -validate focus -validatecommand "my_validatespinbox %W %P 4" \
entry.width 6 -invalidcommand "my_invalidspinbox %W" -from 0.00001 -to 10000
label.width 25 grid $g.linesettings.length.lab $g.linesettings.length.sp -sticky nw
label.anchor e
}
tixControl $g.linesettings.thick -label "rel. Thickness: " -integer false \ # tixControl $g.linesettings.maxpoints -label "max. Points: " -integer true \
-variable visoptions.fieldlinesthickness -min 1e-10 -max 0.5 -step 0.001 \ # -variable visoptions.fieldlinesmaxpoints -min 0 -max 10000 -step 1 \
-options { # -options {
entry.width 6 # entry.width 6
label.width 25 # label.width 25
label.anchor e # 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.title $g.linesettings.length $g.linesettings.maxpoints $g.linesettings.thick
@ -820,28 +957,46 @@ proc fieldlinesdialog { } {
frame $g.odesettings -relief groove -borderwidth 3 frame $g.odesettings -relief groove -borderwidth 3
label $g.odesettings.title -text "\nODE Settings\n" label $g.odesettings.title -text "\nODE Settings\n"
tixControl $g.odesettings.tol -label "rel. Tolerance: " -integer false \ # tixControl $g.odesettings.tol -label "rel. Tolerance: " -integer false \
-variable visoptions.fieldlinestolerance -min 0.00001 -max 1 -step 0.01 \ # -variable visoptions.fieldlinestolerance -min 0.00001 -max 1 -step 0.01 \
-options { # -options {
entry.width 6 # entry.width 6
label.width 25 # label.width 25
label.anchor e # 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 " \ # tixOptionMenu $g.odesettings.rktype -label "RK-Type " \
-options { # -options {
label.width 20 # label.width 20
label.anchor e # label.anchor e
menubutton.width 25 # 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 }
# $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.title $g.odesettings.tol $g.odesettings.rktype
pack $g.odesettings -fill x -ipady 3 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.scalfun $w.vecfun $w.evaluate $w.multidimcomp
destroy $w.imaginary $w.logscale $w.texframe.usetexture $w.texframe.lintexture # destroy $w.imaginary $w.logscale $w.texframe.usetexture $w.texframe.lintexture
destroy $w.texframe # destroy $w.texframe
destroy $w.invcolor $w.redrawperiodic # destroy $w.invcolor $w.redrawperiodic
destroy $w.bu -pady 5 # 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.bu.showsol $w.bu.clipping $w.bu.fieldlines $w.bu.lineplot $w.bu.done -side left -expand yes
checkbutton $w.imaginary -text "Imaginary Part" \ # checkbutton $w.imaginary -text "Imaginary Part" \
-variable visoptions.imaginary \ # -variable visoptions.imaginary \
-command { Ng_Vis_Set parameters; redraw } # -command { Ng_Vis_Set parameters; redraw }
frame $w.texframe # frame $w.texframe
checkbutton $w.texframe.usetexture -text "Use Textures (" \ # checkbutton $w.texframe.usetexture -text "Use Textures (" \
-variable visoptions.usetexture \ # -variable visoptions.usetexture \
-command { Ng_Vis_Set parameters; redraw } # -command { Ng_Vis_Set parameters; redraw }
checkbutton $w.texframe.lintexture -text "Linear )" \ # checkbutton $w.texframe.lintexture -text "Linear )" \
-variable visoptions.lineartexture \ # -variable visoptions.lineartexture \
-command { Ng_Vis_Set parameters; redraw } # -command { Ng_Vis_Set parameters; redraw }
checkbutton $w.invcolor -text "Inverse Color" \ # checkbutton $w.invcolor -text "Inverse Color" \
-variable visoptions.invcolor \ # -variable visoptions.invcolor \
-command { Ng_Vis_Set parameters; redraw } # -command { Ng_Vis_Set parameters; redraw }
checkbutton $w.logscale -text "Log Scale" \ # checkbutton $w.logscale -text "Log Scale" \
-variable visoptions.logscale \ # -variable visoptions.logscale \
-command { Ng_Vis_Set parameters; redraw } # -command { Ng_Vis_Set parameters; redraw }
checkbutton $w.redrawperiodic -text "Animate periodic" \ # checkbutton $w.redrawperiodic -text "Animate periodic" \
-variable visoptions.redrawperiodic \ # -variable visoptions.redrawperiodic \
-command { # -command {
redrawperiodic # redrawperiodic
Ng_Vis_Set parameters; # Ng_Vis_Set parameters;
redraw # redraw
} # }
tixOptionMenu $w.scalfun -label "Scalar Function: " \ # tixOptionMenu $w.scalfun -label "Scalar Function: " \
-options { # -options {
label.width 18 # label.width 18
label.anchor e # label.anchor e
menubutton.width 12 # menubutton.width 12
} # }
tixOptionMenu $w.vecfun -label "Vector Function: " \ # tixOptionMenu $w.vecfun -label "Vector Function: " \
-options { # -options {
label.width 18 # label.width 18
label.anchor e # label.anchor e
menubutton.width 12 # menubutton.width 12
} # }
$w.scalfun add command none -label None # $w.scalfun add command none -label None
for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } { # for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {
set fname [Ng_Vis_Field getfieldname $i] # set fname [Ng_Vis_Field getfieldname $i]
set fcomp [Ng_Vis_Field getfieldcomponents $i] # set fcomp [Ng_Vis_Field getfieldcomponents $i]
if { $fcomp == 1 } { # if { $fcomp == 1 } {
$w.scalfun add command $fname.1 -label $fname # $w.scalfun add command $fname.1 -label $fname
} { # } {
for { set j 1 } { $j <= $fcomp } { incr j } { # for { set j 1 } { $j <= $fcomp } { incr j } {
$w.scalfun add command $fname.$j -label "$fname ($j)" # $w.scalfun add command $fname.$j -label "$fname ($j)"
} # }
$w.scalfun add command $fname.0 -label "func ($fname)" # $w.scalfun add command $fname.0 -label "func ($fname)"
} # }
} # }
$w.vecfun add command none -label None # $w.vecfun add command none -label None
for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } { # for { set i 1 } { $i <= [Ng_Vis_Field getnfieldnames] } { incr i } {
set fname [Ng_Vis_Field getfieldname $i] # set fname [Ng_Vis_Field getfieldname $i]
set fcomp [Ng_Vis_Field getfieldcomponents $i] # set fcomp [Ng_Vis_Field getfieldcomponents $i]
set iscomplex [Ng_Vis_Field iscomplex $i] # set iscomplex [Ng_Vis_Field iscomplex $i]
set sdim [Ng_Vis_Field getdimension] # set sdim [Ng_Vis_Field getdimension]
if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] } # if { $iscomplex == 1 } { set fcomp [expr $fcomp / 2] }
if { ($fcomp == $sdim) || ($fcomp == 3) } { # if { ($fcomp == $sdim) || ($fcomp == 3) } {
$w.vecfun add command $fname -label $fname # $w.vecfun add command $fname -label $fname
} # }
} # }
$w.scalfun configure -variable visoptions.scalfunction # $w.scalfun configure -variable visoptions.scalfunction
$w.scalfun configure -command { Ng_Vis_Set parameters; redraw } # $w.scalfun configure -command { Ng_Vis_Set parameters; redraw }
$w.vecfun configure -variable visoptions.vecfunction # $w.vecfun configure -variable visoptions.vecfunction
$w.vecfun configure -command { Ng_Vis_Set parameters; redraw } # $w.vecfun configure -command { Ng_Vis_Set parameters; redraw }
# puts "sclfunction = ${visoptions.scalfunction}" # # puts "sclfunction = ${visoptions.scalfunction}"
tixOptionMenu $w.evaluate -label "Evaluate: " \ # tixOptionMenu $w.evaluate -label "Evaluate: " \
-options { # -options {
label.width 18 # label.width 18
label.anchor e # label.anchor e
menubutton.width 12 # menubutton.width 12
} # }
$w.evaluate add command abs -label "|.|" # $w.evaluate add command abs -label "|.|"
$w.evaluate add command abstens -label "|tensor|" # $w.evaluate add command abstens -label "|tensor|"
$w.evaluate add command mises -label "Mises" # $w.evaluate add command mises -label "Mises"
$w.evaluate add command main -label "Main" # $w.evaluate add command main -label "Main"
$w.evaluate configure -variable visoptions.evaluate # $w.evaluate configure -variable visoptions.evaluate
$w.evaluate configure -command { # $w.evaluate configure -command {
Ng_Vis_Set parameters; # Ng_Vis_Set parameters;
redraw # redraw
} # }
pack $w.scalfun $w.vecfun $w.evaluate # pack $w.scalfun $w.vecfun $w.evaluate
tixControl $w.multidimcomp -label "multidim-component: " -integer true \ # tixControl $w.multidimcomp -label "multidim-component: " -integer true \
-variable visoptions.multidimcomponent -min 0 \ # -variable visoptions.multidimcomponent -min 0 \
-command { Ng_Vis_Set parameters; redraw } \ # -command { Ng_Vis_Set parameters; redraw } \
-options { # -options {
entry.width 6 # entry.width 6
label.width 18 # label.width 18
label.anchor e # label.anchor e
} # }
pack $w.multidimcomp # pack $w.multidimcomp
pack $w.imaginary $w.logscale $w.texframe $w.invcolor $w.redrawperiodic # pack $w.imaginary $w.logscale $w.texframe $w.invcolor $w.redrawperiodic
pack $w.texframe.usetexture $w.texframe.lintexture -side left -expand yes # pack $w.texframe.usetexture $w.texframe.lintexture -side left -expand yes
frame $w.bu # frame $w.bu
pack $w.bu -pady 5 # pack $w.bu -pady 5
button $w.bu.showsol -text "Show Solution" -command { # button $w.bu.showsol -text "Show Solution" -command {
set selectvisual solution # set selectvisual solution
Ng_SetVisParameters # Ng_SetVisParameters
redraw # redraw
} # }
button $w.bu.clipping -text "Clipping" -command { # button $w.bu.clipping -text "Clipping" -command {
clippingdialog; # clippingdialog;
} # }
button $w.bu.fieldlines -text "Fieldlines" -command { # button $w.bu.fieldlines -text "Fieldlines" -command {
fieldlinesdialog; # fieldlinesdialog;
} # }
button $w.bu.lineplot -text "2D Lineplot" -command { # button $w.bu.lineplot -text "2D Lineplot" -command {
lineplotdialog; # lineplotdialog;
} # }
button $w.bu.done -text "Close" -command { # button $w.bu.done -text "Close" -command {
destroy .visoptions_dlg # 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 withdraw $w
wm deiconify $w # wm deiconify $w
} # }
} # }