46
46
set buttonFont $buttonfont
47
47
oset $win buttonFont $buttonfont
49
menubutton $w.plotmenu -text "Menu Here" -direction below -menu $w.plotmenu.m -relief flat -borderwidth 0 -background white -font $buttonFont
50
menu $w.plotmenu.m -tearoff 0
49
52
# puts "children wb=[winfo children $w]"
52
55
set dismiss [concat $dismiss "; clearLocal $win "]
54
button $wb.dismiss -text Dismiss -command $dismiss -font $buttonFont
55
setBalloonhelp $win $wb.dismiss {Close this plot window}
57
button $wb.zoom -text "Zoom" -command "showZoom $w" -font $buttonFont
58
setBalloonhelp $win $wb.zoom {Magnify the plot. Causes clicking with the left mouse button on the plot, to magnify (zoom in) the plot where you click. Also causes Shift+Click to it to unmagnify (zoom out) at that point}
57
$w.plotmenu.m add command -label "Dismiss" -command $dismiss -font $buttonFont
58
##setBalloonhelp $win $wb.dismiss {Close this plot window}
59
$w.plotmenu.m add command -label "Zoom" -command "showZoom $w" -font $buttonFont
60
##setBalloonhelp $win $wb.zoom {Magnify the plot. Causes clicking with the left mouse button on the plot, to magnify (zoom in) the plot where you click. Also causes Shift+Click to it to unmagnify (zoom out) at that point}
61
62
# button $w.position -textvariable [oloc $w position] -font $buttonFont -width 10
62
label $w.position -textvariable [oloc $w position] -font $buttonFont -width 10
63
setBalloonhelp $win $w.position {Position of the pointer in real x y coordinates. For 3d it is the position of the nearest vertex of the polygon the pointer is over.}
65
button $wb.help -text "Help" -command "doHelp$type $win" -font $buttonFont
66
setBalloonhelp $win $wb.help {Give more help about this plot window}
67
button $wb.postscript -textvariable writefile -command "writePostscript $w" -font $buttonFont
68
setBalloonhelp $win $wb.postscript {Prints or Saves the plot in postscript format. The region to be printed is marked using Mark. Other print options can be obtained by using "Print Options" in the Config menu }
71
button $wb.markrect -text "Mark" -command "markToPrint $c printrectangle \[eval \[oget $win maintitle\]\]" -font $buttonFont
72
setBalloonhelp $win $wb.markrect {Mark the region to be printed. Causes the left mouse button to allow marking of a rectangle by clicking at the upper left corner, and dragging the mouse to the lower right corner. The title can be set under "Print Options" under Config}
73
button $wb.replot -text "Replot" -command "replot$type $win" -font $buttonFont
74
setBalloonhelp $win $wb.replot {Use the current settings and recompute the plot. The settings may be altered in Config}
78
button $wb.config -text "Config" -command "doConfig$type $win" -font $buttonFont
79
setBalloonhelp $win $wb.config {Configure various options about the plot window. After doing this one may do replot. Hint: you may leave the config menu on the screen and certain actions take place immediately, such as rotating or computing a trajectory at a point. To make room for the window you might slide the graph to the right, and possibly shrink it using the unzoom feature}
63
##label $w.position -textvariable [oloc $w position] -font $buttonFont -width 10
64
##setBalloonhelp $win $w.position {Position of the pointer in real x y coordinates. For 3d it is the position of the nearest vertex of the polygon the pointer is over.}
65
$w.plotmenu.m add command -label "Help" -command "doHelp$type $win" -font $buttonFont
66
##setBalloonhelp $win $wb.help {Give more help about this plot window}
67
$w.plotmenu.m add command -label "Save" -command "writePostscript $w" -font $buttonFont
68
##setBalloonhelp $win $wb.postscript {Prints or Saves the plot in postscript format. The region to be printed is marked using Mark. Other print options can be obtained by using "Print Options" in the Config menu }
69
$w.plotmenu.m add command -label "Mark" -command "markToPrint $c printrectangle \[eval \[oget $win maintitle\]\]" -font $buttonFont
70
##setBalloonhelp $win $wb.markrect {Mark the region to be printed. Causes the left mouse button to allow marking of a rectangle by clicking at the upper left corner, and dragging the mouse to the lower right corner. The title can be set under "Print Options" under Config}
71
$w.plotmenu.m add command -label "Replot" -command "replot$type $win" -font $buttonFont
72
##setBalloonhelp $win $wb.replot {Use the current settings and recompute the plot. The settings may be altered in Config}
73
$w.plotmenu.m add command -label "Config" -command "doConfig$type $win" -font $buttonFont
74
##setBalloonhelp $win $wb.config {Configure various options about the plot window. After doing this one may do replot. Hint: you may leave the config menu on the screen and certain actions take place immediately, such as rotating or computing a trajectory at a point. To make room for the window you might slide the graph to the right, and possibly shrink it using the unzoom feature}
83
76
#mike FIXME: this is a wrong use of after cancel
84
bind $win.position <Enter> "+place $win.buttons -in $win.position -x 0 -rely 1.0 ; after cancel lower $win.position ; raise $win.buttons "
85
bind $win.buttons <Leave> "deleteBalloon $c ; place forget $win.buttons"
77
##bind $win.position <Enter> "+place $win.buttons -in $win.position -x 0 -rely 1.0 ; after cancel lower $win.position ; raise $win.buttons "
78
##bind $win.buttons <Leave> "deleteBalloon $c ; place forget $win.buttons"
88
81
scrollbar $w.hscroll -orient horiz -command "$c xview"
107
100
bind $c <B3-Motion> "$c scan dragto %x %y"
108
101
bind $c <Motion> "showPosition $w %x %y"
109
102
bind $c <Configure> "reConfigure $c %w %h"
110
bind $c <Enter> "raise $win.position"
111
bind $c <Leave> "after 200 lower $win.position"
112
$w.position config -background [$c cget -background]
115
pack $wb.dismiss $wb.help $wb.zoom \
116
$wb.postscript $wb.markrect $wb.replot $wb.config -side top -expand 1 -fill x
103
##bind $c <Enter> "raise $win.position"
104
##bind $c <Leave> "after 200 lower $win.position"
105
$w.plotmenu config -background [$c cget -background]
108
##pack $wb.dismiss $wb.help $wb.zoom \
109
## $wb.postscript $wb.markrect $wb.replot $wb.config -side top -expand 1 -fill x
118
111
pack $w.hscroll -side bottom -expand 1 -fill x
119
112
pack $w.vscroll -side right -expand 1 -fill y
121
114
pack $w.c -side right -expand 1 -fill both
124
place $w.position -in $w -x 2 -y 2 -anchor nw
125
oset $w position "Menu Here"
117
place $w.plotmenu -in $w -x 2 -y 2 -anchor nw
126
119
if { ![info exists maxima_priv(showedplothelp)] ||
127
120
[llength $maxima_priv(showedplothelp)] < 2 } {
128
121
lappend maxima_priv(showedplothelp) 1
130
after 100 balloonhelp $w $w.position [list \
131
"Initial help: Moving the mouse over the position \
132
window (top left corner), will bring up a menu. Holding down \
123
after 100 balloonhelp $w $w.plotmenu [list \
124
"Initial help: Clicking the left mouse button on the plot menu \
125
(top left corner), will bring up a menu. Holding down \
133
126
right mouse button and dragging will translate the plot"]
134
after 2000 $w.c delete balloon
127
after 3000 $w.c delete balloon
141
134
pack [winfo parent $wb]