aboutsummaryrefslogtreecommitdiff
path: root/vendor/x11iraf/guidemo/help.gui
blob: 0159dc2b46938a9c6e8e8697ae4259185240c1fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301

# HTML.GUI -- Test HTML widget.

reset-server
appInitialize html HTML {
    *objects:\
	toplevel	    Layout		helpLayout \
	helpLayout	    Layout		helpMenuLayout \
	helpLayout	    Layout		helpInfoLayout \
\
	helpMenuLayout	    Command		helpBack \
	helpMenuLayout	    Command		helpForward \
	helpMenuLayout	    Command		helpHome \
	helpMenuLayout	    Command		helpClose \
\
	helpLayout	    Frame		helpTextFrame\
	helpTextFrame	    HTML            	helpText \
\
	helpInfoLayout	    Label		helpIRAFLogo \
	helpInfoLayout	    Label		helpInfo1 \
	helpInfoLayout	    Label		helpInfo2 \
	helpInfoLayout	    Label		helpInfo3 \
	helpInfoLayout	    Label		helpNOAOLogo 
        

    *helpLayout*borderWidth:                    0
    *helpLayout.background:                     gray
    *helpLayout*Frame*frameType:                sunken
    *helpLayout*Frame*frameWidth:               2
    *helpLayout*Frame.background:               gray
    *helpLayout*Layout.background:              gray
   
    *helpLayout.layout: vertical { \
        -1 \
        horizontal { \
            0 < +0 -0 > \
            helpMenuLayout < +inf -inf * > \
            0 < +0 -0 > \
        } \
        0 < +0 -0 > \
        horizontal { \
            0 < +0 -0 > \
            helpTextFrame < +inf -inf * +inf -inf > \
            0 \
        } \
        0 < +0 -0 > \
        horizontal { \
            0 < +0 -0 > \
            helpInfoLayout < +inf -inf * > \
            0 < +0 -0 > \
        } \
        -1 \
    }
    *helptext*background:			white
    *helptext*foreground:			black
      
    *helpMenuLayout*background:			gray
    *helpMenuLayout*Command.highlightThickness: 2
    *helpMenuLayout*Command.internalHeight:     2
    *helpMenuLayout*Command.font: 	-*-helvetica-bold-r-normal-*-12-*-*-*
    *helpMenuLayout.layout: vertical { \
        5 \
	horizontal { \
            5 < +0 -5 > \
            helpBack \
            2 < +0 -2 > \
            helpForward \
            2 < +0 -2 > \
            helpHome \
            2 < +inf -2 > \
            helpClose \
            5 < +0 -5 > \
	} \
        5 \
    }
    *helpBack.label:				Back
    *helpBack.sensitive:			False
    *helpForward.label:				Forward
    *helpForward.sensitive:			False
    *helpHome.label:				Home
    *helpClose.label:				Close
 
    *helpInfoLayout*background:			gray
    *helpInfoLayout*Label.justify: 		center 
    *helpInfoLayout*Label.internalHeight:	0
    *helpInfoLayout.layout: horizontal { \
        2 < +0 -2 > \
        vertical { \
            5 \
            helpIRAFLogo \
            5 \
        } \
        1 < +0 -1 > \
        vertical { \
	    5 \
            horizontal { \
	        0 < +inf -inf > \
                helpInfo1 \
	        0 < +inf -inf > \
            } \
	    0 < +inf -0 > \
            horizontal { \
	        0 < +inf -inf > \
                helpInfo2 \
	        0 < +inf -inf > \
            } \
	        0 < +inf -inf > \
            horizontal { \
	        0 < +inf -inf > \
                helpInfo3  \
	        0 < +inf -inf > \
            } \
	    5 \
        } \
        1 < +0 -1 > \
        vertical { \
	    5 \
            helpNOAOLogo \
	    5 \
        } \
        2 < +0 -2 > \
    }
    *helpInfo1.label: XImtool V1.0   --   Released: 11/4/96
    *helpInfo2.label: iraf@noao.edu      (520) 318-4160
    *helpInfo3.label: NOAO is operated by AURA under cooperative agreement with the NSF
    *helpInfoLayout*helpInfo1.font: 	-*-helvetica-medium-r-normal-*-12-*-*-*
    *helpInfoLayout*helpInfo2.font: 	-*-helvetica-medium-r-normal-*-12-*-*-*
    *helpInfoLayout*helpInfo3.font: 	-*-helvetica-medium-r-normal-*-10-*-*-*
    *helpInfoLayout.helpIRAFLogo.internalWidth:       	0
    *helpInfoLayout.helpIRAFLogo.internalheight:       	0
    *helpInfoLayout.helpIRAFLogo.foreground:       	steelblue
    *helpInfoLayout.helpIRAFLogo.background:       	white
    *helpInfoLayout.helpNOAOLogo.internalWidth:       	0
    *helpInfoLayout.helpNOAOLogo.internalheight:       	0
    *helpInfoLayout.helpNOAOLogo.foreground:       	steelblue
    *helpInfoLayout.helpNOAOLogo.background:       	white
 
    *helpText.width:					450
    *helpText.height:					500
    *helpText.anchorUnderlines:				1
    *helpText.visitedAnchorUnderlines:			1
    *helpText.verticalScrollOnRight:			true
    *helpText.plainFont:				6x13

}

createObjects
proc quit args { send client gkey q; deactivate unmap }
send helpClose addCallback quit
activate

# Get list of viewable files in the current directory.
proc loadFile {filename} {
    set fd [open $filename]; set text [read $fd]; close $fd
    if {[file extension $filename] == ".html"} {
	send helpText setText $text
    } else {
	send helpText setText "<plaintext>$text"
    }
    send helpText retestAnchors
}
# Load initial file.
loadFile [lindex [glob *.html] 0] 	


# Help Panel Bitmaps
#-------------------
createBitmap iraf_logo 45 45 {
0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff,
0xff, 0x3f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xff, 0xff,
0xff, 0x3f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0xff, 0xff, 0xff,
0xff, 0x3f, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xc0, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x80, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x80, 0xfc, 0xff, 0xff,
0xff, 0x3f, 0x84, 0xf8, 0xff, 0xff, 0xff, 0x1f, 0x84, 0xf4, 0xff, 0xff,
0xff, 0x1b, 0x04, 0x09, 0x00, 0xfc, 0xff, 0x11, 0x04, 0x11, 0xf8, 0xff,
0x7f, 0x10, 0x04, 0x21, 0xc0, 0xff, 0x1f, 0x10, 0x04, 0x41, 0xf0, 0xff,
0x00, 0x18, 0x04, 0x01, 0xe0, 0xff, 0x00, 0x18, 0x00, 0x81, 0xc0, 0xff,
0x00, 0x08, 0x00, 0x01, 0xe0, 0xff, 0x07, 0x08, 0x00, 0x01, 0xf1, 0xff,
0x1f, 0x08, 0x80, 0x21, 0xf0, 0xff, 0xff, 0x08, 0xc0, 0x41, 0xf4, 0xff,
0xff, 0x08, 0xc0, 0x41, 0xf8, 0xff, 0xff, 0x09, 0xc0, 0xc1, 0xf0, 0xff,
0xff, 0x0b, 0x80, 0xc1, 0xf1, 0xff, 0xff, 0x07, 0x80, 0x81, 0xe1, 0xff,
0xff, 0x07, 0x80, 0x01, 0xc1, 0xff, 0xff, 0x07, 0x00, 0x01, 0xc0, 0xff,
0xff, 0x07, 0xc2, 0x05, 0x81, 0xff, 0xff, 0x07, 0xf2, 0x07, 0x81, 0xff,
0xff, 0x07, 0xf2, 0x17, 0x03, 0xff, 0xff, 0x03, 0xfa, 0x7f, 0x02, 0xfe,
0xff, 0x03, 0xfe, 0xff, 0x02, 0xfe, 0xff, 0x03, 0xfe, 0xff, 0x03, 0xfc,
0xff, 0x03, 0xff, 0xff, 0x07, 0xfc, 0xff, 0x83, 0xff, 0xff, 0x0f, 0xf8,
0xff, 0xc1, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xe1, 0xff, 0xff, 0x7f, 0xf8,
0xff, 0xf1, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xe0,
0xff, 0xf8, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xe7,
0xff, 0xfc, 0xff, 0xff, 0xff, 0xef}; send helpIRAFLogo "set bitmap iraf_logo"

createBitmap noao_logo 45 45 {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff,
0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff,
0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff,
0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff,
0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff,
0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff,
0xff, 0xff, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xff,
0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff,
0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff,
0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff,
0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff,
0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff,
0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff,
0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0xff,
0xff, 0x1f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x80, 0xff, 0xff,
0xff, 0x0f, 0x00, 0x80, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff,
0xff, 0x03, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x03, 0x00, 0x00, 0xfe, 0xff,
0xff, 0x01, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfc, 0xff,
0xff, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf8, 0xff,
0x7f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0xff,
0x3f, 0x00, 0x00, 0x00, 0xe0, 0xff}; send helpNOAOLogo "set bitmap noao_logo"



# Stuff for keeping track of visited anchors.
set links 	{ 0 }
set linkIndex 	  0
set visited(0)	empty

proc anchorSelected {widget cbtype event text href args} {
    global visited links linkIndex
    set anchID [send helpText anchorToId $href]
    set visited($href) 1
    if {$linkIndex == 0} {
	send helpBack set sensitive True
        if {[lindex $links 1] != $anchID} {
	    set links { 0 }
	    send helpForward set sensitive False
        } 
    } 
    if {$linkIndex > 0 && [lindex $links [expr $linkIndex + 1]] != $anchID} {
	set links [lrange $links 0 $linkIndex]
    } 
    if {[lindex $links [expr $linkIndex + 1]] != $anchID} {
        lappend links $anchID
        incr linkIndex
    } else {
        send helpForward set sensitive False
        incr linkIndex
    }
    if {$linkIndex == [expr [llength $links] - 1]} {
	send helpForward set sensitive False
    }
    send helpText gotoId $anchID
    send helpText retestAnchors
}; send helpText addCallback anchorSelected anchor

proc testAnchor {widget cbtype href} {
    global visited
    return [info exists visited($href)]
}; send helpText addCallback testAnchor testAnchor


# Callbacks to position forwards and backwards in link list.
proc hlpForward args {
    global links linkIndex
    incr linkIndex
    if {$linkIndex <= [llength $links]} {
        set anchID [lindex $links $linkIndex] 
        send helpText gotoId $anchID
        send helpText retestAnchors
	if {$linkIndex == [expr [llength $links] - 1]} {
	    send helpForward set sensitive False
	    send helpBack set sensitive True
	} else {
	    send helpBack set sensitive True
	}
    } else {
	incr linkIndex -1
    }
}; send helpForward addCallback hlpForward

proc hlpBack args {
    global links linkIndex
    incr linkIndex -1
    if {$linkIndex >= 0} {
        set anchID [lindex $links $linkIndex] 
        send helpText gotoId $anchID
        send helpText retestAnchors
	if {$linkIndex == 0} { send helpBack set sensitive False   }
	if {$linkIndex >= 0} { send helpForward set sensitive True }
    } else {
        incr linkIndex 1
    }
}; send helpBack addCallback hlpBack

proc hlpHome args {
    global links linkIndex
    set links { 0 }
    set linkIndex  0
    send helpText gotoId 0
    send helpForward set sensitive False
    send helpBack set sensitive False
    send helpText retestAnchors
}; send helpHome addCallback hlpHome