1Curses::UI::Calendar(3)User Contributed Perl DocumentatioCnurses::UI::Calendar(3)
2
3
4
6 Curses::UI::Calendar - Create and manipulate calendar widgets
7
9 Curses::UI::Widget
10 |
11 +----Curses::UI::Calendar
12
14 use Curses::UI;
15 my $cui = new Curses::UI;
16 my $win = $cui->add('window_id', 'Window');
17
18 my $calendar = $win->add(
19 'mycalendar', 'Calendar',
20 -date => '2002-1-14'
21 );
22
23 $calendar->focus();
24 my $date = $calendar->get();
25
27 Curses::UI::Calendar is a widget that can be used to create a calendar
28 in which the user can select a date. The calendar widget looks like
29 this:
30
31 +----------------------+
32 | mmm dd yyyy |
33 +----------------------+
34 | su mo tu we th fr sa |
35 | |
36 | 01 02 03 04 05 |
37 | 06 07 08 09 10 11 12 |
38 | 13 14 15 16 17 18 19 |
39 | 20 21 22 23 24 25 26 |
40 | 27 28 29 30 31 |
41 +----------------------+
42
43 See exampes/demo-Curses::UI::Calendar in the distribution for a short
44 demo.
45
47 -parent, -x, -y, -width, -height, -pad, -padleft, -padright, -padtop,
48 -padbottom, -ipad, -ipadleft, -ipadright, -ipadtop, -ipadbottom,
49 -title, -titlefullwidth, -titlereverse, -onfocus, -onblur
50
51 For an explanation of these standard options, see Curses::UI::Widget.
52
53 Remark: -width and -height can be set, but this widget really want to
54 have its content space at a minimum size. If your -width or -height is
55 not large enough, the widget will automatically fix its value.
56
58 · -date < DATE >
59
60 This option sets the date to start with. If you do not specify a
61 date, today's date will be used automatically. The format that you
62 can use for this date is one of:
63
64 * YYYY-M-D (e.g. 2002-1-10 or 2002-01-10)
65
66 * YYYY/M/D (e.g. 2002/1/10 or 2002/01/10))
67
68 * YYYYMMDD (e.g. 20020110)
69
70 * D-M-YYYY (e.g. 10-1-2002 or 10/01/2002)
71
72 * D/M/YYYY (e.g. 10/1/2002 or 10/01/2002)
73
74 · -onchange < CODEREF >
75
76 This sets the onChange event handler for the calendar widget. If a
77 new date is selected, the code in CODEREF will be executed. It
78 will get the widget reference as its argument.
79
80 · -drawline < CODEREF >
81
82 This option specifies whether or not a line should be drawn under
83 the calendar.
84
86 · new ( OPTIONS )
87
88 · layout ( )
89
90 · draw ( BOOLEAN )
91
92 · focus ( )
93
94 · onFocus ( CODEREF )
95
96 · onBlur ( CODEREF )
97
98 · intellidraw ( )
99
100 These are standard methods. See Curses::UI::Widget for an
101 explanation of these.
102
103 · get ( )
104
105 This method will return the currently selected date in the format
106 'YYYY-MM-DD'.
107
108 · setdate ( DATE, [BOOLEAN] )
109
110 Set the selected date of the widget to DATE. See -date above for
111 the possible formats. The widget will redraw itself, unless BOOLEAN
112 has a true value.
113
114 · onChange ( CODEREF )
115
116 This method can be used to set the -onchange event handler (see
117 above) after initialization of the calendar.
118
120 · <tab>
121
122 Call the 'loose-focus' routine. This will have the menubar loose
123 its focus and return the value 'LOOSE_FOCUS' to the calling
124 routine.
125
126 · <enter>, <space>
127
128 Call the 'date-select' routine. This will select the date on which
129 the cursor is.
130
131 · <cursor-left>, <h>
132
133 Call the 'date-prevday' routine. This will have the date cursor go
134 back one day.
135
136 · <cursor-right, <l>
137
138 Call the 'date-nextday' routine. This will have the date cursor go
139 forward one day.
140
141 · <cursor-down>, <j>
142
143 Call the 'date-nextweek' routine. This will have the date cursor go
144 forward one week.
145
146 · <cursor-up>, <k>
147
148 Call the 'date-prevweek' routine. This will have the date cursor go
149 back one week.
150
151 · <page-up>, <SHIFT+K>
152
153 Call the 'date-prevmonth' routine. This will have the date cursor
154 go back one month.
155
156 · <page-down>, <SHIFT+J>
157
158 Call the 'date-nextmonth' routine. This will have the date cursor
159 go forward one month.
160
161 · <p>, <SHIFT+H>
162
163 Call the 'date-prevyear' routine. This will have the date cursor go
164 back one year.
165
166 · <n>, <SHIFT+L>
167
168 Call the 'date-nextyear' routine. This will have the date cursor go
169 forward one year.
170
171 · <home>, <CTRL+A>, <c>
172
173 Call the 'date-selected' routine. This will have the date cursor go
174 to the current selected date.
175
176 · <t>
177
178 Call the 'date-today' routine. This will have the date cursor go to
179 today's date.
180
182 Curses::UI, Curses::UI::Widget, Curses::UI::Common
183
185 Copyright (c) 2001-2002 Maurice Makaay. All rights reserved.
186
187 Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de)
188
189 This package is free software and is provided "as is" without express
190 or implied warranty. It may be used, redistributed and/or modified
191 under the same terms as perl itself.
192
193
194
195perl v5.32.0 2020-07-28 Curses::UI::Calendar(3)