diff --git a/ng/dialog.tcl b/ng/dialog.tcl index 8a7be16e..7373aa87 100644 --- a/ng/dialog.tcl +++ b/ng/dialog.tcl @@ -1576,7 +1576,6 @@ proc clippingdialog { } { proc my_Press {w x y} { - puts [$w identify $x $y] set inc [expr {([$w get $x $y] <= [$w get]) ? -1 : 1}] ttk::Repeatedly ttk::scale::Increment $w [expr 0.001*$inc] @@ -1687,27 +1686,46 @@ proc refinementdialog { } { #ttk::labelframe $w.main -text "Refinement options" -relief groove -borderwidth 3 #pack $w.main -fill x -pady 15 #set w $w.main - tixControl $w.meshsize -label "max mesh-size: " -integer false \ - -variable options.meshsize -min 1e-6 -max 1e6 \ - -options { - entry.width 6 - label.width 25 - label.anchor e - } + # tixControl $w.meshsize -label "max mesh-size: " -integer false \ + # -variable options.meshize -min 1e-6 -max 1e6 \ + # -options { + # entry.width 6 + # label.width 25 + # label.anchor e + # } - pack $w.meshsize -anchor e + # pack $w.meshsize -anchor e global localh set localh 1 - tixControl $w.loch -label "local mesh-size: " -integer false \ - -variable localh -min 1e-6 -max 1e6 \ - -options { - entry.width 6 - label.width 25 - label.anchor e - } + # tixControl $w.loch -label "local mesh-size: " -integer false \ + # -variable localh -min 1e-6 -max 1e6 \ + # -options { + # entry.width 6 + # label.width 25 + # label.anchor e + # } - pack $w.loch -anchor e + # pack $w.loch -anchor e + + ttk::frame $w.meshsize + + ttk::label $w.meshsize.l1 -text "max mesh-size: " + ttk::spinbox $w.meshsize.sp1 -from 1e-6 -to 1e6 -textvariable options.meshsize -validate focus -validatecommand "my_validatespinbox %W %P 4" \ + -invalidcommand "my_invalidspinbox %W" -width 6 -increment 0.1 + #pack $w.meshsize.l1 $w.meshsize.sp1 -fill x -side left + + ttk::frame $w.meshsizeloc + #pack $w.meshsize -anchor e + #pack $w.meshsizeloc -anchor e + ttk::label $w.meshsizeloc.l1 -text "local mesh-size: " + ttk::spinbox $w.meshsizeloc.sp1 -from 1e-6 -to 1e6 -textvariable localh -validate focus -validatecommand "my_validatespinbox %W %P 4" \ + -invalidcommand "my_invalidspinbox %W" -width 6 -increment 0.1 + #pack $w.meshsizeloc.l1 $w.meshsizeloc.sp1 -expand yes -fill x + pack $w.meshsize + pack $w.meshsizeloc + grid $w.meshsize.l1 $w.meshsize.sp1 + grid $w.meshsizeloc.l1 $w.meshsizeloc.sp1 ttk::button $w.restface -text "Restrict H at face" \ @@ -1736,7 +1754,7 @@ proc refinementdialog { } { } - pack $w.restface $w.restedge $w.restelement $w.restpoint -anchor e + pack $w.restface $w.restedge $w.restelement $w.restpoint @@ -2241,16 +2259,16 @@ proc stldoctordialog { } { # GENERAL ***************************** set f $wd.nb.general - - frame $f.show - pack $f.show -fill x - checkbutton $f.show.showtrias -text "Show STL-Triangles" \ + ttk::frame $f.selectframe -borderwidth 0 + #ttk::frame $f.show + #pack $f.show -fill x + ttk::checkbutton $f.selectframe.showtrias -text "Show STL-Triangles" \ -variable stloptions.showtrias -command { Ng_SetVisParameters; redraw } - pack $f.show.showtrias -anchor w + #pack $f.selectframe.showtrias -anchor w - checkbutton $f.show.showfilledtrias -text "Show Filled Triangles" \ + ttk::checkbutton $f.selectframe.showfilledtrias -text "Show Filled Triangles" \ -variable stloptions.showfilledtrias -command { Ng_SetVisParameters; redraw } - pack $f.show.showfilledtrias -anchor w + #pack $f.show.showfilledtrias -anchor w set selmodevals { 0 1 2 3 4 } set selmodelabs(0) "triangle" @@ -2259,72 +2277,104 @@ proc stldoctordialog { } { set selmodelabs(3) "line" set selmodelabs(4) "line cluster" - tixOptionMenu $f.selmode -label "Double Click selects :" \ - -options { - label.width 19 - label.anchor e - menubutton.width 15 - } + # tixOptionMenu $f.selmode -label "Double Click selects :" \ + # -options { + # label.width 19 + # label.anchor e + # menubutton.width 15 + # } - foreach selmodev $selmodevals { - $f.selmode add command $selmodev -label $selmodelabs($selmodev) - } - $f.selmode config -variable stldoctor.selectmode - $f.selmode config -command { Ng_STLDoctor } + # foreach selmodev $selmodevals { + # $f.selmode add command $selmodev -label $selmodelabs($selmodev) + # } + # $f.selmode config -variable stldoctor.selectmode + # $f.selmode config -command { Ng_STLDoctor } global stldoctor.selectmode - pack $f.selmode - - frame $f.sm + # pack $f.selmode + + ttk::label $f.selectframe.dblcsellab -text "Double Click selects : " + ttk::menubutton $f.selectframe.dblcselbut -menu $f.selectframe.dblcselmen -text "triangle" -width 16 + menu $f.selectframe.dblcselmen -tearoff 0 + foreach selmode { 0 1 2 3 4 } { + $f.selectframe.dblcselmen add command -label $selmodelabs($selmode) \ + -command "set stldoctor.selectmode $selmode ; Ng_STLDoctor ; $f.selectframe.dblcselbut configure -text \"$selmodelabs($selmode)\"" + } + $f.selectframe.dblcselmen invoke $selmodelabs(${stldoctor.selectmode}) + pack $f.selectframe + grid $f.selectframe.showtrias -sticky nw + grid $f.selectframe.showfilledtrias -sticky nw + grid $f.selectframe.dblcsellab $f.selectframe.dblcselbut -sticky nw + + + + + ttk::frame $f.sm pack $f.sm -fill x - checkbutton $f.sm.bu -text "select with mouse" \ + ttk::checkbutton $f.sm.bu -text "select with mouse" \ -variable stldoctor.selectwithmouse pack $f.sm.bu - frame $f.st -relief groove -borderwidth 3 + ttk::frame $f.st -relief groove -borderwidth 3 pack $f.st -fill x - label $f.st.lab -text "Select triangle by number"; - entry $f.st.ent -width 5 -relief sunken \ + ttk::label $f.st.lab -text "Select triangle by number"; + ttk::entry $f.st.ent -width 5 \ -textvariable stldoctor.selecttrig pack $f.st.ent $f.st.lab -side left -expand yes - frame $f.vc -relief groove -borderwidth 3 + ttk::frame $f.vc -relief groove -borderwidth 3 pack $f.vc -fill x - checkbutton $f.vc.bu -text "show vicinity" \ + ttk::checkbutton $f.vc.bu -text "show vicinity" \ -variable stldoctor.showvicinity \ -command {Ng_STLDoctor vicinity; redraw} - label $f.vc.lab -text "vicinity size"; - scale $f.vc.sc -orient horizontal -length 200 -from 0 -to 200 \ + ttk::label $f.vc.lab -text "vicinity size"; + + #scale $f.vc.sc -orient horizontal -length 200 -from 0 -to 200 \ -resolution 1 -variable stldoctor.vicinity \ -command { Ng_STLDoctor vicinity; redraw } + ttk::frame $f.vc.sc + ttk::scale $f.vc.sc.scale -orient horizontal -length 200 -from 0 -to 200 \ + -variable stldoctor.vicinity -takefocus 0 -command "Ng_STLDoctor vicinity; redraw; roundscale $f.vc.sc.scale 0" + ttk::entry $f.vc.sc.entry -textvariable stldoctor.vicinity -width 3 \ + -validatecommand "Ng_STLDoctor vicinity; redraw; my_validate %W [$f.vc.sc.scale cget -from] [$f.vc.sc.scale cget -to] %P 0" \ + -invalidcommand "my_invalid %W;Ng_STLDoctor vicinity; redraw;" -validate focus + ttk::label $f.vc.sc.lab -text "vicinity size" + grid $f.vc.sc.scale $f.vc.sc.entry $f.vc.sc.lab -sticky nw -padx 4 pack $f.vc.bu $f.vc.lab $f.vc.sc -expand yes - frame $f.ge -relief groove -borderwidth 3 - pack $f.ge -fill x - button $f.ge.neighbourangles -text "calc neighbourangles" -command {Ng_STLDoctor neighbourangles} - button $f.ge.showcoords -text "show coords of touched triangle" -command {Ng_STLDoctor showcoords} - button $f.ge.moveptm -text "move point to middle of trianglepoints" -command {Ng_STLDoctor movepointtomiddle; redraw} - button $f.ge.destroy0trigs -text "destroy 0-volume triangles" -command {Ng_STLDoctor destroy0trigs} - pack $f.ge.neighbourangles $f.ge.showcoords $f.ge.moveptm $f.ge.destroy0trigs -expand yes + ttk::frame $f.ge -relief groove -borderwidth 0 + pack $f.ge -expand yes + ttk::button $f.ge.neighbourangles -text "calc neighbourangles" -command {Ng_STLDoctor neighbourangles} + ttk::button $f.ge.showcoords -text "show coords of touched triangle" -command {Ng_STLDoctor showcoords} + ttk::button $f.ge.moveptm -text "move point to middle of trianglepoints" -command {Ng_STLDoctor movepointtomiddle; redraw} + ttk::button $f.ge.destroy0trigs -text "destroy 0-volume triangles" -command {Ng_STLDoctor destroy0trigs} + grid $f.ge.neighbourangles -sticky nw -padx 4 -pady 4 + grid $f.ge.showcoords -sticky nw -padx 4 -pady 4 + grid $f.ge.moveptm -sticky nw -padx 4 -pady 4 + grid $f.ge.destroy0trigs -sticky nw -padx 4 -pady 4 - button $f.ge.cancle -text "Done" -command {destroy .stldoctor_dlg } - pack $f.ge.cancle -expand yes + ttk::button $f.ge.cancle -text "Done" -command {destroy .stldoctor_dlg } + grid $f.ge.cancle -sticky nw # TOPOLOGY ******************** set f $wd.nb.topology - frame $f.oc -relief groove -borderwidth 3 - pack $f.oc -fill x - button $f.oc.bu -text "invert orientation of selected trig" -command {Ng_STLDoctor invertselectedtrig; redraw } - button $f.oc.bu2 -text "orient after selected trig" -command {Ng_STLDoctor orientafterselectedtrig; redraw } - pack $f.oc.bu $f.oc.bu2 -side left -expand yes + ttk::frame $f.oc -relief groove -borderwidth 3 + pack $f.oc -pady 3 -ipady 3 -fill y -fill x + ttk::frame $f.oc.oc1 -borderwidth 0 + pack $f.oc.oc1 + ttk::button $f.oc.oc1.bu -text "invert orientation \n of selected trig" -command {Ng_STLDoctor invertselectedtrig; redraw } + ttk::button $f.oc.oc1.bu2 -text "orient after \n selected trig" -command {Ng_STLDoctor orientafterselectedtrig; redraw } + - button $f.toperr -text "mark inconsistent triangles" -command {Ng_STLDoctor marktoperrortrigs; redraw } - - button $f.deltrig -text "delete selected triangle" -command {Ng_STLDoctor deleteselectedtrig; redraw } - button $f.geosmooth -text "geometric smoothing" -command {Ng_STLDoctor smoothgeometry; redraw } - - pack $f.toperr $f.deltrig $f.geosmooth + ttk::button $f.oc.oc1.toperr -text "mark inconsistent triangles" -command {Ng_STLDoctor marktoperrortrigs; redraw } + ttk::button $f.oc.oc1.deltrig -text "delete selected triangle" -command {Ng_STLDoctor deleteselectedtrig; redraw } + ttk::button $f.oc.oc1.geosmooth -text "geometric smoothing" -command {Ng_STLDoctor smoothgeometry; redraw } + + grid $f.oc.oc1.bu x $f.oc.oc1.bu2 -sticky nw -padx 4 -pady 4 + grid $f.oc.oc1.toperr - x -sticky nw -padx 4 -pady 4 + grid $f.oc.oc1.deltrig - x -sticky nw -padx 4 -pady 4 + grid $f.oc.oc1.geosmooth - x -sticky nw -padx 4 -pady 4 @@ -2334,27 +2384,50 @@ proc stldoctordialog { } { set f $wd.nb.edges - frame $f.be -relief groove -borderwidth 3 + ttk::frame $f.be -relief groove -borderwidth 3 pack $f.be -fill x - label $f.be.lab -text "build edges with yellow angle:"; - scale $f.be.sc -orient horizontal -length 200 -from 0 -to 100 \ + + #scale $f.be.sc -orient horizontal -length 200 -from 0 -to 100 \ + #-resolution 0.5 + ttk::frame $f.be.frame + pack $f.be.frame -ipady 4 -pady 4 + ttk::label $f.be.frame.lab -text "build edges with yellow angle:"; + ttk::scale $f.be.frame.scale -orient horizontal -length 200 -from 0 -to 200 \ + -variable stloptions.yangle -takefocus 0 -command "roundscale $f.be.frame.scale 1; Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw" + ttk::entry $f.be.frame.entry -textvariable stloptions.yangle -width 5 \ + -validatecommand "Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw;my_validate %W [$f.be.frame.scale cget -from] [$f.be.frame.scale cget -to] %P 1" \ + -invalidcommand "my_invalid %W;Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw" -validate focus + grid $f.be.frame.lab - -sticky nw -padx 4 + grid $f.be.frame.scale $f.be.frame.entry -sticky nw -padx 4 + + + + #$f.be.sc config -variable stloptions.yangle + #$f.be.sc config -command { Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw } + ttk::label $f.be.frame.lab2 -text "continue edges with yellow angle:"; +# scale $f.be.sc2 -orient horizontal -length 200 -from 0 -to 100 \ -resolution 0.5 - $f.be.sc config -variable stloptions.yangle - $f.be.sc config -command { Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw } - label $f.be.lab2 -text "continue edges with yellow angle:"; - scale $f.be.sc2 -orient horizontal -length 200 -from 0 -to 100 \ - -resolution 0.5 - $f.be.sc2 config -variable stloptions.contyangle - $f.be.sc2 config -command { Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw } + ttk::scale $f.be.frame.scale2 -orient horizontal -length 200 -from 0 -to 100 \ + -variable stloptions.contyangle -takefocus 0 -command "roundscale $f.be.frame.scale2 1; Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw" + ttk::entry $f.be.frame.entry2 -textvariable stloptions.contyangle -width 5 \ + -validatecommand "Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw;my_validate %W [$f.be.frame.scale2 cget -from] [$f.be.frame.scale2 cget -to] %P 1" \ + -invalidcommand "my_invalid %W;Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw" -validate focus + + grid $f.be.frame.lab2 - -sticky nw -padx 4 + grid $f.be.frame.scale2 $f.be.frame.entry2 -sticky nw -padx 4 + + #$f.be.sc2 config -variable stloptions.contyangle + #$f.be.sc2 config -command { Ng_SetSTLParameters; Ng_STLDoctor buildedges; redraw } - button $f.be.buildedges -text "Build Edges" -command {Ng_STLDoctor buildedges; redraw} - pack $f.be.lab $f.be.sc $f.be.lab2 $f.be.sc2 $f.be.buildedges -expand yes + ttk::button $f.be.frame.buildedges -text "Build Edges" -command {Ng_STLDoctor buildedges; redraw} + grid $f.be.frame.buildedges - -sticky n -padx 4 -pady 4 + #pack $f.be.lab $f.be.sc $f.be.lab2 $f.be.sc2 $f.be.buildedges -expand yes - frame $f.se + ttk::frame $f.se -relief groove -borderwidth 3 pack $f.se -fill x - checkbutton $f.se.bu -text "show excluded" \ + ttk::checkbutton $f.se.bu -text "show excluded" \ -variable stldoctor.showexcluded \ -command {Ng_STLDoctor; redraw} pack $f.se.bu @@ -2368,25 +2441,41 @@ proc stldoctordialog { } { set edgeselmodelabs(3) "candidate" set edgeselmodelabs(4) "excluded" - tixOptionMenu $f.edgeselmode -label "Double Click sets edge :" \ - -options { - label.width 19 - label.anchor e - menubutton.width 15 - } + # tixOptionMenu $f.edgeselmode -label "Double Click sets edge :" \ + # -options { + # label.width 19 + # label.anchor e + # menubutton.width 15 + # } - foreach edgeselmodev $edgeselmodevals { - $f.edgeselmode add command $edgeselmodev -label $edgeselmodelabs($edgeselmodev) - } - $f.edgeselmode config -variable stldoctor.edgeselectmode - $f.edgeselmode config -command { Ng_STLDoctor } - global stldoctor.edgeselectmode - pack $f.edgeselmode + # foreach edgeselmodev $edgeselmodevals { + # $f.edgeselmode add command $edgeselmodev -label $edgeselmodelabs($edgeselmodev) + # } + # $f.edgeselmode config -variable stldoctor.edgeselectmode + # $f.edgeselmode config -command { Ng_STLDoctor } + global stldoctor.edgeselectmode + # pack $f.edgeselmode + ttk::frame $f.scaleframe -relief groove -borderwidth 0 + pack $f.scaleframe -ipadx 4 -pady 4 -expand yes + ttk::label $f.scaleframe.dblcedgelab -text "Double Click sets edge :" + ttk::menubutton $f.scaleframe.dblcledgebut -menu $f.scaleframe.dblcledgem -text "coarse" -width 16 + + menu $f.scaleframe.dblcledgem -tearoff 0 + foreach selectmode { 0 1 2 3 4 } { + $f.scaleframe.dblcledgem add command -label $edgeselmodelabs($selectmode) \ + -command "set stldoctor.edgeselectmode $selectmode ; $f.scaleframe.dblcledgebut configure -text \"$edgeselmodelabs($selectmode)\"" + } + $f.scaleframe.dblcledgem invoke $edgeselmodelabs(${stldoctor.edgeselectmode}) + grid $f.scaleframe.dblcedgelab $f.scaleframe.dblcledgebut -sticky n -ipadx 4 + + + + # edge buttons - frame $f.edg -relief groove -borderwidth 3 - pack $f.edg -fill x + ttk::frame $f.edg -relief groove -borderwidth 3 + pack $f.edg -fill x -ipadx 4 -ipady 4 # checkbutton $f.edg.bu -text "use external edges" \ # -variable stldoctor.useexternaledges \ @@ -2394,36 +2483,36 @@ proc stldoctordialog { } { # pack $f.edg.bu -expand yes - frame $f.edg.f0 + ttk::frame $f.edg.f0 pack $f.edg.f0 - button $f.edg.f0.confirmedge -text "confirm" -command {Ng_STLDoctor confirmedge; redraw} - button $f.edg.f0.candidateedge -text "candidate" -command {Ng_STLDoctor candidateedge; redraw} - button $f.edg.f0.excludeedge -text "exclude" -command {Ng_STLDoctor excludeedge; redraw} - button $f.edg.f0.undefinededge -text "undefined" -command {Ng_STLDoctor undefinededge; redraw} + ttk::button $f.edg.f0.confirmedge -text "confirm" -command {Ng_STLDoctor confirmedge; redraw} + ttk::button $f.edg.f0.candidateedge -text "candidate" -command {Ng_STLDoctor candidateedge; redraw} + ttk::button $f.edg.f0.excludeedge -text "exclude" -command {Ng_STLDoctor excludeedge; redraw} + ttk::button $f.edg.f0.undefinededge -text "undefined" -command {Ng_STLDoctor undefinededge; redraw} pack $f.edg.f0.confirmedge $f.edg.f0.candidateedge $f.edg.f0.excludeedge $f.edg.f0.undefinededge -side left - frame $f.edg.fa + ttk::frame $f.edg.fa pack $f.edg.fa - button $f.edg.fa.setallundefined -text "all undefined" -command {Ng_STLDoctor setallundefinededges; redraw} - button $f.edg.fa.erasecandidates -text "candidates to undefined" -command {Ng_STLDoctor erasecandidateedges; redraw} + ttk::button $f.edg.fa.setallundefined -text "all undefined" -command {Ng_STLDoctor setallundefinededges; redraw} + ttk::button $f.edg.fa.erasecandidates -text "candidates to undefined" -command {Ng_STLDoctor erasecandidateedges; redraw} pack $f.edg.fa.setallundefined $f.edg.fa.erasecandidates -side left - frame $f.edg.fb + ttk::frame $f.edg.fb pack $f.edg.fb - button $f.edg.fb.confirmcandidates -text "candidates to confirmed" -command {Ng_STLDoctor confirmcandidateedges; redraw} - button $f.edg.fb.confirmedtocandidates -text "confirmed to candidates" -command {Ng_STLDoctor confirmedtocandidateedges; redraw} + ttk::button $f.edg.fb.confirmcandidates -text "candidates to confirmed" -command {Ng_STLDoctor confirmcandidateedges; redraw} + ttk::button $f.edg.fb.confirmedtocandidates -text "confirmed to candidates" -command {Ng_STLDoctor confirmedtocandidateedges; redraw} pack $f.edg.fb.confirmcandidates $f.edg.fb.confirmedtocandidates -side left - frame $f.edg.f1 - frame $f.edg.f2 - frame $f.edg.f3 - frame $f.edg.f4 + ttk::frame $f.edg.f1 + ttk::frame $f.edg.f2 + ttk::frame $f.edg.f3 + ttk::frame $f.edg.f4 pack $f.edg.f1 $f.edg.f2 $f.edg.f3 $f.edg.f4 - button $f.edg.f1.exportedges -text "export edges" -command {Ng_STLDoctor exportedges} - button $f.edg.f1.importedges -text "import edges" -command {Ng_STLDoctor importedges; redraw} - button $f.edg.f1.saveedgedata -text "save edgedata" \ + ttk::button $f.edg.f1.exportedges -text "export edges" -command {Ng_STLDoctor exportedges} + ttk::button $f.edg.f1.importedges -text "import edges" -command {Ng_STLDoctor importedges; redraw} + ttk::button $f.edg.f1.saveedgedata -text "save edgedata" \ -command { set types { {"Netgen Edgedata" {.ned} } @@ -2434,7 +2523,7 @@ proc stldoctordialog { } { } } - button $f.edg.f1.loadedgedata -text "load edgedata" \ + ttk::button $f.edg.f1.loadedgedata -text "load edgedata" \ -command { set types { {"Netgen Edgedata" {.ned} } @@ -2450,7 +2539,7 @@ proc stldoctordialog { } { } } - button $f.edg.f1.importAVLedges -text "import AVL edges" \ + ttk::button $f.edg.f1.importAVLedges -text "import AVL edges" \ -command { set types {{"Edge file" {.edg }}} @@ -2463,7 +2552,7 @@ proc stldoctordialog { } { pack $f.edg.f1.importAVLedges $f.edg.f1.loadedgedata $f.edg.f1.saveedgedata -side left # button $f.edg.f1.buildedges -text "build external edges" -command {Ng_STLDoctor buildexternaledges; redraw} - frame $f.edg2 -relief groove -borderwidth 3 + ttk::frame $f.edg2 -relief groove -borderwidth 3 pack $f.edg2 -fill x @@ -2485,75 +2574,85 @@ proc stldoctordialog { } { # NORMALS *********************** set f $wd.nb.normals - frame $f.dt -relief groove -borderwidth 3 + ttk::frame $f.dt -relief groove -borderwidth 3 pack $f.dt -fill x - label $f.dt.lab -text "dirty triangle factor"; - entry $f.dt.ent -width 5 -relief sunken \ - -textvariable stldoctor.dirtytrigfact - pack $f.dt.ent $f.dt.lab -side left -expand yes + ttk::label $f.dt.lab -text "dirty triangle factor"; + ttk::entry $f.dt.ent -width 5 \ + -textvariable stldoctor.dirtytrigfact -validatecommand "Ng_SetSTLParameters;my_validate %W -1e9 1e9 %P 3" \ + -invalidcommand "my_invalid %W;Ng_SetSTLParameters" -validate focus + pack $f.dt.ent $f.dt.lab -side left -expand yes -pady 8 - frame $f.srt -relief groove -borderwidth 3 + ttk::frame $f.srt -relief groove -borderwidth 3 pack $f.srt -fill x - button $f.srt.bu -text "smooth reverted triangles geometric" -command {Ng_STLDoctor smoothrevertedtrigs; redraw } - entry $f.srt.ent -width 5 -relief sunken \ - -textvariable stldoctor.smoothangle - pack $f.srt.ent $f.srt.bu -side left -expand yes + ttk::button $f.srt.bu -text "smooth reverted triangles geometric" -command {Ng_STLDoctor smoothrevertedtrigs; redraw } + ttk::entry $f.srt.ent -width 5 \ + -textvariable stldoctor.smoothangle -validatecommand "Ng_SetSTLParameters;my_validate %W -1e9 1e9 %P 2" \ + -invalidcommand "my_invalid %W;Ng_SetSTLParameters" -validate focus + pack $f.srt.ent $f.srt.bu -side left -expand yes -pady 8 - frame $f.bdt -relief groove -borderwidth 3 + ttk::frame $f.bdt -relief groove -borderwidth 3 pack $f.bdt -fill x - button $f.bdt.bu -text "mark dirty triangles" -command {Ng_STLDoctor markdirtytrigs; redraw } - button $f.bdt.bu2 -text "smooth dirty triangles normal" -command {Ng_STLDoctor smoothdirtytrigs; redraw } - pack $f.bdt.bu $f.bdt.bu2 -side left -expand yes + ttk::button $f.bdt.bu -text "mark dirty triangles" -command {Ng_STLDoctor markdirtytrigs; redraw } + ttk::button $f.bdt.bu2 -text "smooth dirty triangles normal" -command {Ng_STLDoctor smoothdirtytrigs; redraw } + pack $f.bdt.bu $f.bdt.bu2 -side left -expand yes -pady 8 - frame $f.sno -relief groove -borderwidth 3 - pack $f.sno - - label $f.sno.labrough -text "rough" - scale $f.sno.scsmooth -orient horizontal -length 100 -from 0 -to 0.8 \ + ttk::frame $f.sno -relief groove -borderwidth 3 + pack $f.sno -fill x + ttk::frame $f.sno.snoframe -borderwidth 0 + #ttk::label $f.sno.labrough -text "rough" + #scale $f.sno.scsmooth -orient horizontal -length 100 -from 0 -to 0.8 \ -resolution 0.01 -variable stldoctor.smoothnormalsweight \ -command { Ng_SetSTLParameters } - label $f.sno.labsmooth -text "smooth" - button $f.sno.smoothnormals -text "smooth normals" -command { Ng_STLDoctor smoothnormals; redraw} + #ttk::label $f.sno.labsmooth -text "smooth" + ttk::button $f.sno.smoothnormals -text "smooth normals" -command { Ng_STLDoctor smoothnormals; redraw} - - - pack $f.sno.labrough $f.sno.scsmooth $f.sno.labsmooth $f.sno.smoothnormals -side left -padx 5 - - frame $f.no -relief groove -borderwidth 3 + ttk::scale $f.sno.snoframe.scale -orient horizontal -length 100 -from 0.0 -to 0.8 \ + -variable stldoctor.smoothnormalsweight -takefocus 0 -command "roundscale $f.sno.snoframe.scale 2;Ng_SetSTLParameters" + ttk::entry $f.sno.snoframe.entry -textvariable stldoctor.smoothnormalsweight -width 4 \ + -validatecommand "Ng_SetSTLParameters;my_validate %W [$f.sno.snoframe.scale cget -from] [$f.sno.snoframe.scale cget -to] %P 2" \ + -invalidcommand "my_invalid %W;Ng_SetSTLParameters" -validate focus + ttk::label $f.sno.snoframe.labrough -text "rough" + ttk::label $f.sno.snoframe.labsmooth -text "smooth" + grid $f.sno.snoframe.labrough $f.sno.snoframe.scale $f.sno.snoframe.labsmooth $f.sno.snoframe.entry -sticky nw -padx 4 + + #pack $f.sno.labrough $f.sno.scsmooth $f.sno.labsmooth $f.sno.smoothnormals -side left -padx 5 + pack $f.sno.snoframe $f.sno.smoothnormals -side left -padx 5 -pady 8 + ttk::frame $f.no -relief groove -borderwidth 3 pack $f.no -fill x - button $f.no.marknonsmoothnormals -text "mark non-smooth triangles" -command {Ng_STLDoctor marknonsmoothnormals; redraw} - button $f.no.calcnormals -text "calculate normals from geometry" -command {Ng_STLDoctor calcnormals; redraw} + ttk::button $f.no.marknonsmoothnormals -text "mark non-smooth triangles" -command {Ng_STLDoctor marknonsmoothnormals; redraw} + ttk::button $f.no.calcnormals -text "calculate normals from geometry" -command {Ng_STLDoctor calcnormals; redraw} - pack $f.no.marknonsmoothnormals $f.no.calcnormals -expand yes + pack $f.no.marknonsmoothnormals $f.no.calcnormals -expand yes -pady 8 # ADVANCED ************************** set f $wd.nb.advanced - frame $f.sc + ttk::frame $f.sc pack $f.sc -fill x - checkbutton $f.sc.bu -text "spiral check" \ + ttk::checkbutton $f.sc.bu -text "spiral check" \ -variable stldoctor.spiralcheck \ -command {Ng_STLDoctor;} - checkbutton $f.sc.bu2 -text "cone check" \ + ttk::checkbutton $f.sc.bu2 -text "cone check" \ -variable stldoctor.conecheck \ -command {Ng_STLDoctor;} pack $f.sc.bu $f.sc.bu2 - - tixControl $f.gtol -label "load-geometry tolerance factor" -integer false \ + + #tixControl $f.gtol -label "load-geometry tolerance factor" -integer false \ -variable stldoctor.geom_tol_fact \ -options { - entry.width 8 - label.width 30 - label.anchor e - } + # entry.width 8 + # label.width 30 + # label.anchor e + #} + ttk::spinbox $f.gtol -from 1 -to 20 -textvariable stldoctor.geom_tol_fact -width 8 pack $f.gtol - button $f.adap -text "Apply" -command { + ttk::button $f.adap -text "Apply" -command { .stldoctor_dlg.nb.advanced.gtol invoke Ng_STLDoctor; } @@ -2961,117 +3060,117 @@ proc printlatestwarning { } { -proc runtestdialog { } { - source $::ngdir/ngshell.tcl - set w .runtest_dlg +# proc runtestdialog { } { + # source $::ngdir/ngshell.tcl + # set w .runtest_dlg - if {[winfo exists .runtest_dlg] == 1} { - wm withdraw $w - wm deiconify $w + # if {[winfo exists .runtest_dlg] == 1} { + # wm withdraw $w + # wm deiconify $w - focus $w - } { - toplevel $w + # focus $w + # } { + # toplevel $w -# in2d testing # - frame $w.in2dframe - pack $w.in2dframe +# # in2d testing # + # frame $w.in2dframe + # pack $w.in2dframe - set in2dlogfile "" - tixLabelEntry $w.in2dframe.ent -label "in2d log-file: console if empty" \ - -labelside top \ - -options { - entry.textVariable in2dlogfile - entry.width 35 - label.width 25 - label.anchor w - } - button $w.in2dframe.btn -text "Browse" -command { - set types { { "Log file" {.log} } } - set in2dlogfile [tk_getOpenFile -filetypes $types -initialfile $in2dlogfile] - } - button $w.in2dframe.test -text "Test in2d meshing" -command { ngtest in2d $in2dlogfile } + # set in2dlogfile "" + # tixLabelEntry $w.in2dframe.ent -label "in2d log-file: console if empty" \ + # -labelside top \ + # -options { + # entry.textVariable in2dlogfile + # entry.width 35 + # label.width 25 + # label.anchor w + # } + # button $w.in2dframe.btn -text "Browse" -command { + # set types { { "Log file" {.log} } } + # set in2dlogfile [tk_getOpenFile -filetypes $types -initialfile $in2dlogfile] + # } + # button $w.in2dframe.test -text "Test in2d meshing" -command { ngtest in2d $in2dlogfile } - pack $w.in2dframe.test -side left -anchor s -padx 4 -pady 4 - pack $w.in2dframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 - pack $w.in2dframe.btn -side left -anchor s -padx 4 -pady 4 + # pack $w.in2dframe.test -side left -anchor s -padx 4 -pady 4 + # pack $w.in2dframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 + # pack $w.in2dframe.btn -side left -anchor s -padx 4 -pady 4 -# geo testing # - frame $w.geoframe - pack $w.geoframe +# # geo testing # + # frame $w.geoframe + # pack $w.geoframe - set geologfile "" - tixLabelEntry $w.geoframe.ent -label "geo log-file: console if empty" \ - -labelside top \ - -options { - entry.textVariable geologfile - entry.width 35 - label.width 25 - label.anchor w - } - button $w.geoframe.btn -text "Browse" -command { - set types { { "Log file" {.log} } } - set geologfile [tk_getOpenFile -filetypes $types -initialfile $geologfile] - } - button $w.geoframe.test -text "Test geo meshing" -command { ngtest geo $geologfile } + # set geologfile "" + # tixLabelEntry $w.geoframe.ent -label "geo log-file: console if empty" \ + # -labelside top \ + # -options { + # entry.textVariable geologfile + # entry.width 35 + # label.width 25 + # label.anchor w + # } + # button $w.geoframe.btn -text "Browse" -command { + # set types { { "Log file" {.log} } } + # set geologfile [tk_getOpenFile -filetypes $types -initialfile $geologfile] + # } + # button $w.geoframe.test -text "Test geo meshing" -command { ngtest geo $geologfile } - pack $w.geoframe.test -side left -anchor s -padx 4 -pady 4 - pack $w.geoframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 - pack $w.geoframe.btn -side left -anchor s -padx 4 -pady 4 + # pack $w.geoframe.test -side left -anchor s -padx 4 -pady 4 + # pack $w.geoframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 + # pack $w.geoframe.btn -side left -anchor s -padx 4 -pady 4 -# stl testing # - frame $w.stlframe - pack $w.stlframe +# # stl testing # + # frame $w.stlframe + # pack $w.stlframe - set stllogfile "" - tixLabelEntry $w.stlframe.ent -label "stl log-file: console if empty" \ - -labelside top \ - -options { - entry.textVariable stllogfile - entry.width 35 - label.width 25 - label.anchor w - } - button $w.stlframe.btn -text "Browse" -command { - set types { { "Log file" {.log} } } - set stllogfile [tk_getOpenFile -filetypes $types -initialfile $stllogfile] - } - button $w.stlframe.test -text "Test stl meshing" -command { ngtest stl $stllogfile } + # set stllogfile "" + # tixLabelEntry $w.stlframe.ent -label "stl log-file: console if empty" \ + # -labelside top \ + # -options { + # entry.textVariable stllogfile + # entry.width 35 + # label.width 25 + # label.anchor w + # } + # button $w.stlframe.btn -text "Browse" -command { + # set types { { "Log file" {.log} } } + # set stllogfile [tk_getOpenFile -filetypes $types -initialfile $stllogfile] + # } + # button $w.stlframe.test -text "Test stl meshing" -command { ngtest stl $stllogfile } - pack $w.stlframe.test -side left -anchor s -padx 4 -pady 4 - pack $w.stlframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 - pack $w.stlframe.btn -side left -anchor s -padx 4 -pady 4 + # pack $w.stlframe.test -side left -anchor s -padx 4 -pady 4 + # pack $w.stlframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 + # pack $w.stlframe.btn -side left -anchor s -padx 4 -pady 4 -# pde testing # - frame $w.pdeframe - pack $w.pdeframe +# # pde testing # + # frame $w.pdeframe + # pack $w.pdeframe - set pdelogfile "" - tixLabelEntry $w.pdeframe.ent -label "pde log-file: console if empty" \ - -labelside top \ - -options { - entry.textVariable pdelogfile - entry.width 35 - label.width 25 - label.anchor w - } - button $w.pdeframe.btn -text "Browse" -command { - set types { { "Log file" {.log} } } - set pdelogfile [tk_getOpenFile -filetypes $types -initialfile $pdelogfile] - } - button $w.pdeframe.test -text "Test ngsolve pde's" -command { ngtest pde $pdelogfile } + # set pdelogfile "" + # tixLabelEntry $w.pdeframe.ent -label "pde log-file: console if empty" \ + # -labelside top \ + # -options { + # entry.textVariable pdelogfile + # entry.width 35 + # label.width 25 + # label.anchor w + # } + # button $w.pdeframe.btn -text "Browse" -command { + # set types { { "Log file" {.log} } } + # set pdelogfile [tk_getOpenFile -filetypes $types -initialfile $pdelogfile] + # } + # button $w.pdeframe.test -text "Test ngsolve pde's" -command { ngtest pde $pdelogfile } - pack $w.pdeframe.test -side left -anchor s -padx 4 -pady 4 - pack $w.pdeframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 - pack $w.pdeframe.btn -side left -anchor s -padx 4 -pady 4 + # pack $w.pdeframe.test -side left -anchor s -padx 4 -pady 4 + # pack $w.pdeframe.ent -side left -expand yes -fill x -anchor s -padx 4 -pady 4 + # pack $w.pdeframe.btn -side left -anchor s -padx 4 -pady 4 - wm title $w "Testing" - focus .runtest_dlg - } -} + # wm title $w "Testing" + # focus .runtest_dlg + # } +# } diff --git a/ng/menustat.tcl b/ng/menustat.tcl index b51cf1db..bfb7c749 100644 --- a/ng/menustat.tcl +++ b/ng/menustat.tcl @@ -854,20 +854,31 @@ ttk::button .bubar.center -text "Center" \ -command { Ng_Center; redraw } # tk_optionMenu .bubar.modesel drawmode "rotate" "move " "zoom " -tixOptionMenu .bubar.modesel \ - -options { - label.width 0 - label.anchor e - menubutton.width 6 - } \ - -variable drawmode +# tixOptionMenu .bubar.modesel \ + # -options { + # label.width 0 + # label.anchor e + # menubutton.width 6 + # } \ + # -variable drawmode -.bubar.modesel add command rotate -label Rotate -.bubar.modesel add command move -label Move -.bubar.modesel add command zoom -label Zoom +# .bubar.modesel add command rotate -label Rotate +# .bubar.modesel add command move -label Move +# .bubar.modesel add command zoom -label Zoom + +ttk::menubutton .bubar.modesel -menu .bubar.modesel.menu -text "" -width 6 + +menu .bubar.modesel.menu -tearoff 0 + +.bubar.modesel.menu add command -label "Rotate" -command "set drawmode \"rotate\" ;.bubar.modesel configure -text \"Rotate\"" +.bubar.modesel.menu add command -label "Move" -command "set drawmode \"move\" ;.bubar.modesel configure -text \"Move\"" +.bubar.modesel.menu add command -label "Zoom" -command "set drawmode \"zoom\" ;.bubar.modesel configure -text \"Zoom\"" + +.bubar.modesel.menu invoke "Rotate" + set viewvals { geometry specpoints mesh solution} if { $userlevel == 3} { set viewvals { geometry mesh specpoints surfmeshing modelview solution} @@ -881,19 +892,20 @@ set viewvallabs(surfmeshing) "Mesh Gen" set viewvallabs(modelview) "Modeller" set viewvallabs(solution) "Solution" -tixOptionMenu .bubar.selview \ - -options { - label.width 0 - label.anchor e - menubutton.width 10 - } \ +# tixOptionMenu .bubar.selview \ + # -options { + # label.width 0 + # label.anchor e + # menubutton.width 10 + # } \ -foreach viewv $viewvals { - .bubar.selview add command $viewv -label $viewvallabs($viewv) -} +# foreach viewv $viewvals { + # .bubar.selview add command $viewv -label $viewvallabs($viewv) +# } + +# .bubar.selview config -variable selectvisual +# .bubar.selview config -command { Ng_SetVisParameters; redraw } -.bubar.selview config -variable selectvisual -.bubar.selview config -command { Ng_SetVisParameters; redraw } # pack .bubar.modesel -side right @@ -961,8 +973,9 @@ pack .statbar.selslabel .statbar.selsval -side left -ipady 3p # } -tixMeter .statbar.per -value 0 -text 0% -.statbar.per configure -fillcolor blue +#tixMeter .statbar.per -value 0 -text 0% +ttk::progressbar .statbar.per -value 0 -maximum 1 +#.statbar.per configure -fillcolor blue pack .statbar.per -side right pack .statbar.task -side right -ipady 4 @@ -1017,7 +1030,8 @@ proc timer2 { } { # set mem_moveable [Ng_MemInfo moveable] - .statbar.per config -value [expr $status_percent/100] -text [format %2.1f [expr 0.1*int(10*$status_percent)]]% + .statbar.per configure -value [expr $status_percent/100] +# -text [format %2.1f [expr 0.1*int(10*$status_percent)]]% if { $multithread_running } { diff --git a/ng/ngvisual.tcl b/ng/ngvisual.tcl index 4d71e924..2e77d3db 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 @@ -784,30 +882,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 0" \ + -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 0" \ + -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,15 +936,21 @@ 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.fieldlinesthickness -width 6 -increment 0.01 -validate focus -validatecommand "my_validatespinbox %W %P 0" \ + -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 @@ -873,8 +995,16 @@ proc fieldlinesdialog { } { } { toplevel .fieldlines_help - tixScrolledText .fieldlines_help.ht -scrollbar y - set text .fieldlines_help.ht.text + set f [frame .fieldlines_help.ht] + #ttk::scrollbar $f.hsb -orient horizontal -command [list $f.t xview] + ttk::scrollbar $f.vsb -orient vertical -command [list $f.t yview] + text $f.t -yscrollcommand [list $f.vsb set] + grid $f.t -row 0 -column 0 -sticky nsew + grid $f.vsb -row 0 -column 1 -sticky nsew + grid columnconfigure $f 0 -weight 1 + grid rowconfigure $f 0 -weight 1 + #tixScrolledText .fieldlines_help.ht -scrollbar y + set text $f.t $text configure -setgrid true -wrap word diff --git a/ng/sockets.tcl b/ng/sockets.tcl index 49569af9..b0cd5875 100644 --- a/ng/sockets.tcl +++ b/ng/sockets.tcl @@ -33,24 +33,24 @@ proc clientsocketdialog { } { global sockets.serverhost global sockets.serverport - frame $w.general - frame $w.host - label $w.host.lab -text "Serverhost: " - entry $w.host.name -width 30 -relief sunken -textvariable sockets.serverhost + ttk::frame $w.general + ttk::frame $w.host + ttk::label $w.host.lab -text "Serverhost: " + ttk::entry $w.host.name -width 30 -textvariable sockets.serverhost pack $w.host.lab $w.host.name -side left pack $w.host - frame $w.ports - label $w.ports.lab1 -text "Serverport: " - entry $w.ports.statport -width 6 -relief sunken -textvariable sockets.serverport + ttk::frame $w.ports + ttk::label $w.ports.lab1 -text "Serverport: " + ttk::entry $w.ports.statport -width 6 -textvariable sockets.serverport pack $w.ports.lab1 $w.ports.statport -side left pack $w.ports - frame $w.listboxes + ttk::frame $w.listboxes - frame $w.listboxes.choosesocketframe + ttk::frame $w.listboxes.choosesocketframe tixScrolledListBox $w.listboxes.choosesocketframe.choosesocket -scrollbar auto @@ -62,21 +62,21 @@ proc clientsocketdialog { } { ${sockets.serverlistbox} configure -selectmode browse ${sockets.serverlistbox} configure -exportselection false - button $w.addserver -text "Add ServerSocket" -command { + ttk::button $w.addserver -text "Add ServerSocket" -command { Ng_Socket addserver ${sockets.serverport} ${sockets.serverhost} updateserverlist } pack $w.addserver - label $w.linefeed -text "\n" + ttk::label $w.linefeed -text "\n" pack $w.linefeed - frame $w.clientidframe - label $w.clientidframe.lab -text "Client ID: "; + ttk::frame $w.clientidframe + ttk::label $w.clientidframe.lab -text "Client ID: "; global sockets.myidlabel - entry $w.clientidframe.val -width 5 -relief sunken -textvariable sockets.myidlabel - button $w.clientidframe.but -text "Set" -command { + ttk::entry $w.clientidframe.val -width 5 -textvariable sockets.myidlabel + ttk::button $w.clientidframe.but -text "Set" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { set opserver [lindex $opsel 0] @@ -95,13 +95,13 @@ proc clientsocketdialog { } { # pack $w.clientidlabel - label $w.listboxes.choosesocketframe.chooselab -text [format "\n\n%-16s %6s %6s " Host Socket MyID ] + ttk::label $w.listboxes.choosesocketframe.chooselab -text [format "\n\n%-16s %6s %6s " Host Socket MyID ] pack $w.listboxes.choosesocketframe.chooselab pack $w.listboxes.choosesocketframe.choosesocket - frame $w.listboxes.choosesocketframe.serverbuttons + ttk::frame $w.listboxes.choosesocketframe.serverbuttons - button $w.listboxes.choosesocketframe.serverbuttons.save -text "Save" -command { + ttk::button $w.listboxes.choosesocketframe.serverbuttons.save -text "Save" -command { Ng_Socket saveserverlist } @@ -109,7 +109,7 @@ proc clientsocketdialog { } { Ng_Socket loadserverlist updateserverlist - button $w.listboxes.choosesocketframe.serverbuttons.delete -text "Delete" -command { + ttk::button $w.listboxes.choosesocketframe.serverbuttons.delete -text "Delete" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { Ng_Socket deletesocket [lindex $opsel 0] @@ -120,17 +120,17 @@ proc clientsocketdialog { } { pack $w.listboxes.choosesocketframe.serverbuttons.save $w.listboxes.choosesocketframe.serverbuttons.delete -side left pack $w.listboxes.choosesocketframe.serverbuttons - frame $w.listboxes.statusframe + ttk::frame $w.listboxes.statusframe - label $w.listboxes.statusframe.statuslabel1 -text "\n\njobqueue" + ttk::label $w.listboxes.statusframe.statuslabel1 -text "\n\njobqueue" tixScrolledListBox $w.listboxes.statusframe.queuestatus -scrollbar auto - label $w.listboxes.statusframe.statuslabel2 -text "\ncurrent job" + ttk::label $w.listboxes.statusframe.statuslabel2 -text "\ncurrent job" tixScrolledListBox $w.listboxes.statusframe.currentjobstatus -scrollbar auto - label $w.listboxes.statusframe.statuslabel3 -text "\nanswers" + ttk::label $w.listboxes.statusframe.statuslabel3 -text "\nanswers" tixScrolledListBox $w.listboxes.statusframe.answers -scrollbar auto @@ -157,7 +157,7 @@ proc clientsocketdialog { } { ${sockets.answerlistbox} configure -selectmode browse ${sockets.answerlistbox} configure -exportselection false - button $w.listboxes.statusframe.updatebutton -text "Update" -command { + ttk::button $w.listboxes.statusframe.updatebutton -text "Update" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { set opserver [lindex $opsel 0] @@ -199,14 +199,14 @@ proc clientsocketdialog { } { pack $w.listboxes - label $w.lab1 -text "\n" + ttk::label $w.lab1 -text "\n" pack $w.lab1 - frame $w.buttons1 - frame $w.buttons2 + ttk::frame $w.buttons1 + ttk::frame $w.buttons2 - button $w.buttons1.getid -text "Get ID" -command { + ttk::button $w.buttons1.getid -text "Get ID" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { set opserver [lindex $opsel 0] @@ -216,7 +216,7 @@ proc clientsocketdialog { } { } } - button $w.buttons1.killjob -text "Kill Cur. Job" -command { + ttk::button $w.buttons1.killjob -text "Kill Cur. Job" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { set opserver [lindex $opsel 0] @@ -224,7 +224,7 @@ proc clientsocketdialog { } { } } - button $w.buttons2.sendmesh -text "Send Mesh" -command { + ttk::button $w.buttons2.sendmesh -text "Send Mesh" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { set opserver [lindex $opsel 0] @@ -233,7 +233,7 @@ proc clientsocketdialog { } { } } - button $w.buttons2.sendpde -text "Send PDE" -command { + ttk::button $w.buttons2.sendpde -text "Send PDE" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { set opserver [lindex $opsel 0] @@ -241,7 +241,7 @@ proc clientsocketdialog { } { } } - button $w.buttons2.solvepde -text "Solve PDE" -command { + ttk::button $w.buttons2.solvepde -text "Solve PDE" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { set opserver [lindex $opsel 0] @@ -249,7 +249,7 @@ proc clientsocketdialog { } { } } - button $w.buttons2.writesol -text "Write Solution" -command { + ttk::button $w.buttons2.writesol -text "Write Solution" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { set opserver [lindex $opsel 0] @@ -257,7 +257,7 @@ proc clientsocketdialog { } { } } - button $w.buttons2.sendsol -text "Receive Solution" -command { + ttk::button $w.buttons2.sendsol -text "Receive Solution" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { set opserver [lindex $opsel 0] @@ -265,7 +265,7 @@ proc clientsocketdialog { } { } } - button $w.buttons1.blockserver -text "Block Server" -command { + ttk::button $w.buttons1.blockserver -text "Block Server" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { set opserver [lindex $opsel 0] @@ -273,7 +273,7 @@ proc clientsocketdialog { } { } } - button $w.buttons1.unblockserver -text "UnBlock Server" -command { + ttk::button $w.buttons1.unblockserver -text "UnBlock Server" -command { set opsel [${sockets.serverlistbox} curselection] if {[llength $opsel] > 0} { set opserver [lindex $opsel 0] @@ -299,5 +299,5 @@ proc clientsocketdialog { } { } -.ngmenu.special add command -label "Client Socket" \ +#.ngmenu.special add command -label "Client Socket" \ -command { clientsocketdialog }