Class
Lcalendar
Home
In: locana/l_calendar.rb
Parent: Lgroup

This is a calendar allowing you to interactively select a date. The selected date in the calendar is stored in the :value attribute. This object also supports the :include_time=>true attribute. This class is based on the Lgroup class and uses the Lcalendar_month, Lcalendar_year, Lcalendar_day, and Lcalendar_time classes. The Lcalendar_window defined below opens a popup window containing the Lcalendar class. Features:

Methods

add_to_day, add_to_month, add_to_year, include_objects, on_down_key, on_enter_key, on_key_press, on_left_key, on_pagedown_key, on_pageup_key, on_right_key, on_up_key, open, refresh_calendar, valid_attribute?, value, value=,
Public Instance methods
valid_attribute?(attribute, lvalue=nil) src

Support the :include_time attribute.

add_to_day(lvalue) src

Add lvalue to day. Refreshes the calendar.

add_to_month(lvalue) src

Add lvalue to month. Refreshes the calendar.

add_to_year(lvalue) src

Add lvalue to year. Refreshes the calendar.

include_objects() src

Add objects needed for the calendar.

open(parent) src

Sets the correct date up in the calendar. We have to do this in the open or the packer will compress the date fields a little because some dates (1-9) are smaller.

value=(new_value) src

The value attribute needs to update the calendar, also need to make sure the new_value for the :value attribute is a Time object.

value() src

Returns the date (Time object) based on the current content of the calendar.

refresh_calendar() src

Redraws the calendar. This is called any time the year or month is changed. Updates the tDays objects based on the newly selected date.

on_key_press(levent=nil, &block) src

Supports Alt-p to select PM and Alt-a to select AM.

on_enter_key(levent=nil, &block) src

Forwards this to the parent_window which should yield the selected date and close the parent window.

on_left_key(levent=nil, &block) src

Subtracts 1 from the day.

on_right_key(levent=nil, &block) src

Adds 1 to the day.

on_up_key(levent=nil, &block) src

Shift up adds 1 to the hour. Ctrl up adds 1 to the minute. Alt up adds 1 to the second. Otherwise, subtracts one week from the selected date.

on_down_key(levent=nil, &block) src

Shift up subtracts 1 to the hour. Ctrl up subtracts 1 to the minute. Alt up subtracts 1 to the second. Otherwise, add one week to the selected date.

on_pagedown_key(levent=nil, &block) src

Adds 1 to the month. Shift pagedown adds 1 to the year.

on_pageup_key(levent=nil, &block) src

Subtracts 1 from the month. Shift pagedown subtracts 1 from the year.


Seva Software


Thank you for taking the time to visit this web page. I trust you found the information contained in this page useful.
Please email any questions, concerns, or issues with this web site to webmaster@sevasoftware.com.
Please remember Seva Software when your company would benefit from an experienced database architect and software engineer.

http://www.arunadb.org http://www.locana.org http://www.ruby-lang.org http://www.coolwell.org http://www.sevasoftware.com