aboutsummaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorlecoanet2004-02-23 09:18:29 +0000
committerlecoanet2004-02-23 09:18:29 +0000
commit01a303bb709245ac48a7fa75a41bbd54fa903cbb (patch)
treecd47cdcb4c159295b389c715b5ab1367bef82b35 /demos
parentef07ddc87875cc9b88715099434e2dcff4726322 (diff)
downloadtkzinc-01a303bb709245ac48a7fa75a41bbd54fa903cbb.zip
tkzinc-01a303bb709245ac48a7fa75a41bbd54fa903cbb.tar.gz
tkzinc-01a303bb709245ac48a7fa75a41bbd54fa903cbb.tar.bz2
tkzinc-01a303bb709245ac48a7fa75a41bbd54fa903cbb.tar.xz
More reworking of Tcl demos
Diffstat (limited to 'demos')
-rw-r--r--demos/mapinfo.tcl124
-rw-r--r--demos/rotation.tcl93
-rw-r--r--demos/translation.tcl88
-rw-r--r--demos/zoom.tcl108
4 files changed, 0 insertions, 413 deletions
diff --git a/demos/mapinfo.tcl b/demos/mapinfo.tcl
deleted file mode 100644
index 4d3b5fa..0000000
--- a/demos/mapinfo.tcl
+++ /dev/null
@@ -1,124 +0,0 @@
-# these simple samples have been developped by C. Mertz mertz@cena.fr in perl
-# tcl version by Jean-Paul Imbert imbert@cena.fr
-
-if {![info exists zincDemo]} {
- error "This script should be run from the zinc-widget demo."
-}
-
-set w .mapinfo
-catch {destroy $w}
-toplevel $w
-wm title $w "Zinc Mapinfo Demonstration"
-wm iconname $w Mapinfo
-
-set defaultfont [font create -family Helvetica -size 10 -weight bold]
-
-frame $w.buttons
-pack $w.buttons -side bottom -fill x -pady 2m
-button $w.buttons.dismiss -text Dismiss -command "destroy $w"
-button $w.buttons.code -text "See Code" -command "showCode $w"
-pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
-
-
-###########################################
-# Text zone
-###########################################
-
-text $w.text -relief sunken -borderwidth 2 -height 4
-pack $w.text -expand yes -fill both
-
-$w.text insert end "This toy-appli shows zoom actions on map item.\nThe following operations are possible:\n Click - to zoom out\n Click + to zoom in "
-
-###########################################
-# Zinc
-###########################################
-set zinc_width 600
-set zinc_height 500
-zinc $w.zinc -width $zinc_width -height $zinc_height -font 10x20 -borderwidth 3 -relief sunken
-pack $w.zinc
-
-###########################################
-# Waypoints and sector
-###########################################
-
-mapinfo mapinfo create
-#creation of mapinfo
-
-#--------------------------------
-# Waypoints
-#--------------------------------
-mapinfo mapinfo add symbol 200 100 0
-mapinfo mapinfo add symbol 300 150 0
-mapinfo mapinfo add symbol 400 50 0
-mapinfo mapinfo add symbol 350 450 0
-mapinfo mapinfo add symbol 300 250 0
-mapinfo mapinfo add symbol 170 240 0
-mapinfo mapinfo add symbol 550 200 0
-
-#--------------------------------
-# Waypoints names
-#--------------------------------
-mapinfo mapinfo add text normal simple 170 100 DO
-mapinfo mapinfo add text normal simple 270 160 RE
-mapinfo mapinfo add text normal simple 410 50 MI
-mapinfo mapinfo add text normal simple 345 470 FA
-mapinfo mapinfo add text normal simple 280 265 SOL
-mapinfo mapinfo add text normal simple 150 240 LA
-mapinfo mapinfo add text normal simple 555 200 SI
-
-#--------------------------------
-# Routes
-#--------------------------------
-
-mapinfo mapinfo add line simple 1 200 100 300 150
-mapinfo mapinfo add line simple 1 300 150 400 50
-mapinfo mapinfo add line simple 1 300 150 350 450
-mapinfo mapinfo add line simple 1 300 250 170 240
-mapinfo mapinfo add line simple 1 300 250 550 200
-
-#--------------------------------
-# Sectors
-#---------------------------------
-mapinfo mapinfo add line simple 1 300 0 400 50
-mapinfo mapinfo add line simple 1 400 50 500 100
-mapinfo mapinfo add line simple 1 500 100 550 200
-mapinfo mapinfo add line simple 1 550 200 550 400
-mapinfo mapinfo add line simple 1 550 400 350 450
-mapinfo mapinfo add line simple 1 350 450 170 240
-mapinfo mapinfo add line simple 1 170 240 200 100
-mapinfo mapinfo add line simple 1 200 100 300 0
-
-#--------------------------------
-# Sectors
-#---------------------------------
-set gpe [$w.zinc add group 1]
-set map [$w.zinc add map $gpe -mapinfo mapinfo -symbols AtcSymbol15]
-
-
-###################################################
-# control panel
-###################################################
-frame $w.rc
-pack $w.rc
-
-#the reference of the scale function is top-left corner of the zinc object
-#so we first translate the group to zoom in order to put its center on top-left corner
-#change the scale of the group
-#translate the group to put it back at the center of the zinc object
-
-
-button $w.rc.minus -width 2 -height 2 -text {-} -command {
- $w.zinc translate $gpe [expr -$zinc_width/2] [expr -$zinc_height/2]
- $w.zinc scale $gpe 0.8 0.8
- $w.zinc translate $gpe [expr $zinc_width/2] [expr $zinc_height/2]
-}
-pack $w.rc.minus -side left
-
-button $w.rc.plus -width 2 -height 2 -text {+} -command {
- $w.zinc translate $gpe [expr -$zinc_width/2] [expr -$zinc_height/2]
- $w.zinc scale $gpe 1.2 1.2
- $w.zinc translate $gpe [expr $zinc_width/2] [expr $zinc_height/2]
-}
-pack $w.rc.plus -side right
-
-
diff --git a/demos/rotation.tcl b/demos/rotation.tcl
deleted file mode 100644
index feb899f..0000000
--- a/demos/rotation.tcl
+++ /dev/null
@@ -1,93 +0,0 @@
-# these simple samples have been developped by C. Mertz mertz@cena.fr in perl
-# tcl version by Jean-Paul Imbert imbert@cena.fr
-
-if {![info exists zincDemo]} {
- error "This script should be run from the zinc-widget demo."
-}
-
-set angle [expr 3.1416/6]
-
-set w .rotation
-catch {destroy $w}
-toplevel $w
-wm title $w "Zinc Rotation Demonstration"
-wm iconname $w Rotation
-
-set defaultfont [font create -family Helvetica -size 10 -weight bold]
-
-frame $w.buttons
-pack $w.buttons -side bottom -fill x -pady 2m
-button $w.buttons.dismiss -text Dismiss -command "destroy $w"
-button $w.buttons.code -text "See Code" -command "showCode $w"
-pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
-
-
-
-###########################################
-# Text zone
-###########################################
-
-text $w.text -relief sunken -borderwidth 2 -height 4
-pack $w.text -expand yes -fill both
-
-$w.text insert end "This toy-appli shows rotations on waypoint items.\nThe following operations are possible:\nClick <- for negative rotation\nClick -> for positive rotation"
-
-
-###########################################
-# Zinc
-###########################################
-set zinc_width 600
-set zinc_height 500
-zinc $w.zinc -width $zinc_width -height $zinc_height -font 10x20 -borderwidth 3 -relief sunken
-pack $w.zinc
-
-###########################################
-# Waypoints
-###########################################
-
-set wp_group [$w.zinc add group 1 -visible 1]
-
-set p1 {200 200}
-set wp1 [$w.zinc add waypoint $wp_group 1 -position $p1 -connectioncolor green -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx -20]
-
-$w.zinc itemconfigure $wp1 0 -text DO
-
-
-set p2 {300 300}
-set wp2 [$w.zinc add waypoint $wp_group 1 -position $p2 -connecteditem $wp1 -connectioncolor blue -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx -20]
-
-$w.zinc itemconfigure $wp2 0 -text RE
-
-
-set p3 {400 150}
-set wp3 [$w.zinc add waypoint $wp_group 2 -position $p3 -connecteditem $wp2 -connectioncolor blue -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx 20 -labeldy +10]
-
-$w.zinc itemconfigure $wp3 0 -text MI
-
-
-###################################################
-# control panel
-###################################################
-frame $w.rc
-pack $w.rc
-
-button $w.rc.left -width 2 -height 2 -text "<-" -command {
- global w
- # Negative rotation
- #--------------------------------
- set x [lindex [lindex [$w.zinc coords $wp2] 0 ] 0]
- set y [lindex [lindex [$w.zinc coords $wp2] 0 ] 1]
- #the center of the rotation is $wp2
- $w.zinc rotate $wp_group -$angle $x $y
-}
-pack $w.rc.left -side left
-
-button $w.rc.right -width 2 -height 2 -text "->" -command {
- global w
- # Positive rotation
- #--------------------------------
- set x [lindex [lindex [$w.zinc coords $wp2] 0 ] 0]
- set y [lindex [lindex [$w.zinc coords $wp2] 0 ] 1]
- $w.zinc rotate $wp_group $angle $x $y
-}
-pack $w.rc.right -side right
diff --git a/demos/translation.tcl b/demos/translation.tcl
deleted file mode 100644
index 18bf6f7..0000000
--- a/demos/translation.tcl
+++ /dev/null
@@ -1,88 +0,0 @@
-# these simple samples have been developped by C. Mertz mertz@cena.fr in perl
-# tcl version by Jean-Paul Imbert imbert@cena.fr
-
-if {![info exists zincDemo]} {
- error "This script should be run from the zinc-widget demo."
-}
-
-set w .translation
-catch {destroy $w}
-toplevel $w
-wm title $w "Zinc Translation Demonstration"
-wm iconname $w Translation
-
-set defaultfont [font create -family Helvetica -size 10 -weight bold]
-
-frame $w.buttons
-pack $w.buttons -side bottom -fill x -pady 2m
-button $w.buttons.dismiss -text Dismiss -command "destroy $w"
-button $w.buttons.code -text "See Code" -command "showCode $w"
-pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
-
-###########################################
-# Text zone
-###########################################
-text $w.text -relief sunken -borderwidth 2 -setgrid true -height 6
-
-pack $w.text -expand yes -fill both
-
-$w.text insert end "This toy-appli shows translations on waypoint items.\nThe following operations are possible:\n Click Up for up translation\n Click Left for left translation\n Click Right for right translation\n Click Down for down translation"
-
-###########################################
-# Zinc
-###########################################
-set zinc_width 600
-set zinc_height 500;
-zinc $w.zinc -width $zinc_width -height $zinc_height -font 10x20 -borderwidth 3 -relief sunken
-pack $w.zinc
-
-###########################################
-# Waypoints
-###########################################
-
-set wp_group [$w.zinc add group 1 -visible 1]
-
-set p1 {200 200}
-set wp1 [$w.zinc add waypoint $wp_group 1 -position $p1 -connectioncolor green -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx -20]
-
-$w.zinc itemconfigure $wp1 0 -text DO
-
-
-set p2 {300 300}
-set wp2 [$w.zinc add waypoint $wp_group 1 -position $p2 -connecteditem $wp1 -connectioncolor blue -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx -20]
-
-$w.zinc itemconfigure $wp2 0 -text RE
-
-
-set p3 {400 150}
-set wp3 [$w.zinc add waypoint $wp_group 2 -position $p3 -connecteditem $wp2 -connectioncolor blue -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx 20 -labeldy +10]
-
-$w.zinc itemconfigure $wp3 0 -text MI
-
-
-###################################################
-# control panel
-###################################################
-frame $w.rc
-pack $w.rc
-
-button $w.rc.up -width 2 -height 2 -text Up -command {
- $w.zinc translate "$wp_group" 0 -10
-}
-grid $w.rc.up -row 0 -column 1
-
-button $w.rc.left -width 2 -height 2 -text Left -command {
- $w.zinc translate "$wp_group" -10 0
-}
-grid $w.rc.left -row 1 -column 0
-
-
-button $w.rc.right -width 2 -height 2 -text Right -command {
- $w.zinc translate "$wp_group" 10 0
-}
-grid $w.rc.right -row 1 -column 2
-
-button $w.rc.down -width 2 -height 2 -text Down -command {
- $w.zinc translate "$wp_group" 0 10
-}
-grid $w.rc.down -row 2 -column 1
diff --git a/demos/zoom.tcl b/demos/zoom.tcl
deleted file mode 100644
index 7804b55..0000000
--- a/demos/zoom.tcl
+++ /dev/null
@@ -1,108 +0,0 @@
-# these simple samples have been developped by C. Mertz mertz@cena.fr in perl
-# tcl version by Jean-Paul Imbert imbert@cena.fr
-
-
-if {![info exists zincDemo]} {
- error "This script should be run from the zinc-widget demo."
-}
-
-set w .zoom
-catch {destroy $w}
-toplevel $w
-wm title $w "Zinc Zoom Demonstration"
-wm iconname $w Zoom
-
-set defaultfont [font create -family Helvetica -size 10 -weight bold]
-
-frame $w.buttons
-pack $w.buttons -side bottom -fill x -pady 2m
-button $w.buttons.dismiss -text Dismiss -command "destroy $w"
-button $w.buttons.code -text "See Code" -command "showCode $w"
-pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
-
-
-###########################################
-# Text zone
-###########################################
-
-text $w.text -relief sunken -borderwidth 2 -height 4
-pack $w.text -expand yes -fill both
-
-$w.text insert end "This toy-appli shows zoom actions on waypoint and curve items.\nThe following operations are possible:\n Click - to zoom out\n Click + to zoom in"
-
-###########################################
-# Zinc
-###########################################
-set zinc_width 600
-set zinc_height 500
-zinc $w.zinc -width $zinc_width -height $zinc_height -font 10x20 -borderwidth 3 -relief sunken
-pack $w.zinc
-
-###########################################
-# Waypoints and sector
-###########################################
-set wp_group [$w.zinc add group 1 -visible 1]
-
-set p1 {200 100}
-set wp1 [$w.zinc add waypoint $wp_group 1 -position $p1 -connectioncolor green -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx -20]
-
-$w.zinc itemconfigure $wp1 0 -text DO
-
-set p2 {300 150}
-set wp2 [$w.zinc add waypoint $wp_group 1 -position $p2 -connecteditem $wp1 -connectioncolor blue -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx -20]
-
-$w.zinc itemconfigure $wp2 0 -text RE
-
-set p3 {400 50}
-set wp3 [$w.zinc add waypoint $wp_group 2 -position $p3 -connecteditem $wp2 -connectioncolor blue -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx 20 -labeldy +10]
-
-$w.zinc itemconfigure $wp3 0 -text MI
-
-set p4 {350 450}
-set wp4 [$w.zinc add waypoint $wp_group 2 -position $p4 -connecteditem $wp2 -connectioncolor blue -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx -15]
-
-$w.zinc itemconfigure $wp4 0 -text FA
-
-set p5 {300 250}
-set wp5 [$w.zinc add waypoint $wp_group 2 -position $p5 -connectioncolor blue -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx -15]
-
-$w.zinc itemconfigure $wp5 0 -text SOL
-
-set p6 {170 240}
-set wp6 [$w.zinc add waypoint $wp_group 2 -position $p6 -connecteditem $wp5 -connectioncolor blue -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx -20]
-
-$w.zinc itemconfigure $wp6 0 -text LA
-
-set p7 {550 200}
-set wp7 [$w.zinc add waypoint $wp_group 2 -position $p7 -connecteditem $wp5 -connectioncolor blue -symbolcolor blue -labelformat {x20x18+0+0} -leaderwidth 0 -labeldx 20]
-
-$w.zinc itemconfigure $wp7 0 -text SI
-
-set sector [$w.zinc add curve $wp_group {300 0 400 50 500 100 550 200 550 400 350 450 170 240 200 100 300 0}]
-
-###################################################
-# control panel
-###################################################
-frame $w.rc
-pack $w.rc
-
-#the reference of the scale function is top-left corner of the zinc object
-#so we first translate the group to zoom in order to put its center on top-left corner
-#change the scale of the group
-#translate the group to put it back at the center of the zinc object
-
-
-button $w.rc.minus -width 2 -height 2 -text - -command {
- $w.zinc translate $wp_group [expr -$zinc_width/2] [expr -$zinc_height/2]
- $w.zinc scale $wp_group 0.8 0.8
- $w.zinc translate $wp_group [expr $zinc_width/2] [expr $zinc_height/2]
-}
-pack $w.rc.minus -side left
-
-button $w.rc.plus -width 2 -height 2 -text + -command {
- $w.zinc translate $wp_group [expr -$zinc_width/2] [expr -$zinc_height/2]
- $w.zinc scale $wp_group 1.2 1.2
- $w.zinc translate $wp_group [expr $zinc_width/2] [expr $zinc_height/2]
-}
-pack $w.rc.plus -side right
-