5 # $Log: tableVisi.tcl,v $
6 # Revision 1.6 1996/04/30 20:19:50 tamches
7 # added label w/ phase name
9 # Revision 1.5 1995/12/29 08:16:46 tamches
10 # added sort foci by value menu item
11 # removed some old and obsolete code
12 # added binding for left mouse button (for selection)
14 # Revision 1.4 1995/12/20 02:29:44 tamches
17 # Revision 1.3 1995/11/29 00:44:19 tamches
18 # We now call makeLogo
20 # Revision 1.2 1995/11/08 21:15:33 tamches
21 # choosing sig figs is no longer a slider widget; it is a bunch of menu
24 # Revision 1.1 1995/11/04 00:43:12 tamches
25 # First version of new table visi
29 proc initializeTableVisi {} {
30 if {[winfo depth .] > 1} {
32 option add *Background grey
33 option add *activeBackground LightGrey
34 option add *activeForeground black
35 option add *Scale.activeForeground grey
37 option add *Background white
38 option add *Foreground black
41 option add *Visi*font *-New*Century*Schoolbook-Bold-R-*-18-*
42 option add *Data*font *-Helvetica-*-r-*-12-*
43 option add *MyMenu*font *-New*Century*Schoolbook-Bold-R-*-14-*
45 # Create the title bar, menu bar, and logo at the top:
47 pack .top -side top -fill x
50 pack .top.left -side left -fill both -expand true
52 label .top.left.title -relief raised -text "Table Visualization" \
53 -font *-New*Century*Schoolbook-Bold-R-*-14-* \
54 -foreground white -background HotPink2
55 pack .top.left.title -side top -fill both -expand true
59 frame .top.left.menubar -class MyMenu -borderwidth 2 -relief raised
60 pack .top.left.menubar -side top -fill x
62 menubutton .top.left.menubar.file -text "File" -menu .top.left.menubar.file.m
63 menu .top.left.menubar.file.m -selectcolor cornflowerblue
64 .top.left.menubar.file.m add command -label "Close Table" -command {destroy .}
66 menubutton .top.left.menubar.acts -text "Actions" -menu .top.left.menubar.acts.m
67 menu .top.left.menubar.acts.m -selectcolor cornflowerblue
68 .top.left.menubar.acts.m add command -label "Add Entries" -command AddEntry
69 .top.left.menubar.acts.m add command -label "Delete Selected Entry" -command DelEntry -state disabled
71 menubutton .top.left.menubar.opts -text "View" -menu .top.left.menubar.opts.m
72 menu .top.left.menubar.opts.m -selectcolor cornflowerblue
76 .top.left.menubar.opts.m add check -label "Long Names" -variable LongNames -command {updateNames $LongNames}
77 .top.left.menubar.opts.m add separator
81 .top.left.menubar.opts.m add radio -label "Current Values" \
82 -variable DataFormat \
83 -value 0 -command formatChanged
84 .top.left.menubar.opts.m add radio -label "Average Values" \
85 -variable DataFormat \
86 -value 1 -command formatChanged
87 .top.left.menubar.opts.m add radio -label "Total Values" \
88 -variable DataFormat \
89 -value 2 -command formatChanged
90 .top.left.menubar.opts.m add separator
93 .top.left.menubar.opts.m add radio -label "Don't Sort Metrics" \
94 -variable sortMetrics -value 0 -command unsortMetrics
95 .top.left.menubar.opts.m add radio -label "Sort Metrics (ascending)" \
96 -variable sortMetrics -value 1 -command sortMetrics
97 .top.left.menubar.opts.m add separator
100 .top.left.menubar.opts.m add radio -label "Don't Sort Foci" \
101 -variable sortFoci -value 0 -command unsortFoci
102 .top.left.menubar.opts.m add radio -label "Sort Foci (ascending)" \
103 -variable sortFoci -value 1 -command sortFociByValues
104 .top.left.menubar.opts.m add radio -label "Sort Foci By Values (of selected metric)" \
105 -variable sortFoci -value 2 -command sortFociByValues
107 # significant digits at the end of the View menu (?)
108 global SignificantDigits
109 set SignificantDigits 3
111 .top.left.menubar.opts.m add separator
112 .top.left.menubar.opts.m add radio -label "1 significant digit" \
113 -variable SignificantDigits -value 1 -command "sigFigChange "
114 .top.left.menubar.opts.m add radio -label "2 significant digits" \
115 -variable SignificantDigits -value 2 -command "sigFigChange "
116 .top.left.menubar.opts.m add radio -label "3 significant digits" \
117 -variable SignificantDigits -value 3 -command "sigFigChange "
118 .top.left.menubar.opts.m add radio -label "4 significant digits" \
119 -variable SignificantDigits -value 4 -command "sigFigChange "
120 .top.left.menubar.opts.m add radio -label "5 significant digits" \
121 -variable SignificantDigits -value 5 -command "sigFigChange "
122 .top.left.menubar.opts.m add radio -label "6 significant digits" \
123 -variable SignificantDigits -value 6 -command "sigFigChange "
124 .top.left.menubar.opts.m add radio -label "7 significant digits" \
125 -variable SignificantDigits -value 7 -command "sigFigChange "
126 .top.left.menubar.opts.m add radio -label "8 significant digits" \
127 -variable SignificantDigits -value 8 -command "sigFigChange "
129 # Add menu bar to display
130 pack .top.left.menubar.file .top.left.menubar.acts .top.left.menubar.opts \
133 makeLogo .top.logo paradynLogo raised 2 HotPink2
134 pack .top.logo -side right
136 # Phase Name, below the menus (not filled in yet since asking for the
137 # phase name would fail this early.)
138 label .phasename -relief groove \
139 -font *-Helvetica-*-r-*-12-*
140 pack .phasename -side top -fill x -expand false
142 # Horizontal Scrollbar
143 scrollbar .horizScrollbar -orient horizontal \
144 -background gray -activebackground gray -relief sunken \
145 -command horizScrollbarNewScrollPosition
146 pack .horizScrollbar -side bottom -fill x
148 # Vertical Scrollbar:
149 scrollbar .vertScrollbar -orient vertical \
150 -background gray -activebackground gray -relief sunken \
151 -command vertScrollbarNewScrollPosition
152 pack .vertScrollbar -side left -fill y -expand false
154 # Body (drawn by C++ code -- metrics, units, foci, cells):
155 frame .body -width 400 -height 220
156 pack .body -fill both -expand true
158 bind .body <Configure> {tableVisiConfigure}
159 bind .body <Expose> {tableVisiExpose}
160 bind .body <Button-1> {tableVisiClick %x %y}
163 wm title . "Table Visualization"
166 # AddEntry -- Ask paradyn to start a new curve
171 # DelEntry -- Ask paradyn to stop a curve
173 puts stderr "Delete Entry not yet implemented"
176 # Called by visi library when histos have folded
177 # we just update the status line and keep on going
178 #proc DgFoldCallback {} {
183 # DgPhaseStartCallback -- visi calls this when a phase has started
185 proc DgPhaseStartCallback {phaseId} {
186 puts stderr "welcome to DgPhaseStartCallback (tcl code)"
191 # DgPhaseEndCallback -- visi calls this when a phase has started
193 proc DgPhaseEndCallback {phaseId} {
194 puts stderr "welcome to DgPhaseEndCallback (tcl code)"
199 # DgPhaseDataCallback -- visi calls this when a phase has started
201 proc DgPhaseDataCallback {} {
202 puts stderr "welcome to DgPhaseEndCallback (tcl code)"