.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Prima::Calendar 3" .TH Prima::Calendar 3 "2009-02-24" "perl v5.20.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Prima::Calendar \- standard calendar widget .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 9 \& use Prima::Calendar; \& my $cal = Prima::Calendar\-> create( \& useLocale => 1, \& onChange => sub { \& print $_[0]\-> date_as_string, "\en"; \& }, \& ); \& $cal\-> date_from_time( localtime ); \& $cal\-> month( 5); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Provides interactive selection of date between 1900 and 2099 years. The main property, date, is a three-integer array, day, month, and year, in the format of perl localtime ( see \*(L"localtime\*(R" in perlfunc ) \- day can be in range from 1 to 31,month from 0 to 11, year from 0 to 199. .SH "API" .IX Header "API" .SS "Events" .IX Subsection "Events" .IP "Change" 4 .IX Item "Change" Called when the date property is changed. .SS "Properties" .IX Subsection "Properties" .IP "date \s-1DAY, MONTH, YEAR\s0" 4 .IX Item "date DAY, MONTH, YEAR" Accepts three integers in format of \f(CW\*(C`localtime\*(C'\fR. \&\s-1DAY\s0 can be from 1 to 31, \s-1MONTH\s0 from 0 to 11, \s-1YEAR\s0 from 0 to 199. .Sp Default value: today's date. .IP "day \s-1INTEGER\s0" 4 .IX Item "day INTEGER" Selects the day in month. .IP "firstDayOfWeek \s-1INTEGER\s0" 4 .IX Item "firstDayOfWeek INTEGER" Selects the first day of week, an integer between 0 and 6, where 0 is Sunday is the first day, 1 is Monday etc. .Sp Default value: 0 .IP "month" 4 .IX Item "month" Selects the month. .IP "useLocale \s-1BOOLEAN\s0" 4 .IX Item "useLocale BOOLEAN" If 1, the locale-specific names of months and days of week are used. These are read by calling \f(CW\*(C`POSIX::strftime\*(C'\fR. If invocation of \s-1POSIX\s0 module fails, the property is automatically assigned to 0. .Sp If 0, the English names of months and days of week are used. .Sp Default value: 1 .Sp See also: date_as_string .IP "year" 4 .IX Item "year" Selects the year. .SS "Methods" .IX Subsection "Methods" .IP "can_use_locale" 4 .IX Item "can_use_locale" Returns boolean value, whether the locale information can be retrieved by calling \f(CW\*(C`strftime\*(C'\fR. .IP "month2str \s-1MONTH\s0" 4 .IX Item "month2str MONTH" Returns \s-1MONTH\s0 name according to useLocale value. .IP "make_months" 4 .IX Item "make_months" Returns array of 12 month names according to useLocale value. .IP "day_of_week \s-1DAY, MONTH, YEAR,\s0 [ \s-1USE_FIRST_DAY_OF_WEEK\s0 = 1 ]" 4 .IX Item "day_of_week DAY, MONTH, YEAR, [ USE_FIRST_DAY_OF_WEEK = 1 ]" Returns integer value, from 0 to 6, of the day of week on \&\s-1DAY, MONTH, YEAR\s0 date. If boolean \s-1USE_FIRST_DAY_OF_WEEK\s0 is set, the value of \f(CW\*(C`firstDayOfWeek\*(C'\fR property is taken into the account, so 0 is a Sunday shifted forward by \f(CW\*(C`firstDayOfWeek\*(C'\fR days. .Sp The switch from Julian to Gregorian calendar is ignored. .IP "date_as_string [ \s-1DAY, MONTH, YEAR \s0]" 4 .IX Item "date_as_string [ DAY, MONTH, YEAR ]" Returns string representation of date on \s-1DAY, MONTH, YEAR\s0 according to useLocale property value. .IP "date_from_time \s-1SEC, MIN, HOUR, M_DAY, MONTH, YEAR, ...\s0" 4 .IX Item "date_from_time SEC, MIN, HOUR, M_DAY, MONTH, YEAR, ..." Copies date from \f(CW\*(C`localtime\*(C'\fR or \f(CW\*(C`gmtime\*(C'\fR result. This helper method allows the following syntax: .Sp .Vb 1 \& $calendar\-> date_from_time( localtime( time)); .Ve .SH "AUTHOR" .IX Header "AUTHOR" Dmitry Karasik, . .SH "SEE ALSO" .IX Header "SEE ALSO" Prima, Prima::Widget, \s-1POSIX\s0, \*(L"localtime\*(R" in perlfunc, \*(L"time\*(R" in perlfunc, \&\fIexamples/calendar.pl\fR.