PackageDescription: DateField


Date Field

Last published: October 3, 2017 by 'lopeman'

Defines 16 Classes
Extends 26 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).