DateTime

 

The DATETIME control is the WIL Dialog implementation of the Date and Time Picker Windows Common Control. It can be used to both display and receive date and time input in multiple formats.  

The standard YYYY:MM:DD:HH:MM:SS date/time input can be displayed in various ways using the control's text attribute Format(dMyhHmst'').

A drop down calendar is available for changing the date input.  The method of selecting a day, month, or year are the same as the Calendar Control.  A user can select a day from the current month and year by simply clicking on a day number. A user can scroll the months of the year by clicking the arrow buttons in the top left or top right of the control. To select a non-adjacent month the user can click the name of a displayed month, a pop-up menu appears that lists all months within the year. The user can select a month on the list. If the user clicks the year displayed next to a month name, a Spinner control appears in place of the year. The user can change the year with this control.

For the drop down calendar you can also specify the initial month/year to display, along with a minimum and maximum calendar date that can be displayed.  The calendar's font, background color, and font color can be changed.  

Other style options are making the display invisible, disabling the display, displaying a check box that indicates no date/time value when unchecked, and specifying a spinner in place of the drop down calendar.

The DateTime control will return the user's selection in the variable you supply as the Variable attribute in the control's definition.  The date will be returned in the standard YYYY:MM:DD:HH:MM:SS date/time format.

 

image\calendar.gif

 

 

Control Attributes

 

Calendar

Check Box

Com Control

DateTime

Drop-down Combo Box

Edit Box

File List Box

Group Box

Item List Box

Menu Bar

Menu Item

Multiline Edit Box

Picture

Picture Button

Push Button

Radio Button

Report View

Spinner

Static Text

Variable Text

 

 

For example, the lines in the script generated by the WIL Dialog Editor for the example above would look like:

MyDialogFormat=`WWWDLGED,6.2`
MyDialogCaption=`WIL Dialog 1`
MyDialogX=002
MyDialogY=059
MyDialogWidth=230
MyDialogHeight=217
MyDialogNumControls=013
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0
MyDialog001=`025,181,036,012,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,10,@csDefButton,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`101,181,036,012,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`033,047,058,012,DATETIME,"DateTime_1",dtVariable1,DEFAULT,DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog004=`011,037,106,008,STATICTEXT,"StaticText_1",DEFAULT,"Format Attribute set as  DEFAULT",DEFAULT,40,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog005=`031,087,064,012,DATETIME,"DateTime_2",dtVariable2,"dMyhHmst",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog006=`011,077,100,008,STATICTEXT,"StaticText_2",DEFAULT,"Format Attribute dMyhHmst",DEFAULT,60,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog007=`009,135,116,012,DATETIME,"DateTime_3",dtVariable3,"'DATE: '  MM/dd/yyyy     'TIME:' h:m:s tt",DEFAULT,70,@csSpinner,DEFAULT,DEFAULT,DEFAULT`
MyDialog008=`011,125,074,008,STATICTEXT,"StaticText_3",DEFAULT,"Create custom Format Attribute",DEFAULT,80,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog009=`139,027,060,012,DATETIME,"DateTime_4",dtVariable4,DEFAULT,DEFAULT,90,@csSpinner,DEFAULT,DEFAULT,DEFAULT`
MyDialog010=`137,017,070,008,STATICTEXT,"StaticText_4",DEFAULT,"DateTime Spinner",DEFAULT,100,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog011=`137,075,066,012,DATETIME,"DateTime_5",dtVariable5,DEFAULT,DEFAULT,110,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog012=`135,065,080,008,STATICTEXT,"StaticText_5",DEFAULT,"Click For Drop Down Calendar",DEFAULT,120,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog013=`005,007,126,158,GROUPBOX,"GroupBox_1",DEFAULT,"Different Format Attributes",DEFAULT,130,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
ButtonPushed=Dialog("MyDialog")