PackageDescription: DateField


Date Field

Last published: October 20, 2004 by 'thomasb'

Defines 12 Classes
Extends 15 Classes

The DateField is a widget designed for the input of dates. The main components are the InputField, the SpinButton to increment/decrement, the "normal" button and the Calendar which is opened, when the button is pressed. Editing of dates can be done by typing into the input field, or by pressing one of the SpinButtons or by pressing the normal button to show a small calendar. Within the calendar you can select a date by pressing the left mouse button or the -key. Browsing is possible by pressing the Cursor-keys, / or by selecting the small triangulars beside the month. will select today. closes the Calendar but does not change the value. For detailed information take a look at DateCalendarController>>processKeyboardEvent: and DateFieldInputController>>processKeyboardEvent:.

To see how it looks, just open the DateFieldTest application. It opens a window with several DateViews. If you edit the window spec you can change some settings like which days to paint in "weekend colour" (currently this is red) and how long the weekday name should be. The DateField uses the Locale to display all date information (month, weekday, ...) in the correct language.

I only implemented a Windows-look (the SpinButton is a copy of the WindowsSpinButton, ...). If you want to have Mac/Unix-looks you have to add the changes i made to the Win95LookPolicy to the corresponding LookPolicy-class and also change the buttons (the normal and the spin buttons).

The code for the DateField is derived from the ComboBox and the PLCalendar-goodie from Peter Laubender. Because his email address is not valid any more (original comment: *** Peter Laubender, Munich, Germany (laubender@usa.net) *** 11/96 ***) i couldn't ask him if i may include his code. But his code is distributed as a goodie therefore i assume, that i may include his code. If this is not the case, please contact me. As my code is concerned it is free to use and distribute.

Volker Zink
PORaBo Consulting
Volker.Zink@porabo.ch
Tägerwilen, Switzerland
28th September 2004