diff options
Diffstat (limited to 'tkblt/tests')
-rw-r--r-- | tkblt/tests/all.tcl | 11 | ||||
-rw-r--r-- | tkblt/tests/axis.tcl | 105 | ||||
-rw-r--r-- | tkblt/tests/barelement.tcl | 97 | ||||
-rw-r--r-- | tkblt/tests/bargraph.tcl | 80 | ||||
-rw-r--r-- | tkblt/tests/barpen.tcl | 51 | ||||
-rw-r--r-- | tkblt/tests/base.tcl | 142 | ||||
-rw-r--r-- | tkblt/tests/crosshairs.tcl | 26 | ||||
-rw-r--r-- | tkblt/tests/legend.tcl | 101 | ||||
-rw-r--r-- | tkblt/tests/lineelement.tcl | 105 | ||||
-rw-r--r-- | tkblt/tests/linegraph.tcl | 75 | ||||
-rw-r--r-- | tkblt/tests/linemarker.tcl | 34 | ||||
-rw-r--r-- | tkblt/tests/linepen.tcl | 55 | ||||
-rw-r--r-- | tkblt/tests/marker.tcl | 33 | ||||
-rw-r--r-- | tkblt/tests/markers.tcl | 4 | ||||
-rw-r--r-- | tkblt/tests/polygonmarker.tcl | 30 | ||||
-rw-r--r-- | tkblt/tests/ps.tcl | 29 | ||||
-rw-r--r-- | tkblt/tests/test.tcl | 10 | ||||
-rw-r--r-- | tkblt/tests/textmarker.tcl | 44 |
18 files changed, 1032 insertions, 0 deletions
diff --git a/tkblt/tests/all.tcl b/tkblt/tests/all.tcl new file mode 100644 index 0000000..badd21f --- /dev/null +++ b/tkblt/tests/all.tcl @@ -0,0 +1,11 @@ +source linegraph.tcl +source lineelement.tcl +source linepen.tcl +source bargraph.tcl +source barelement.tcl +source barpen.tcl +source axis.tcl +source legend.tcl +source crosshairs.tcl +source markers.tcl + diff --git a/tkblt/tests/axis.tcl b/tkblt/tests/axis.tcl new file mode 100644 index 0000000..80f97ea --- /dev/null +++ b/tkblt/tests/axis.tcl @@ -0,0 +1,105 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +$graph axis configure x -bd 2 -background cyan -title "X\nAxis" -limitsformat "%g" +$graph axis configure y -bd 2 -background cyan -title "Y\nAxis" +bltCmd $graph axis activate y + +puts stderr "Testing Axis..." + +bltTest3 $graph axis y -activeforeground red $dops +bltTest3 $graph axis y -activerelief sunken $dops +#bltTest3 $graph axis x -autorange 10 $dops +bltTest3 $graph axis x -background yellow $dops +bltTest3 $graph axis x -bg blue $dops +bltTest3 $graph axis x -bindtags {aa} 0 +bltTest3 $graph axis y -bd 4 $dops +bltTest3 $graph axis y -borderwidth 4 $dops +#bltTest3 $graph axis x -checklimits $dops +bltTest3 $graph axis x -color red $dops +#bltTest3 $graph axis x -command $dops +bltTest3 $graph axis x -descending yes $dops +bltTest3 $graph axis x -exterior no $dops +bltTest3 $graph axis x -fg magenta $dops +bltTest3 $graph axis x -foreground yellow $dops +bltTest3 $graph axis x -grid no $dops +bltTest3 $graph axis x -gridcolor blue $dops +bltTest3 $graph axis x -griddashes {8 3} $dops +bltTest3 $graph axis x -gridlinewidth 2 $dops +bltTest3 $graph axis x -gridminor no $dops +bltTest3 $graph axis x -gridminorcolor blue $dops +bltTest3 $graph axis x -gridminordashes {8 3} $dops +bltTest3 $graph axis x -gridminorlinewidth 2 $dops +bltTest3 $graph axis x -hide yes $dops +bltTest3 $graph axis x -justify left $dops +bltTest3 $graph axis x -justify center $dops +bltTest3 $graph axis x -justify right $dops +bltTest3 $graph axis x -labeloffset yes $dops +bltTest3 $graph axis x -limitscolor red $dops +bltTest3 $graph axis x -limitsfont {times 18 bold italic} $dops +bltTest3 $graph axis x -limitsformat "%e" $dops +bltTest3 $graph axis x -linewidth 2 $dops +bltTest3 $graph axis x -logscale yes $dops +#bltTest3 $graph axis x -loosemin $dops +#bltTest3 $graph axis x -loosemax $dops +#bltTest3 $graph axis x -majorticks $dops +#bltTest3 $graph axis x -max $dops +#bltTest3 $graph axis x -min $dops +#bltTest3 $graph axis x -minorticks $dops +bltTest3 $graph axis x -relief flat $dops +bltTest3 $graph axis x -relief groove $dops +bltTest3 $graph axis x -relief raised $dops +bltTest3 $graph axis x -relief ridge $dops +bltTest3 $graph axis x -relief solid $dops +bltTest3 $graph axis x -relief sunken $dops +bltTest3 $graph axis x -rotate 45 $dops +#bltTest3 $graph axis x -scrollcommand $dops +#bltTest3 $graph axis x -scrollincrement $dops +#bltTest3 $graph axis x -scrollmax $dops +#bltTest3 $graph axis x -scrollmin $dops +##bltTest3 $graph axis x -shiftby 10 $dops +bltTest3 $graph axis x -showticks no $dops +bltTest3 $graph axis x -stepsize 10 $dops +bltTest3 $graph axis x -subdivisions 4 $dops +##bltTest3 $graph axis x -tickanchor n $dops +bltTest3 $graph axis x -tickfont {times 12 bold italic} $dops +bltTest3 $graph axis x -ticklength 20 $dops +bltTest3 $graph axis x -tickdefault 10 $dops +bltTest3 $graph axis x -title {This is a Title} $dops +bltTest3 $graph axis x -titlealternate yes $dops +bltTest3 $graph axis x -titlecolor yellow $dops +bltTest3 $graph axis x -titlefont {times 24 bold italic} $dops + +#bltCmd $graph axis activate foo +#bltCmd $graph axis bind x +bltCmd $graph axis cget x -color +bltCmd $graph axis configure x +bltCmd $graph axis configure x -color +#bltCmd $graph axis create foo +#bltCmd $graph axis deactivate foo +#bltCmd $graph axis delete foo +#bltCmd $graph axis invtransform x +#bltCmd $graph axis limits x +#bltCmd $graph axis margin x +#bltCmd $graph axis names x +#bltCmd $graph axis transform x +#bltCmd $graph axis type x +#bltCmd $graph axis view x + +#bltCmd $graph xaxis activate +#bltCmd $graph xaxis bind +bltCmd $graph xaxis cget -color +bltCmd $graph xaxis configure +bltCmd $graph xaxis configure -color +#bltCmd $graph xaxis deactivate +#bltCmd $graph xaxis invtransform +#bltCmd $graph xaxis limits +#bltCmd $graph xaxis transform +#bltCmd $graph xaxis use +#bltCmd $graph xaxis view + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/barelement.tcl b/tkblt/tests/barelement.tcl new file mode 100644 index 0000000..5b8cb07 --- /dev/null +++ b/tkblt/tests/barelement.tcl @@ -0,0 +1,97 @@ +source base.tcl + +set w .bar +set graph [bltBarGraph $w] + +$graph element configure data1 -color red -showvalues y +$graph element configure data2 -color blue + +$graph pen create foo -showvalues y -color purple +$graph element activate data3 + +puts stderr "Testing Bar Element..." + +bltTest3 $graph element data3 -activepen foo $dops +bltTest3 $graph element data2 -background yellow $dops +bltTest3 $graph element data2 -barwidth 1 $dops +bltTest3 $graph element data2 -bd 4 $dops +bltTest3 $graph element data2 -bg yellow $dops +bltTest3 $graph element data2 -bindtags {aa} 0 +bltTest3 $graph element data2 -borderwidth 4 $dops +bltTest3 $graph element data2 -color yellow $dops +bltTest3 $graph element data1 -data {0.2 8 0.4 20 0.6 31 0.8 41 1.0 50 1.2 59 1.4 65 1.6 70 1.8 75 2.0 85} $dops +bltTest3 $graph element data2 -errorbarcolor green $dops +bltTest3 $graph element data2 -errorbarwidth 2 $dops +bltTest3 $graph element data2 -errorbarcap 10 $dops +bltTest3 $graph element data2 -fg yellow $dops +bltTest3 $graph element data1 -fill cyan $dops +bltTest3 $graph element data2 -foreground green $dops +bltTest3 $graph element data2 -hide yes $dops +bltTest3 $graph element data2 -label "This is a test" $dops +bltTest3 $graph element data2 -legendrelief groove $dops +bltTest3 $graph element data2 -mapx x2 $dops +bltTest3 $graph element data2 -mapy y2 $dops +bltTest3 $graph element data1 -outline red $dops +bltTest3 $graph element data2 -pen foo $dops +bltTest3 $graph element data2 -relief flat $dops +bltTest3 $graph element data2 -relief groove $dops +bltTest3 $graph element data2 -relief raised $dops +bltTest3 $graph element data2 -relief ridge $dops +bltTest3 $graph element data2 -relief solid $dops +bltTest3 $graph element data2 -relief sunken $dops +bltTest3 $graph element data2 -showerrorbars no $dops +bltTest3 $graph element data1 -showvalues none $dops +bltTest3 $graph element data1 -showvalues x $dops +bltTest3 $graph element data1 -showvalues both $dops +#bltTest3 $graph element data2 -stack $dops +#bltTest3 $graph element data2 -styles $dops +bltTest3 $graph element data1 -valueanchor nw $dops +bltTest3 $graph element data1 -valueanchor n $dops +bltTest3 $graph element data1 -valueanchor ne $dops +bltTest3 $graph element data1 -valueanchor e $dops +bltTest3 $graph element data1 -valueanchor se $dops +bltTest3 $graph element data1 -valueanchor s $dops +bltTest3 $graph element data1 -valueanchor sw $dops +bltTest3 $graph element data1 -valueanchor w $dops +bltTest3 $graph element data1 -valuecolor cyan $dops +bltTest3 $graph element data1 -valuefont {times 18 bold italic} $dops +bltTest3 $graph element data1 -valueformat "%e" $dops +bltTest3 $graph element data1 -valuerotate 45 $dops +#bltTest3 $graph element data2 -weights $dops +bltTest3 $graph element data1 -x {0 .2 .4 .6 .8 1 1.2 1.4 1.6 1.8} $dops +bltTest3 $graph element data1 -xdata {0 .2 .4 .6 .8 1 1.2 1.4 1.6 1.8} $dops +bltTest3 $graph element data2 -xerror {.1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1} $dops +#bltTest3 $graph element data2 -xhigh $dops +#bltTest3 $graph element data2 -xlow $dops +bltTest3 $graph element data1 -y {8 20 31 41 50 59 65 70 75 85} $dops +bltTest3 $graph element data1 -ydata {8 20 31 41 50 59 65 70 75 85} $dops +bltTest3 $graph element data2 -yerror {5 5 5 5 5 5 5 5 5 5 5} $dops +#bltTest3 $graph element data2 -yhigh $dops +#bltTest3 $graph element data2 -ylow $dops + +bltCmd $graph element activate data2 +bltCmd $graph element deactivate data2 +#bltCmd $graph element bind data1 <Button-1> [list puts "%x %y"] +bltCmd $graph element cget data1 -showvalues +bltCmd $graph element configure data1 +bltCmd $graph element configure data1 -showvalues +#bltCmd $graph element closest 50 50 +#bltCmd $graph element closest 50 50 data1 data2 +bltCmd $graph element create data4 +bltCmd $graph element create data5 +bltCmd $graph element delete data4 data5 +bltCmd $graph element exists data1 +bltCmd $graph element lower data1 +bltCmd $graph element lower data2 data3 +bltCmd $graph element names +bltCmd $graph element names data1 +bltCmd $graph element raise data2 +bltCmd $graph element raise data2 data3 +bltCmd $graph element raise data1 +bltCmd $graph element show data2 +bltCmd $graph element show {data1 data2 data3} +bltCmd $graph element type data1 + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/bargraph.tcl b/tkblt/tests/bargraph.tcl new file mode 100644 index 0000000..20f067d --- /dev/null +++ b/tkblt/tests/bargraph.tcl @@ -0,0 +1,80 @@ +source base.tcl + +set w .bar +set graph [bltBarGraph $w] + +puts stderr "Testing Bar Graph..." + +# Graph +bltTest $graph -aspect 2 $dops +bltTest $graph -background red $dops +bltTest $graph -barmode stacked $dops +bltTest $graph -barmode aligned $dops +bltTest $graph -barmode overlap $dops +bltTest $graph -barwidth .15 $dops +#bltTest $graph -baseline $dops +bltTest $graph -bd 50 $dops +bltTest $graph -bg green $dops +bltTest $graph -bm 50 $dops +bltTest $graph -borderwidth 50 $dops +bltTest $graph -bottommargin 50 $dops +#bltTest $graph -bufferelements $dops +#bltTest $graph -buffergraph $dops +bltTest $graph -cursor cross $dops +bltTest $graph -fg blue $dops +bltTest $graph -font {times 36 bold italic} $dops +bltTest $graph -foreground cyan $dops +#bltTest $graph -halo $dops +bltTest $graph -height 300 $dops +#bltTest $graph -highlightbackground $dops +#bltTest $graph -highlightcolor $dops +#bltTest $graph -highlightthickness $dops +bltTest $graph -invertxy yes $dops +bltTest $graph -justify left $dops +bltTest $graph -justify center $dops +bltTest $graph -justify right $dops +bltTest $graph -leftmargin 50 $dops +bltTest $graph -lm 50 $dops +bltTest $graph -plotbackground cyan $dops +bltTest $graph -plotborderwidth 50 $dops +bltTest $graph -plotpadx 50 $dops +bltTest $graph -plotpady 50 $dops +bltTest $graph -plotrelief groove $dops +bltTest $graph -relief groove $dops +bltTest $graph -rightmargin 50 $dops +bltTest $graph -rm 50 $dops +#bltTest $graph -searchhalo $dops +#bltTest $graph -searchmode $dops +#bltTest $graph -searchalong $dops +#bltTest $graph -stackaxes $dops +#bltTest $graph -takefocus $dops +bltTest $graph -title "This is a Title" $dops +bltTest $graph -tm 50 $dops +bltTest $graph -topmargin 50 $dops +bltTest $graph -width 300 $dops +bltTest $graph -plotwidth 300 $dops +bltTest $graph -plotheight 300 $dops + +##bltCmd $graph axis +bltCmd $graph cget -background +bltCmd $graph configure +bltCmd $graph configure +bltCmd $graph configure -background cyan +##bltCmd $graph crosshairs +##bltCmd $graph element +#bltCmd $graph extents +#bltCmd $graph inside +#bltCmd $graph invtransform +##bltCmd $graph legend +##bltCmd $graph marker +##bltCmd $graph pen +##bltCmd $graph postscript +#bltCmd $graph transform +##bltCmd $graph x2axis +##bltCmd $graph xaxis +##bltCmd $graph y2axis +##bltCmd $graph yaxis + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/barpen.tcl b/tkblt/tests/barpen.tcl new file mode 100644 index 0000000..d06928b --- /dev/null +++ b/tkblt/tests/barpen.tcl @@ -0,0 +1,51 @@ +source base.tcl + +set w .bar +set graph [bltBarGraph $w] + +$graph pen create foo -color red -showvalues y +$graph element configure data2 -pen foo + +puts stderr "Testing Bar Pen..." + +bltTest3 $graph pen foo -background yellow $dops +bltTest3 $graph pen foo -bd 4 $dops +bltTest3 $graph pen foo -bg yellow $dops +bltTest3 $graph pen foo -borderwidth 4 $dops +bltTest3 $graph pen foo -color yellow $dops +bltTest3 $graph pen foo -errorbarcolor green $dops +bltTest3 $graph pen foo -errorbarwidth 2 $dops +bltTest3 $graph pen foo -errorbarcap 10 $dops +bltTest3 $graph pen foo -fg yellow $dops +bltTest3 $graph pen foo -fill cyan $dops +bltTest3 $graph pen foo -foreground green $dops +bltTest3 $graph pen foo -outline red $dops +bltTest3 $graph pen foo -relief flat $dops +bltTest3 $graph pen foo -showerrorbars no $dops +bltTest3 $graph pen foo -showvalues none $dops +bltTest3 $graph pen foo -showvalues x $dops +bltTest3 $graph pen foo -showvalues both $dops +bltTest3 $graph pen foo -valueanchor nw $dops +bltTest3 $graph pen foo -valueanchor n $dops +bltTest3 $graph pen foo -valueanchor ne $dops +bltTest3 $graph pen foo -valueanchor e $dops +bltTest3 $graph pen foo -valueanchor se $dops +bltTest3 $graph pen foo -valueanchor s $dops +bltTest3 $graph pen foo -valueanchor sw $dops +bltTest3 $graph pen foo -valueanchor w $dops +bltTest3 $graph pen foo -valuecolor cyan $dops +bltTest3 $graph pen foo -valuefont {times 18 bold italic} $dops +bltTest3 $graph pen foo -valueformat "%e" $dops +bltTest3 $graph pen foo -valuerotate 45 $dops + +bltCmd $graph pen cget foo -color +bltCmd $graph pen configure foo +bltCmd $graph pen configure foo -color +bltCmd $graph pen create bar +bltCmd $graph pen delete bar +bltCmd $graph pen names +bltCmd $graph pen type foo + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/base.tcl b/tkblt/tests/base.tcl new file mode 100644 index 0000000..e3dac2e --- /dev/null +++ b/tkblt/tests/base.tcl @@ -0,0 +1,142 @@ +package require tkblt + +#set sleep 1000 +set sleep 500 +if {![info exists dops]} { + set dops 0 +} + +proc bltPlot {w title} { + toplevel $w + wm title $w $title + wm protocol $w WM_DELETE_WINDOW [list bltPlotDestroy $w] + + set mb ${w}mb + menu $mb + $w configure -menu $mb +} + +proc bltPlotDestroy {w} { + destroy ${w}mb + destroy $w +} + +proc bltTest {graph option value {dops 0}} { + global sleep + + puts stderr " $option $value" + set org [$graph cget $option] + $graph configure $option $value + update + if {$dops} { + $graph postscript output foo.ps + exec open /Applications/Preview.app/ foo.ps + } + after $sleep +# read stdin 1 + $graph configure $option $org + update + after $sleep +} + +proc bltTest2 {graph which option value {dops 0}} { + global sleep + + puts stderr " $option $value" + set org [$graph $which cget $option] + $graph $which configure $option $value + update + if {$dops} { + $graph postscript output foo.ps + exec open /Applications/Preview.app/ foo.ps + } + after $sleep +# read stdin 1 + $graph $which configure $option $org + update + after $sleep +} + +proc bltTest3 {graph which item option value {dops 0}} { + global sleep + + puts stderr " $item $option $value" + set org [$graph $which cget $item $option] + $graph $which configure $item $option $value + update + if {$dops} { + $graph postscript output foo.ps + exec open /Applications/Preview.app/ foo.ps + } + after $sleep +# read stdin 1 + $graph $which configure $item $option $org + update + after $sleep +} + +proc bltCmd {graph args} { + global sleep + + puts stderr " $graph $args" + eval $graph $args + update + after $sleep +# read stdin 1 +} + +proc bltElements {graph} { + blt::vector create xv(10) + blt::vector create yv(10) + xv set { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 } + yv set { 5 10 10 15 15 10 20 25 30 35 } + + $graph element create data1 -data {0.2 13 0.4 25 0.6 36 0.8 46 1.0 55 1.2 64 1.4 70 1.6 75 1.8 80 2.0 90} + + $graph element create data2 \ + -xdata {0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0} \ + -ydata {26 50 72 92 110 128 140 150 160 180} \ + -xerror {.05 .05 .05 .05 .05 .05 .05 .05 .05 .05} \ + -yerror {10 10 10 10 10 10 10 10 10 10 10} \ + -color red + + $graph element create data3 -xdata xv -ydata yv -color green + + $graph legend configure -title "Legend" +} + +proc bltBarGraph {w} { + global sleep + + bltPlot $w "Bar Graph" + set graph [blt::barchart ${w}.gr \ + -width 600 \ + -height 500 \ + -title "Bar\nGraph" \ + -barwidth .2 \ + -barmode aligned \ + ] + pack $graph -expand yes -fill both + bltElements $graph + + update + after $sleep + return $graph +} + +proc bltLineGraph {w} { + global sleep + + bltPlot $w "Line Graph" + set graph [blt::graph ${w}.gr \ + -width 600 \ + -height 500 \ + -title "Line\nGraph" \ + ] + pack $graph -expand yes -fill both + bltElements $graph + + update + after $sleep + return $graph +} diff --git a/tkblt/tests/crosshairs.tcl b/tkblt/tests/crosshairs.tcl new file mode 100644 index 0000000..c63cea5 --- /dev/null +++ b/tkblt/tests/crosshairs.tcl @@ -0,0 +1,26 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +$graph crosshairs on +$graph crosshairs configure -x 200 -y 200 + +puts stderr "Testing Crosshairs..." + +bltTest2 $graph crosshairs -color green +bltTest2 $graph crosshairs -dashes "8 3" +bltTest2 $graph crosshairs -linewidth 3 +bltTest2 $graph crosshairs -x 100 +bltTest2 $graph crosshairs -y 100 + +bltCmd $graph crosshairs cget -color +bltCmd $graph crosshairs configure +bltCmd $graph crosshairs configure -color +bltCmd $graph crosshairs on +bltCmd $graph crosshairs off +bltCmd $graph crosshairs toggle + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/legend.tcl b/tkblt/tests/legend.tcl new file mode 100644 index 0000000..dba8da0 --- /dev/null +++ b/tkblt/tests/legend.tcl @@ -0,0 +1,101 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +$graph legend selection set data2 +$graph legend focus data1 +$graph legend configure -selectrelief groove + +puts stderr "Testing Legend..." + +#bltTest2 $graph legend -activebackground $dops +#bltTest2 $graph legend -activeborderwidth $dops +#bltTest2 $graph legend -activeforeground $dops +#bltTest2 $graph legend -activerelief $dops +bltTest2 $graph legend -anchor nw $dops +bltTest2 $graph legend -anchor n $dops +bltTest2 $graph legend -anchor ne $dops +bltTest2 $graph legend -anchor e $dops +bltTest2 $graph legend -anchor se $dops +bltTest2 $graph legend -anchor s $dops +bltTest2 $graph legend -anchor sw $dops +bltTest2 $graph legend -anchor w $dops +bltTest2 $graph legend -bg pink $dops +bltTest2 $graph legend -background cyan $dops +bltTest2 $graph legend -borderwidth 20 $dops +bltTest2 $graph legend -bd 20 $dops +bltTest2 $graph legend -columns 2 $dops +#bltTest2 $graph legend -exportselection $dops +bltTest2 $graph legend -focusdashes "8 3" $dops +bltTest2 $graph legend -focusforeground red $dops +bltTest2 $graph legend -font {times 18 bold italic} $dops +bltTest2 $graph legend -fg yellow $dops +bltTest2 $graph legend -foreground purple $dops +bltTest2 $graph legend -hide yes $dops +bltTest2 $graph legend -ipadx 20 $dops +bltTest2 $graph legend -ipady 20 $dops +#bltTest2 $graph legend -nofocusselectbackground $dops +#bltTest2 $graph legend -nofocusselectforeground $dops +bltTest2 $graph legend -padx 20 $dops +bltTest2 $graph legend -pady 20 $dops +bltTest2 $graph legend -position rightmargin $dops +bltTest2 $graph legend -position leftmargin $dops +bltTest2 $graph legend -position topmargin $dops +bltTest2 $graph legend -position bottommargin $dops +bltTest2 $graph legend -position plotarea $dops +bltTest2 $graph legend -position xy $dops +bltTest2 $graph legend -x 250 $dops +bltTest2 $graph legend -y 100 $dops +bltTest2 $graph legend -raised yes $dops +bltTest2 $graph legend -relief flat $dops +bltTest2 $graph legend -relief groove $dops +bltTest2 $graph legend -relief raised $dops +bltTest2 $graph legend -relief ridge $dops +bltTest2 $graph legend -relief solid $dops +bltTest2 $graph legend -relief sunken $dops +bltTest2 $graph legend -rows 1 $dops +#bltTest2 $graph legend -selectbackground $dops +bltTest2 $graph legend -selectborderwidth 3 $dops +#bltTest2 $graph legend -selectcommand $dops +#bltTest2 $graph legend -selectforeground $dops +#bltTest2 $graph legend -selectmode $dops +bltTest2 $graph legend -selectrelief flat $dops +bltTest2 $graph legend -title "Hello World" $dops +bltTest2 $graph legend -titlecolor red $dops +bltTest2 $graph legend -titlefont {times 24 bold italic} $dops + +#bltCmd $graph legend activate +#bltCmd $graph legend bind +bltCmd $graph legend cget -fg +bltCmd $graph legend configure +bltCmd $graph legend configure -fg +#bltCmd $graph legend curselection +#bltCmd $graph legend deactivate +bltCmd $graph legend focus data1 +bltCmd $graph legend focus +#bltCmd $graph legend get anchor +#bltCmd $graph legend get current +#bltCmd $graph legend get first +#bltCmd $graph legend get last +#bltCmd $graph legend get end +#bltCmd $graph legend get next.row +#bltCmd $graph legend get next.column +#bltCmd $graph legend get previous.row +#bltCmd $graph legend get previous.column +#bltCmd $graph legend get @100,100 +#bltCmd $graph legend get data1 +bltCmd $graph legend selection anchor data1 +bltCmd $graph legend selection mark data1 +bltCmd $graph legend selection includes data2 +bltCmd $graph legend selection present +bltCmd $graph legend selection set data1 data2 +bltCmd $graph legend selection clear data1 data2 +bltCmd $graph legend selection set data1 data2 +bltCmd $graph legend selection toggle data1 data2 +bltCmd $graph legend selection set data1 data2 +bltCmd $graph legend selection clearall + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/lineelement.tcl b/tkblt/tests/lineelement.tcl new file mode 100644 index 0000000..5edb38e --- /dev/null +++ b/tkblt/tests/lineelement.tcl @@ -0,0 +1,105 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +$graph element configure data1 -dash {8 3} -showvalues y -smooth step -symbol circle -outline yellow -outlinewidth 3 -pixels 10 + +$graph pen create foo -showvalues y -symbol circle -dashes {8 3} -color purple -linewidth 2 +$graph element activate data3 + +puts stderr "Testing Line Element.." + +bltTest3 $graph element data3 -activepen foo $dops +bltTest3 $graph element data2 -areabackground yellow $dops +bltTest3 $graph element data2 -bindtags {aa} +bltTest3 $graph element data2 -color yellow $dops +bltTest3 $graph element data2 -dashes {8 3} $dops +bltTest3 $graph element data1 -data {0.2 8 0.4 20 0.6 31 0.8 41 1.0 50 1.2 59 1.4 65 1.6 70 1.8 75 2.0 85} $dops +bltTest3 $graph element data2 -errorbarcolor green $dops +bltTest3 $graph element data2 -errorbarwidth 2 $dops +bltTest3 $graph element data2 -errorbarcap 10 $dops +bltTest3 $graph element data1 -fill cyan $dops +bltTest3 $graph element data2 -hide yes $dops +bltTest3 $graph element data2 -label "This is a test" $dops +bltTest3 $graph element data2 -legendrelief groove $dops +bltTest3 $graph element data2 -linewidth 3 $dops +bltTest3 $graph element data2 -mapx x2 $dops +bltTest3 $graph element data2 -mapy y2 $dops +bltTest3 $graph element data1 -maxsymbols 4 $dops +bltTest3 $graph element data1 -offdash black $dops +bltTest3 $graph element data1 -outline green $dops +bltTest3 $graph element data1 -outlinewidth 5 $dops +bltTest3 $graph element data2 -pen foo $dops +bltTest3 $graph element data1 -pixels 20 $dops +#bltTest3 $graph element data2 -reduce $dops +bltTest3 $graph element data1 -scalesymbols no $dops +bltTest3 $graph element data2 -showerrorbars no $dops +bltTest3 $graph element data1 -showvalues none $dops +bltTest3 $graph element data1 -showvalues x $dops +bltTest3 $graph element data1 -showvalues both $dops +bltTest3 $graph element data1 -smooth linear $dops +bltTest3 $graph element data1 -smooth cubic $dops +bltTest3 $graph element data1 -smooth quadratic $dops +bltTest3 $graph element data1 -smooth catrom $dops +#bltTest3 $graph element data2 -styles $dops +bltTest3 $graph element data1 -symbol arrow $dops +bltTest3 $graph element data1 -symbol cross $dops +bltTest3 $graph element data1 -symbol diamond $dops +bltTest3 $graph element data1 -symbol none $dops +bltTest3 $graph element data1 -symbol plus $dops +bltTest3 $graph element data1 -symbol scross $dops +bltTest3 $graph element data1 -symbol splus $dops +bltTest3 $graph element data1 -symbol square $dops +bltTest3 $graph element data1 -symbol triangle $dops +bltTest3 $graph element data2 -trace both $dops +bltTest3 $graph element data1 -valueanchor nw $dops +bltTest3 $graph element data1 -valueanchor n $dops +bltTest3 $graph element data1 -valueanchor ne $dops +bltTest3 $graph element data1 -valueanchor e $dops +bltTest3 $graph element data1 -valueanchor se $dops +bltTest3 $graph element data1 -valueanchor s $dops +bltTest3 $graph element data1 -valueanchor sw $dops +bltTest3 $graph element data1 -valueanchor w $dops +bltTest3 $graph element data1 -valuecolor cyan $dops +bltTest3 $graph element data1 -valuefont {times 18 bold italic} $dops +bltTest3 $graph element data1 -valueformat "%e" $dops +bltTest3 $graph element data1 -valuerotate 45 $dops +#bltTest3 $graph element data2 -weights $dops +bltTest3 $graph element data1 -x {0 .2 .4 .6 .8 1 1.2 1.4 1.6 1.8} $dops +bltTest3 $graph element data1 -xdata {0 .2 .4 .6 .8 1 1.2 1.4 1.6 1.8} $dops +bltTest3 $graph element data2 -xerror {.1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1} $dops +#bltTest3 $graph element data2 -xhigh $dops +#bltTest3 $graph element data2 -xlow $dops +bltTest3 $graph element data1 -y {8 20 31 41 50 59 65 70 75 85} $dops +bltTest3 $graph element data1 -ydata {8 20 31 41 50 59 65 70 75 85} $dops +bltTest3 $graph element data2 -yerror {5 5 5 5 5 5 5 5 5 5 5} $dops +#bltTest3 $graph element data2 -yhigh $dops +#bltTest3 $graph element data2 -ylow $dops + +bltCmd $graph element activate data2 +bltCmd $graph element deactivate data2 +#bltCmd $graph element bind data1 <Button-1> [list puts "%x %y"] +bltCmd $graph element cget data1 -smooth +bltCmd $graph element configure data1 +bltCmd $graph element configure data1 -smooth +#bltCmd $graph element closest 50 50 +#bltCmd $graph element closest 50 50 data1 data2 +bltCmd $graph element create data4 +bltCmd $graph element create data5 +bltCmd $graph element delete data4 data5 +bltCmd $graph element exists data1 +bltCmd $graph element lower data1 +bltCmd $graph element lower data2 data3 +bltCmd $graph element names +bltCmd $graph element names data1 +bltCmd $graph element raise data2 +bltCmd $graph element raise data2 data3 +bltCmd $graph element raise data1 +bltCmd $graph element show data2 +bltCmd $graph element show {data1 data2 data3} +bltCmd $graph element type data1 + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/linegraph.tcl b/tkblt/tests/linegraph.tcl new file mode 100644 index 0000000..6204e72 --- /dev/null +++ b/tkblt/tests/linegraph.tcl @@ -0,0 +1,75 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +puts stderr "Testing Line Graph..." + +bltTest $graph -aspect 2 $dops +bltTest $graph -background red $dops +#bltTest $graph -baseline $dops +bltTest $graph -bd 50 $dops +bltTest $graph -bg green $dops +bltTest $graph -bm 50 $dops +bltTest $graph -borderwidth 50 $dops +bltTest $graph -bottommargin 50 $dops +#bltTest $graph -bufferelements $dops +#bltTest $graph -buffergraph $dops +bltTest $graph -cursor cross $dops +bltTest $graph -fg blue $dops +bltTest $graph -font {times 36 bold italic} $dops +bltTest $graph -foreground cyan $dops +#bltTest $graph -halo $dops +bltTest $graph -height 300 $dops +#bltTest $graph -highlightbackground $dops +#bltTest $graph -highlightcolor $dops +#bltTest $graph -highlightthickness $dops +bltTest $graph -invertxy yes $dops +bltTest $graph -justify left $dops +bltTest $graph -justify center $dops +bltTest $graph -justify right $dops +bltTest $graph -leftmargin 50 $dops +bltTest $graph -lm 50 $dops +bltTest $graph -plotbackground cyan $dops +bltTest $graph -plotborderwidth 50 $dops +bltTest $graph -plotpadx 50 $dops +bltTest $graph -plotpady 50 $dops +bltTest $graph -plotrelief groove $dops +bltTest $graph -relief groove $dops +bltTest $graph -rightmargin 50 $dops +bltTest $graph -rm 50 $dops +#bltTest $graph -searchhalo $dops +#bltTest $graph -searchmode $dops +#bltTest $graph -searchalong $dops +#bltTest $graph -stackaxes $dops +#bltTest $graph -takefocus $dops +bltTest $graph -title "This is a Title" $dops +bltTest $graph -tm 50 $dops +bltTest $graph -topmargin 50 $dops +bltTest $graph -width 300 $dops +bltTest $graph -plotwidth 300 $dops +bltTest $graph -plotheight 300 $dops + +##bltCmd $graph axis +bltCmd $graph cget -background +bltCmd $graph configure +bltCmd $graph configure +bltCmd $graph configure -background cyan +##bltCmd $graph crosshairs +##bltCmd $graph element +#bltCmd $graph extents +#bltCmd $graph inside +#bltCmd $graph invtransform +##bltCmd $graph legend +##bltCmd $graph marker +##bltCmd $graph pen +#bltCmd $graph postscript output foo.ps +#bltCmd $graph transform +##bltCmd $graph x2axis +##bltCmd $graph xaxis +##bltCmd $graph y2axis +##bltCmd $graph yaxis + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/linemarker.tcl b/tkblt/tests/linemarker.tcl new file mode 100644 index 0000000..3b66ba6 --- /dev/null +++ b/tkblt/tests/linemarker.tcl @@ -0,0 +1,34 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +set mm [$graph marker create line tt -element data2 \ + -coords {1 50 1.5 100 1 150} -linewidth 5] +set nn [$graph marker create line ss -element data2 \ + -coords {1 150 .5 100 1 50} -linewidth 2 \ + -outline green -dashes 4] +$graph element configure data1 -hide yes + +puts stderr "Testing Line Marker..." + +bltTest3 $graph marker $mm -bindtags {aa} 0 +bltTest3 $graph marker $mm -cap round $dops +bltTest3 $graph marker $mm -coords {1 50 1.5 100 2 150} $dops +bltTest3 $graph marker $mm -dashes {8 3} $dops +bltTest3 $graph marker $nn -dashoffset 10 $dops +bltTest3 $graph marker $mm -element data1 $dops +bltTest3 $graph marker $nn -fill yellow $dops +bltTest3 $graph marker $mm -join round $dops +bltTest3 $graph marker $mm -linewidth 1 $dops +bltTest3 $graph marker $mm -hide yes $dops +bltTest3 $graph marker $mm -mapx x2 $dops +bltTest3 $graph marker $mm -mapy y2 $dops +bltTest3 $graph marker $mm -outline green $dops +bltTest3 $graph marker $mm -under yes $dops +bltTest3 $graph marker $mm -xoffset 20 $dops +bltTest3 $graph marker $mm -yoffset 20 $dops + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/linepen.tcl b/tkblt/tests/linepen.tcl new file mode 100644 index 0000000..e47b243 --- /dev/null +++ b/tkblt/tests/linepen.tcl @@ -0,0 +1,55 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +$graph pen create foo -color red -showvalues y -symbol circle -dashes {4 4} +$graph element configure data2 -pen foo + +puts stderr "Testing Line Pen..." + +bltTest3 $graph pen foo -color yellow $dops +bltTest3 $graph pen foo -dashes {8 3} $dops +bltTest3 $graph pen foo -errorbarcolor green $dops +bltTest3 $graph pen foo -errorbarwidth 2 $dops +bltTest3 $graph pen foo -errorbarcap 10 $dops +bltTest3 $graph pen foo -fill cyan $dops +bltTest3 $graph pen foo -linewidth 3 $dops +bltTest3 $graph pen foo -offdash black $dops +bltTest3 $graph pen foo -outline green $dops +bltTest3 $graph pen foo -outlinewidth 5 $dops +bltTest3 $graph pen foo -pixels 20 $dops +bltTest3 $graph pen foo -showvalues none $dops +bltTest3 $graph pen foo -symbol arrow $dops +bltTest3 $graph pen foo -symbol cross $dops +bltTest3 $graph pen foo -symbol diamond $dops +bltTest3 $graph pen foo -symbol none $dops +bltTest3 $graph pen foo -symbol plus $dops +bltTest3 $graph pen foo -symbol scross $dops +bltTest3 $graph pen foo -symbol splus $dops +bltTest3 $graph pen foo -symbol square $dops +bltTest3 $graph pen foo -symbol triangle $dops +bltTest3 $graph pen foo -valueanchor nw $dops +bltTest3 $graph pen foo -valueanchor n $dops +bltTest3 $graph pen foo -valueanchor ne $dops +bltTest3 $graph pen foo -valueanchor e $dops +bltTest3 $graph pen foo -valueanchor se $dops +bltTest3 $graph pen foo -valueanchor s $dops +bltTest3 $graph pen foo -valueanchor sw $dops +bltTest3 $graph pen foo -valueanchor w $dops +bltTest3 $graph pen foo -valuecolor cyan $dops +bltTest3 $graph pen foo -valuefont {times 18 bold italic} $dops +bltTest3 $graph pen foo -valueformat "%e" $dops +bltTest3 $graph pen foo -valuerotate 45 $dops + +bltCmd $graph pen cget foo -color +bltCmd $graph pen configure foo +bltCmd $graph pen configure foo -color +bltCmd $graph pen create bar +bltCmd $graph pen delete bar +bltCmd $graph pen names +bltCmd $graph pen type foo + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/marker.tcl b/tkblt/tests/marker.tcl new file mode 100644 index 0000000..8a09a43 --- /dev/null +++ b/tkblt/tests/marker.tcl @@ -0,0 +1,33 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +set mm [$graph marker create line tt -element data1 \ + -coords {1 50 1.5 100 1 150} -linewidth 5 -bind {aa}] +set nn [$graph marker create line ss -element data1 \ + -coords {1 150 .5 100 1 50} -linewidth 1 \ + -outline green -dashes 4] + +puts stderr "Testing Marker..." + +#bltCmd $graph marker bind aa <Button-1> [list puts "%x %y"] +bltCmd $graph marker cget $mm -cap +bltCmd $graph marker configure $mm +bltCmd $graph marker configure $mm -cap +set foo [$graph marker create line] +bltCmd $graph marker delete $foo +set foo [$graph marker create line foo] +bltCmd $graph marker delete $foo +bltCmd $graph marker exists $mm +bltCmd $graph marker find enclosed 0 0 2 200 +bltCmd $graph marker lower $mm +bltCmd $graph marker lower $mm $nn +bltCmd $graph marker names +bltCmd $graph marker raise $mm +bltCmd $graph marker raise $mm $nn +bltCmd $graph marker type $mm + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/markers.tcl b/tkblt/tests/markers.tcl new file mode 100644 index 0000000..2f43c8b --- /dev/null +++ b/tkblt/tests/markers.tcl @@ -0,0 +1,4 @@ +source marker.tcl +source linemarker.tcl +source polygonmarker.tcl +source textmarker.tcl diff --git a/tkblt/tests/polygonmarker.tcl b/tkblt/tests/polygonmarker.tcl new file mode 100644 index 0000000..b1712b0 --- /dev/null +++ b/tkblt/tests/polygonmarker.tcl @@ -0,0 +1,30 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +set mm [$graph marker create polygon tt -element data2 \ + -coords {1 50 1.5 100 1 150} -linewidth 5] +$graph element configure data1 -hide yes + +puts stderr "Testing Polygon Marker..." + +bltTest3 $graph marker $mm -bindtags {aa} 0 +bltTest3 $graph marker $mm -cap round $dops +bltTest3 $graph marker $mm -coords {1 50 1.5 100 2 150} $dops +bltTest3 $graph marker $mm -dashes {8 3} $dops +bltTest3 $graph marker $mm -element data1 $dops +bltTest3 $graph marker $mm -fill yellow $dops +bltTest3 $graph marker $mm -join round $dops +bltTest3 $graph marker $mm -linewidth 1 $dops +bltTest3 $graph marker $mm -hide yes $dops +bltTest3 $graph marker $mm -mapx x2 $dops +bltTest3 $graph marker $mm -mapy y2 $dops +bltTest3 $graph marker $mm -outline yellow $dops +bltTest3 $graph marker $mm -under yes $dops +bltTest3 $graph marker $mm -xoffset 20 $dops +bltTest3 $graph marker $mm -yoffset 20 $dops + +puts stderr "done" +bltPlotDestroy $w + diff --git a/tkblt/tests/ps.tcl b/tkblt/tests/ps.tcl new file mode 100644 index 0000000..7a9ce23 --- /dev/null +++ b/tkblt/tests/ps.tcl @@ -0,0 +1,29 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +$graph axis configure x -title "X\nAxis" -limitsformat "%g" +$graph axis configure y -title "Y\nAxis" + +$graph element configure data1 -dash {8 3} -showvalues y -smooth step -symbol circle -outline yellow -outlinewidth 3 -pixels 10 -valuefont "times 14 italic" -valuerotate 45 + +$graph legend configure -relief raised +$graph xaxis configure -bg cyan -relief raised +$graph configure -relief raised +$graph configure -plotrelief raised + +$graph legend selection set data2 +$graph legend focus data1 +$graph legend configure -selectrelief groove + +$graph postscript configure -decorations yes +$graph postscript output foo.ps +$graph postscript configure -decorations no +$graph postscript output bar.ps + +#set graph [bltBarGraph $w] + +#puts stderr "done" +#bltPlotDestroy $w + diff --git a/tkblt/tests/test.tcl b/tkblt/tests/test.tcl new file mode 100644 index 0000000..df6ffd8 --- /dev/null +++ b/tkblt/tests/test.tcl @@ -0,0 +1,10 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +#set graph [bltBarGraph $w] + +#puts stderr "done" +#bltPlotDestroy $w + diff --git a/tkblt/tests/textmarker.tcl b/tkblt/tests/textmarker.tcl new file mode 100644 index 0000000..ba3defc --- /dev/null +++ b/tkblt/tests/textmarker.tcl @@ -0,0 +1,44 @@ +source base.tcl + +set w .line +set graph [bltLineGraph $w] + +set mm [$graph marker create text tt -element data2 \ + -coords {1. 112} -text "Text\nMarker" -font {helvetica 24}] +$graph element configure data1 -hide yes + +puts stderr "Testing Text Marker..." + +bltTest3 $graph marker $mm -anchor nw $dops +bltTest3 $graph marker $mm -anchor n $dops +bltTest3 $graph marker $mm -anchor ne $dops +bltTest3 $graph marker $mm -anchor e $dops +bltTest3 $graph marker $mm -anchor se $dops +bltTest3 $graph marker $mm -anchor s $dops +bltTest3 $graph marker $mm -anchor sw $dops +bltTest3 $graph marker $mm -anchor w $dops +bltTest3 $graph marker $mm -background yellow $dops +bltTest3 $graph marker $mm -bg red $dops +bltTest3 $graph marker $mm -bindtags {aa} 0 +bltTest3 $graph marker $mm -coords {1 50} $dops +bltTest3 $graph marker $mm -element data1 $dops +bltTest3 $graph marker $mm -fg cyan $dops +bltTest3 $graph marker $mm -fill yellow $dops +bltTest3 $graph marker $mm -font {times 24 bold italic} $dops +bltTest3 $graph marker $mm -foreground blue $dops +bltTest3 $graph marker $mm -justify left $dops +bltTest3 $graph marker $mm -justify center $dops +bltTest3 $graph marker $mm -justify right $dops +bltTest3 $graph marker $mm -hide yes $dops +bltTest3 $graph marker $mm -mapx x2 $dops +bltTest3 $graph marker $mm -mapy y2 $dops +bltTest3 $graph marker $mm -outline green $dops +bltTest3 $graph marker $mm -rotate 45 $dops +bltTest3 $graph marker $mm -text {Hello World} $dops +bltTest3 $graph marker $mm -under yes $dops +bltTest3 $graph marker $mm -xoffset 20 $dops +bltTest3 $graph marker $mm -yoffset 20 $dops + +puts stderr "done" +bltPlotDestroy $w + |