NAME
iwidgets::datefield - Create and manipulate a date field widget
SYNOPSIS
iiwwiiddggeettss::::ddaatteeffiieelldd pathName ?options? IINNHHEERRIITTAANNCCEEitk::Widget <- iwidgets::LabeledWidget <- iwidgets::Datefield
SSTTAANNDDAARRDD OOPPTTIIOONNSS bbaacckkggrroouunndd bboorrddeerrWWiiddtthh ccuurrssoorr eexxppoorrttSSeelleeccttiioonn ffoorreeggrroouunndd hhiigghhlliigghhttCCoolloorr hhiigghhlliigghhttTThhiicckknneessss iinnsseerrttBBaacckkggrroouunndd jjuussttiiffyy rreelliieeff See the "options" manual entry for details on the standard options. IINNHHEERRIITTEEDD OOPPTTIIOONNSS ddiissaabblleeddFFoorreeggrroouunndd llaabbeellBBiittmmaapp llaabbeellFFoonnttllaabbeellIImmaaggee llaabbeellMMaarrggiinn llaabbeellPPooss llaabbeellTTeexxtt llaabbeellVVaarriiaabbllee ssttaattee ssttiicckkyy See the "labeledwidget" class manual entry for details on the inherited options.WWIIDDGGEETT-SSPPEECCIIFFIICC OOPPTTIIOONNSS
Name: cchhiillddSSiitteePPooss Class: PPoossiittiioonnCommand-Line Switch: -cchhiillddssiitteeppooss
Specifies the position of the child site in the date field: nn, ss, ee, or ww. The default is e. Name: ccoommmmaanndd Class: CCoommmmaannddCommand-Line Switch: -ccoommmmaanndd
Specifies a Tcl command to be executed upon detection of a Return key press event. Name: ggmmtt Class: GGMMTTCommand-Line Switch: -ggmmtt
Determines whether the date is calculated relative to Greenwich Mean Time. Accepts a boolean value. The default is no. Name: iinntt Class: DDaatteeFFoorrmmaattCommand-Line Switch: -iinntt
Used to specify international date formats. This option must be a boolean value. When set to true, the date is formatted asYYYY-MM-DD. When set to false, it is formatted as MM/DD/YYYY.
Note that this format is driven by the 'clock scan' command andthat YYYY-MM-DD is supported in Tk 8.4 or later. The default is
no. Name: iiqq Class: IIqqCommand-Line Switch: -iiqq
Specifies the level of intelligence to be shown in the actions taken by the datefield during the processing of keypress events. Valid settings include hhiigghh, aavveerraaggee, and llooww. With a high iq,the date prevents the user from typing in an invalid date. For example, if the current date is 05/31/1997 and the user changes the month to 04, then the day will be instantly modified for them to be 30. In addition, leap years are fully taken into account. With average iq, the month is limited to the values of01-12, but it is possible to type in an invalid day. A setting
of low iq instructs the widget to do no validity checking at all during date entry. With both average and low iq levels, it is assumed that the validity will be determined at a later time using the date's iissvvaalliidd command. Name: ssttaattee Class: SSttaatteeCommand-Line Switch: -ssttaattee
Specifies one of two states for the datefield: nnoorrmmaall or ddiiss-
aabblleedd. If the datefield is disabled then input is not accepted. The default is normal. Name: tteexxttBBaacckkggrroouunndd Class: BBaacckkggrroouunnddCommand-Line Switch: -tteexxttbbaacckkggrroouunndd
Background color for inside textual portion of the entry field.The value may be given in any of the forms acceptable to TTkkGGeett-
CCoolloorr. Name: tteexxttFFoonntt Class: FFoonnttCommand-Line Switch: -tteexxttffoonntt
Name of font to use for display of text in datefield. The value may be given in any of the forms acceptable to TTkkGGeettFFoonntt.DESCRIPTION
The iiwwiiddggeettss::::ddaatteeffiieelldd command creates an enhanced text entry widgetfor the purpose of date entry with various degrees of built-in intelli-
gence. MMEETTHHOODDSS The iiwwiiddggeettss::::ddaatteeffiieelldd command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form: pathName option ?arg arg ...? Option and the args determine the exact behavior of the command. The following commands are possible for datefield widgets:WWIIDDGGEETT-SSPPEECCIIFFIICC MMEETTHHOODDSS
pathName ccggeett option Returns the current value of the configuration option given byoption. Option may have any of the values accepted by the iiwwiidd-
ggeettss::::ddaatteeffiieelldd command. pathName ccoonnffiigguurree ?option? ?value option value ...? Query or modify the configuration options of the widget. If nooption is specified, returns a list describing all of the avail-
able options for pathName (see TTkkCCoonnffiigguurreeIInnffoo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one ormore option-value pairs are specified, then the command modifies
the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the iiwwiiddggeettss::::ddaatteeffiieelldd command. pathName ggeett ?ffoorrmmaatt? Returns the current contents of the datefield in a format ofstring or as an integer clock value using the -ssttrriinngg and
-cclliicckkss format options respectively. The default is by string.
Reference the clock command for more information on obtaining dates and their formats. pathName iissvvaalliidd Returns a boolean indication of the validity of the currently displayed date value. For example, 03/03/1960 is valid whereas 02/29/1997 is invalid. pathName sshhooww date Changes the currently displayed date to be that of the date argument. The date may be specified either as a string, an integer clock value or the keyword "now". Reference the clockcommand for more information on obtaining dates and their for-
mats. CCOOMMPPOONNEENNTTSS Name: ddaattee Class: EEnnttrryy The date component provides the entry field for date input and display. See the "entry" widget manual entry for details on the date component item. EEXXAAMMPPLLEE package require Iwidgets 4.0 proc returnCmd {} { puts [.df get] }iwidgets::datefield .df -command returnCmd
pack .df -fill x -expand yes -padx 10 -pady 10
AUTHOR Mark L. Ulferts KKEEYYWWOORRDDSS datefield, widget Tk iwidgets::datefield(1)