1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1997 DSC Technologies Corporation
|
3 |
|
|
'\"
|
4 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
5 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
6 |
|
|
'\"
|
7 |
|
|
'\" @(#) calendar.n 1.0 97/04/30 16:04:44
|
8 |
|
|
'/"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.HS calendar iwid
|
11 |
|
|
.BS
|
12 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
13 |
|
|
.SH NAME
|
14 |
|
|
calendar \- Create and manipulate a monthly calendar
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
\fBcalendar\fI \fIpathName \fR?\fIoptions\fR?
|
17 |
|
|
.SH "INHERITANCE"
|
18 |
|
|
itk::Widget <- calendar
|
19 |
|
|
.SH "STANDARD OPTIONS"
|
20 |
|
|
.LP
|
21 |
|
|
.nf
|
22 |
|
|
.ta 4c 8c 12c
|
23 |
|
|
\fBbackground\fR \fBcursor\fR \fBforeground\fR
|
24 |
|
|
.fi
|
25 |
|
|
.LP
|
26 |
|
|
See the "options" manual entry for details on the standard options.
|
27 |
|
|
.SH "WIDGET-SPECIFIC OPTIONS"
|
28 |
|
|
.LP
|
29 |
|
|
.nf
|
30 |
|
|
Name: \fBbackwardImage\fR
|
31 |
|
|
Class: \fBImage\fR
|
32 |
|
|
Command-Line Switch: \fB-backwardimage\fR
|
33 |
|
|
.fi
|
34 |
|
|
.IP
|
35 |
|
|
Specifies a image to be displayed on the backwards calendar
|
36 |
|
|
button. This image must have been created previously with
|
37 |
|
|
the \fBimage create\fR command. If none is specified, a default
|
38 |
|
|
is provided.
|
39 |
|
|
.LP
|
40 |
|
|
.nf
|
41 |
|
|
Name: \fBbuttonForeground\fR
|
42 |
|
|
Class: \fBForeground\fR
|
43 |
|
|
Command-Line Switch: \fB-buttonforeground\fR
|
44 |
|
|
.fi
|
45 |
|
|
.IP
|
46 |
|
|
Specifies the foreground color of the forward and backward buttons
|
47 |
|
|
in any of the forms acceptable to \fBTk_GetColor\fR. The default
|
48 |
|
|
color is blue.
|
49 |
|
|
.LP
|
50 |
|
|
.nf
|
51 |
|
|
Name: \fBcommand\fR
|
52 |
|
|
Class: \fBCommand\fR
|
53 |
|
|
Command-Line Switch: \fB-command\fR
|
54 |
|
|
.fi
|
55 |
|
|
.IP
|
56 |
|
|
Specifies a Tcl script to executed upon selection of a date in the
|
57 |
|
|
calendar. If the command script contains any \fB%\fR characters,
|
58 |
|
|
then the script will not be executed directly. Instead, a new
|
59 |
|
|
script will be generated by replacing each \fB%\fR, and the
|
60 |
|
|
character following it, with information from the calendar. The
|
61 |
|
|
replacement depends on the character following the \fB%\fR, as
|
62 |
|
|
defined in the list below.
|
63 |
|
|
.TP
|
64 |
|
|
\fB%d\fR
|
65 |
|
|
Replaced with the date selected in the format mm/dd/yyyy.
|
66 |
|
|
.LP
|
67 |
|
|
.nf
|
68 |
|
|
Name: \fBcurrentDateFont\fR
|
69 |
|
|
Class: \fBFont\fR
|
70 |
|
|
Command-Line Switch: \fB-currentdatefont\fR
|
71 |
|
|
.fi
|
72 |
|
|
.IP
|
73 |
|
|
Specifies the font used for the current date text in any of the forms
|
74 |
|
|
acceptable to \fBTk_GetFont\fR.
|
75 |
|
|
.LP
|
76 |
|
|
.nf
|
77 |
|
|
Name: \fBdateFont\fR
|
78 |
|
|
Class: \fBFont\fR
|
79 |
|
|
Command-Line Switch: \fB-datefont\fR
|
80 |
|
|
.fi
|
81 |
|
|
.IP
|
82 |
|
|
Specifies the font used for the days of the month text in any of the forms
|
83 |
|
|
acceptable to \fBTk_GetFont\fR.
|
84 |
|
|
.LP
|
85 |
|
|
.nf
|
86 |
|
|
Name: \fBdayFont\fR
|
87 |
|
|
Class: \fBFont\fR
|
88 |
|
|
Command-Line Switch: \fB-dayfont\fR
|
89 |
|
|
.fi
|
90 |
|
|
.IP
|
91 |
|
|
Specifies the font used for the days of the week text in any of the forms
|
92 |
|
|
acceptable to \fBTk_GetFont\fR.
|
93 |
|
|
.LP
|
94 |
|
|
.nf
|
95 |
|
|
Name: \fBdays\fR
|
96 |
|
|
Class: \fBdays\fR
|
97 |
|
|
Command-Line Switch: \fB-days\fR
|
98 |
|
|
.fi
|
99 |
|
|
.IP
|
100 |
|
|
Specifies a list of values to be used for the days of the week
|
101 |
|
|
text to displayed above the days of the month. The default value
|
102 |
|
|
is {Su Mo Tu We Th Fr Sa}.
|
103 |
|
|
.LP
|
104 |
|
|
.nf
|
105 |
|
|
Name: \fBforewardImage\fR
|
106 |
|
|
Class: \fBImage\fR
|
107 |
|
|
Command-Line Switch: \fB-forewardimage\fR
|
108 |
|
|
.fi
|
109 |
|
|
.IP
|
110 |
|
|
Specifies a image to be displayed on the forewards calendar
|
111 |
|
|
button. This image must have been created previously with
|
112 |
|
|
the \fBimage create\fR command. If none is specified, a default
|
113 |
|
|
is provided.
|
114 |
|
|
.LP
|
115 |
|
|
.nf
|
116 |
|
|
Name: \fBheight\fR
|
117 |
|
|
Class: \fBHeight\fR
|
118 |
|
|
Command-Line Switch: \fB-height\fR
|
119 |
|
|
.fi
|
120 |
|
|
.IP
|
121 |
|
|
Specifies a desired window height that the calendar widget should
|
122 |
|
|
request from its geometry manager. The value may be specified in any
|
123 |
|
|
of the forms acceptable to \fBTk_GetPixels\fR. The default height
|
124 |
|
|
is 165 pixels.
|
125 |
|
|
.LP
|
126 |
|
|
.nf
|
127 |
|
|
Name: \fBoutline\fR
|
128 |
|
|
Class: \fBOutline\fR
|
129 |
|
|
Command-Line Switch: \fB-outline\fR
|
130 |
|
|
.fi
|
131 |
|
|
.IP
|
132 |
|
|
Specifies the outline color used to surround the days of the month text in
|
133 |
|
|
any of the forms acceptable to \fBTk_GetColor\fR. The default is the
|
134 |
|
|
same color as the background.
|
135 |
|
|
.LP
|
136 |
|
|
.nf
|
137 |
|
|
Name: \fBselectColor\fR
|
138 |
|
|
Class: \fBForeground\fR
|
139 |
|
|
Command-Line Switch: \fB-selectcolor\fR
|
140 |
|
|
.fi
|
141 |
|
|
.IP
|
142 |
|
|
Specifies the color of the ring displayed that distinguishes the
|
143 |
|
|
currently selected date in any of the forms acceptable to
|
144 |
|
|
\fBTk_GetColor\fR. The default is red.
|
145 |
|
|
.LP
|
146 |
|
|
.nf
|
147 |
|
|
Name: \fBselectThickness\fR
|
148 |
|
|
Class: \fBSelectThickness\fR
|
149 |
|
|
Command-Line Switch: \fB-selectthickness\fR
|
150 |
|
|
.fi
|
151 |
|
|
.IP
|
152 |
|
|
Specifies the thickness of the ring displayed that distinguishes
|
153 |
|
|
the currently selected date. The default is 3 pixels.
|
154 |
|
|
.LP
|
155 |
|
|
.nf
|
156 |
|
|
Name: \fBstartday\fR
|
157 |
|
|
Class: \fBDay\fR
|
158 |
|
|
Command-Line Switch: \fB-startday\fR
|
159 |
|
|
.fi
|
160 |
|
|
.IP
|
161 |
|
|
Specifies the starting day for the week: \fBsunday\fR, \fBmonday\fR,
|
162 |
|
|
\fBtuesday\fR, \fBwednesday\fR, \fBthursday\fR, \fBfriday\fR, or
|
163 |
|
|
\fBsaturday\fR. The default is sunday.
|
164 |
|
|
.LP
|
165 |
|
|
.nf
|
166 |
|
|
Name: \fBtitleFont\fR
|
167 |
|
|
Class: \fBFont\fR
|
168 |
|
|
Command-Line Switch: \fB-titlefont\fR
|
169 |
|
|
.fi
|
170 |
|
|
.IP
|
171 |
|
|
Specifies the font used for the title text which consists of the
|
172 |
|
|
month and year. The font may be given in any of the forms
|
173 |
|
|
acceptable to \fBTk_GetFont\fR.
|
174 |
|
|
.LP
|
175 |
|
|
.nf
|
176 |
|
|
Name: \fBweekdayBackground\fR
|
177 |
|
|
Class: \fBBackground\fR
|
178 |
|
|
Command-Line Switch: \fB-weekdaybackground\fR
|
179 |
|
|
.fi
|
180 |
|
|
.IP
|
181 |
|
|
Specifies the background color for the weekdays which allows it to
|
182 |
|
|
be visually distinguished from the weekend. The color may be given
|
183 |
|
|
in any of the forms acceptable to \fBTk_GetColor\fR. The default is
|
184 |
|
|
the same as the background.
|
185 |
|
|
.LP
|
186 |
|
|
.nf
|
187 |
|
|
Name: \fBweekendBackground\fR
|
188 |
|
|
Class: \fBBackground\fR
|
189 |
|
|
Command-Line Switch: \fB-weekendbackground\fR
|
190 |
|
|
.fi
|
191 |
|
|
.IP
|
192 |
|
|
Specifies the background color for the weekends which allows it to
|
193 |
|
|
be visually distinguished from the weekdays. The color may be given
|
194 |
|
|
in any of the forms acceptable to \fBTk_GetColor\fR. The default is
|
195 |
|
|
the same as the background.
|
196 |
|
|
.LP
|
197 |
|
|
.nf
|
198 |
|
|
Name: \fBwidth\fR
|
199 |
|
|
Class: \fBWidth\fR
|
200 |
|
|
Command-Line Switch: \fB-width\fR
|
201 |
|
|
.fi
|
202 |
|
|
.IP
|
203 |
|
|
Specifies a desired window width that the calendar widget should
|
204 |
|
|
request from its geometry manager. The value may be specified in any
|
205 |
|
|
of the forms acceptable to \fBTk_GetPixels\fR. The default width
|
206 |
|
|
is 200 pixels.
|
207 |
|
|
.LP
|
208 |
|
|
.BE
|
209 |
|
|
|
210 |
|
|
.SH DESCRIPTION
|
211 |
|
|
.PP
|
212 |
|
|
The \fBcalendar\fR command creates a calendar widget for the selection
|
213 |
|
|
of a date, displaying a single month at a time. Buttons exist on the
|
214 |
|
|
top to change the month in effect turning the pages of a calendar. As
|
215 |
|
|
a page is turned, the dates for the month are modified. Selection of
|
216 |
|
|
a date visually marks that date. The selected value can be monitored
|
217 |
|
|
via the -command option or just retrieved using the get command.
|
218 |
|
|
|
219 |
|
|
.SH "METHODS"
|
220 |
|
|
.PP
|
221 |
|
|
The \fBcalendar\fR command creates a new Tcl command whose
|
222 |
|
|
name is \fIpathName\fR. This
|
223 |
|
|
command may be used to invoke various
|
224 |
|
|
operations on the widget. It has the following general form:
|
225 |
|
|
.DS C
|
226 |
|
|
\fIpathName option \fR?\fIarg arg ...\fR?
|
227 |
|
|
.DE
|
228 |
|
|
\fIOption\fR and the \fIarg\fRs
|
229 |
|
|
determine the exact behavior of the command. The following
|
230 |
|
|
commands are possible for calendar widgets:
|
231 |
|
|
|
232 |
|
|
.SH "WIDGET-SPECIFIC METHODS"
|
233 |
|
|
.TP
|
234 |
|
|
\fIpathName \fBcget\fR \fIoption\fR
|
235 |
|
|
Returns the current value of the configuration option given
|
236 |
|
|
by \fIoption\fR.
|
237 |
|
|
\fIOption\fR may have any of the values accepted by the \fBcalendar\fR
|
238 |
|
|
command.
|
239 |
|
|
.TP
|
240 |
|
|
\fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
|
241 |
|
|
Query or modify the configuration options of the widget.
|
242 |
|
|
If no \fIoption\fR is specified, returns a list describing all of
|
243 |
|
|
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
|
244 |
|
|
information on the format of this list). If \fIoption\fR is specified
|
245 |
|
|
with no \fIvalue\fR, then the command returns a list describing the
|
246 |
|
|
one named option (this list will be identical to the corresponding
|
247 |
|
|
sublist of the value returned if no \fIoption\fR is specified). If
|
248 |
|
|
one or more \fIoption\-value\fR pairs are specified, then the command
|
249 |
|
|
modifies the given widget option(s) to have the given value(s); in
|
250 |
|
|
this case the command returns an empty string.
|
251 |
|
|
\fIOption\fR may have any of the values accepted by the \fBcalendar\fR
|
252 |
|
|
command.
|
253 |
|
|
.TP
|
254 |
|
|
\fIpathName \fBget\fR ?\fBformat\fR?
|
255 |
|
|
Returns the currently selected date in a format of
|
256 |
|
|
string or as an integer clock value using the \fB-string\fR and \fB-clicks\fR
|
257 |
|
|
format options respectively. The default is by string. Reference the
|
258 |
|
|
clock command for more information on obtaining dates and their
|
259 |
|
|
formats.
|
260 |
|
|
.TP
|
261 |
|
|
\fIpathName \fBselect\fR \fIdate\fR
|
262 |
|
|
Changes the currently selected date to the value specified which
|
263 |
|
|
must be in the form of a date string, an integer clock value or as
|
264 |
|
|
the keyword "now". Reference the clock
|
265 |
|
|
command for more information on obtaining dates and their formats.
|
266 |
|
|
Note that selecting a date does not change the
|
267 |
|
|
month being shown to that of the date given. This chore is left
|
268 |
|
|
to the \fBshow\R command.
|
269 |
|
|
.TP
|
270 |
|
|
\fIpathName \fBshow\fR \fIdate\fR
|
271 |
|
|
Changes the currently displayed date to be that of the date
|
272 |
|
|
argument which must be in the form of a date string, an
|
273 |
|
|
integer clock value or as
|
274 |
|
|
the keyword "now". Reference the clock
|
275 |
|
|
command for more information on obtaining dates and their formats.
|
276 |
|
|
|
277 |
|
|
.SH "COMPONENTS"
|
278 |
|
|
.LP
|
279 |
|
|
.nf
|
280 |
|
|
Name: \fBforward\fR
|
281 |
|
|
Class: \fBButton\fR
|
282 |
|
|
.fi
|
283 |
|
|
.IP
|
284 |
|
|
The forward component provides the button on the upper right of the
|
285 |
|
|
calendar that changes the month to be the next. See the "button"
|
286 |
|
|
widget manual entry for details on the forward component item.
|
287 |
|
|
.LP
|
288 |
|
|
.nf
|
289 |
|
|
Name: \fBpage\fR
|
290 |
|
|
Class: \fBCanvas\fR
|
291 |
|
|
.fi
|
292 |
|
|
.IP
|
293 |
|
|
The page component provides the canvas on which the title, days of the
|
294 |
|
|
week, and days of the month appear. See the "canvas" widget manual
|
295 |
|
|
entry for details on the page component item.
|
296 |
|
|
.LP
|
297 |
|
|
.nf
|
298 |
|
|
Name: \fBbackward\fR
|
299 |
|
|
Class: \fBButton\fR
|
300 |
|
|
.fi
|
301 |
|
|
.IP
|
302 |
|
|
The backward component provides the button on the upper right of the
|
303 |
|
|
calendar that changes the month to be the next. See the "button"
|
304 |
|
|
widget manual entry for details on the backward component item.
|
305 |
|
|
|
306 |
|
|
.SH EXAMPLE
|
307 |
|
|
.DS
|
308 |
|
|
proc selectCmd {date} {
|
309 |
|
|
puts $date
|
310 |
|
|
}
|
311 |
|
|
|
312 |
|
|
calendar .c -command {selectCmd %d} -weekendbackground mistyrose \\
|
313 |
|
|
-weekdaybackground ghostwhite -outline black \\
|
314 |
|
|
-startday wednesday -days {We Th Fr Sa Su Mo Tu}
|
315 |
|
|
pack .c
|
316 |
|
|
.DE
|
317 |
|
|
.SH AUTHOR
|
318 |
|
|
Mark L. Ulferts
|
319 |
|
|
.DE
|
320 |
|
|
Michael J. McLennan
|
321 |
|
|
.SH KEYWORDS
|
322 |
|
|
calendar, widget
|