summaryrefslogtreecommitdiffstats
path: root/ds9/library/mhelp.tcl
blob: 44fd9a5b6feb08f99c0f08250e4ecaaf77f11b7c (plain)
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
#  Copyright (C) 1999-2016
#  Smithsonian Astrophysical Observatory, Cambridge, MA, USA
#  For conditions of distribution and use, see copyright notice in "copyright"

package provide DS9 1.0

# Menu

proc HelpMainMenu {} {
    global ds9

    switch $ds9(wm) {
 	x11 -
	win32 {}
 	aqua {
	    # window menu
	    menu $ds9(mb).window
	    $ds9(mb) add cascade -label [msgcat::mc {Window}] \
		-menu $ds9(mb).window
	}
    }

    $ds9(mb) add cascade -label [msgcat::mc {Help}] -menu $ds9(mb).help
    menu $ds9(mb).help
    switch $ds9(wm) {
 	x11 -
 	win32 {
	    $ds9(mb).help add command -label [msgcat::mc {Reference Manual}]\
		-command HelpRef
	}
 	aqua {}
    }
    $ds9(mb).help add command -label [msgcat::mc {User Manual}]\
	-command HelpUser
    $ds9(mb).help add separator
    $ds9(mb).help add command -label [msgcat::mc {FAQ}] \
	-command HelpFAQ
    $ds9(mb).help add command -label [msgcat::mc {Release Notes}] \
	-command HelpRelease
    $ds9(mb).help add command -label [msgcat::mc {Help Desk}] \
	-command HelpDesk
    $ds9(mb).help add separator
    $ds9(mb).help add command -label [msgcat::mc {Story of SAOImageDS9}] \
	-command HelpStory
    $ds9(mb).help add command -label [msgcat::mc {Acknowledgment}] \
	-command HelpAck

    switch $ds9(wm) {
	x11 -
	win32 {
	    $ds9(mb).help add separator
	    $ds9(mb).help add command \
		-label "[msgcat::mc {About SAOImageDS9}]..." \
		-command AboutBox
	}
	aqua {}
    }
}

proc PrefsDialogHelpMenu {w} {
    set f [ttk::labelframe $w.mhelp -text [msgcat::mc {Help}]]

    PrefsDialogButtonbarHelp $f.buttonbar

    grid $f.buttonbar -padx 2 -pady 2 -sticky w

    pack $f -side top -fill both -expand true
}

# Buttons

proc ButtonsHelpDef {} {
    global pbuttons

    array set pbuttons {
	help,ref 1
	help,user 1
	help,keyboard 1
	help,faq 0
	help,new 0
	help,release 1
	help,desk 1
	help,story 0
	help,ack 1
	help,about 1
    }
}

proc CreateButtonsHelp {} {
    global buttons
    global ds9

    ttk::frame $ds9(buttons).help

    ButtonButton $ds9(buttons).help.ref \
	[string tolower [msgcat::mc {Reference}]] HelpRef
    ButtonButton $ds9(buttons).help.user \
	[string tolower [msgcat::mc {User}]] HelpUser
    ButtonButton $ds9(buttons).help.keyboard \
	[string tolower [msgcat::mc {Keyboard}]] HelpKeyboard
    ButtonButton $ds9(buttons).help.faq \
	[string tolower [msgcat::mc {FAQ}]] HelpFAQ
    ButtonButton $ds9(buttons).help.new \
	[string tolower [msgcat::mc {New Features}]] HelpNew
    ButtonButton $ds9(buttons).help.release \
	[string tolower [msgcat::mc {Release}]] HelpRelease
    ButtonButton $ds9(buttons).help.desk \
	[string tolower [msgcat::mc {Help Desk}]] HelpDesk
    ButtonButton $ds9(buttons).help.story \
	[string tolower [msgcat::mc {Story}]] HelpStory
    ButtonButton $ds9(buttons).help.ack \
	[string tolower [msgcat::mc {Acknowledgment}]] HelpAck
    ButtonButton $ds9(buttons).help.about \
	[string tolower [msgcat::mc {About}]] AboutBox

    set buttons(help) "
        $ds9(buttons).help.ref pbuttons(help,ref)
        $ds9(buttons).help.user pbuttons(help,user)
        $ds9(buttons).help.keyboard pbuttons(help,keyboard)
        $ds9(buttons).help.faq pbuttons(help,faq)
        $ds9(buttons).help.new pbuttons(help,new)
        $ds9(buttons).help.release pbuttons(help,release)
        $ds9(buttons).help.desk pbuttons(help,desk)
        $ds9(buttons).help.story pbuttons(help,story)
        $ds9(buttons).help.ack pbuttons(help,ack)
        $ds9(buttons).help.about pbuttons(help,about)
    "
}

proc PrefsDialogButtonbarHelp {f} {
    global buttons
    global pbuttons

    ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
    
    set m $f.menu
    menu $m
    $m add checkbutton -label [msgcat::mc {Reference Manual}]\
	-variable pbuttons(help,ref) -command {UpdateButtons buttons(help)}
    $m add checkbutton -label [msgcat::mc {User Manual}]\
	-variable pbuttons(help,user) -command {UpdateButtons buttons(help)}
    $m add separator
    $m add checkbutton -label [msgcat::mc {FAQ}] \
	-variable pbuttons(help,faq) -command {UpdateButtons buttons(help)}
    $m add checkbutton -label [msgcat::mc {Release Notes}] \
	-variable pbuttons(help,release) -command {UpdateButtons buttons(help)}
    $m add checkbutton -label [msgcat::mc {Help Desk}] \
	-variable pbuttons(help,desk) -command {UpdateButtons buttons(help)}
    $m add separator
    $m add checkbutton -label [msgcat::mc {Story of SAOImageDS9}] \
	-variable pbuttons(help,story) -command {UpdateButtons buttons(help)}
    $m add checkbutton -label [msgcat::mc {Acknowledgment}] \
	-variable pbuttons(help,ack) -command {UpdateButtons buttons(help)}
    $m add separator
    $m add checkbutton -label "[msgcat::mc {About SAOImageDS9}]..." \
	-variable pbuttons(help,about) -command {UpdateButtons buttons(help)}
}