aboutsummaryrefslogtreecommitdiff
path: root/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/testtext.tcl103
1 files changed, 103 insertions, 0 deletions
diff --git a/sandbox/testtext.tcl b/sandbox/testtext.tcl
new file mode 100644
index 0000000..747f598
--- /dev/null
+++ b/sandbox/testtext.tcl
@@ -0,0 +1,103 @@
+#!/usr/bin/wish -f
+
+load tkradar3.1.so
+package require Img
+
+set top 1
+set mask "/usr/X11R6/include/X11/bitmaps/fvwm.xbm"
+
+set r [radar .r -backcolor gray -relief sunken]
+pack .r -expand t -fill both
+.r configure -width 800 -height 500
+.r configure -drawbboxes t
+.r addtag controls withtag $top
+
+.r add rectangle $top "-50 0 +50 1" -composescale 0
+.r add rectangle $top "0 -50 1 +50" -composescale 0
+
+set x 50.0
+set y 100.0
+.r add text $top -text "Ancrage Sud Ouest" -position "$x $y" -anchor sw \
+ -color yellow
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+set x [expr $x + 200.0]
+.r add text $top -text "Ancrage Sud" -position "$x $y" -anchor s -color pink
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+set x [expr $x + 200.0]
+.r add text $top -text "Ancrage Sud Est" -position "$x $y" -anchor se \
+ -color violet -overstriked y
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+set x 50
+set y 150
+.r add text $top -text "Ancrage Ouest" -position "$x $y" -anchor w -color lightblue
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+set x [expr $x + 200.0]
+.r add text $top -text "Ancrage Central" -position "$x $y" -anchor center -color blue
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+set x [expr $x + 200.0]
+.r add text $top -text "Ancrage Est" -position "$x $y" -anchor e -color darkblue
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+set x 50.0
+set y 200.0
+.r add text $top -text "Ancrage Nord Ouest" -position "$x $y" -anchor nw \
+ -color violet -underlined y
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+set x [expr $x + 200.0]
+.r add text $top -text "Ancrage Nord" -position "$x $y" -anchor n -color pink
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+set x [expr $x + 200.0]
+.r add text $top -text "Ancrage Nord Est" -position "$x $y" -anchor ne -color yellow
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+set x 150
+set y 300
+.r add text $top -text "Ce texte tient sur plusieurs lignes.\nLes alignements :\n- à gauche\n-à droite\n-au centre\nsont également mis en évidence.\n" -position "$x $y" -anchor center
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+set x 400
+set y 300
+set anim [.r add text $top -text "Ce texte tient sur plusieurs lignes.\nLes alignements :\n- à gauche\n-à droite\n-au centre\nsont également mis en évidence.\nLe texte central montre l'utilisation\nd'un espacement des lignes programmable." -position "$x $y" -anchor center -alignment center -spacing -5 -font {times 14 bold italic}]
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+set x 650
+set y 300
+.r add text $top -text "Ce texte tient sur plusieurs lignes.\nLes alignements :\n- à gauche\n-à droite\n-au centre\nsont également mis en évidence.\n" -position "$x $y" -anchor center -alignment right
+.r add rectangle $top [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+
+#
+# Add controls to the main group
+#
+source controls.tcl
+
+#
+# Line spacing animation (crude).
+#
+if {0} {
+ set i 0
+ while {1} {
+ update
+ after 200
+ .r itemconfigure $anim -spacing [expr ($i % 20) - 5]
+ incr i
+ }
+}