From: George H. <geo...@us...> - 2007-02-21 09:59:33
|
Update of /cvsroot/win32forth/win32forth/src/lib In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5279/win32forth/src/lib Modified Files: Calendar.f Log Message: gah: Added generic class for common methods Index: Calendar.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/lib/Calendar.f,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Calendar.f 29 Aug 2006 08:52:25 -0000 1.4 --- Calendar.f 21 Feb 2007 09:59:29 -0000 1.5 *************** *** 13,16 **** --- 13,42 ---- EXTERNAL + in-system + + |class DateTimeControl <Super Control + \ *G Generic class for methods common to MonthCalendar and DateTimePicker controls. + + in-previous + + int style + + :M ClassInit: ( -- ) + \ *G Initialise the class. + ClassInit: super + 0 to style + ;M + + :M AddStyle: ( n -- ) + \ *G Set any additional style of the control. Must be done before the control + \ ** is created. + to style ;M + + :M WindowStyle: ( -- style ) + \ *G Get the window style of the control. Default style is: WS_BORDER. + WindowStyle: super WS_BORDER or style or ;M + + ;class + #IFNDEF wYear \ Because _SystemTime is a user variable The following need to be set at run time *************** *** 38,89 **** set-time-pointers \ TODO: Move the SystemTime-struct into class. So that every instance of the \ control becomes his own set of values. ! Comment: ! ! wYear ! The year (1601 - 30827). ! ! wMonth ! The month. ! ! January = 1 ! February = 2 ! March = 3 ! April = 4 ! May = 5 ! June = 6 ! July = 7 ! August = 8 ! September = 9 ! October = 10 ! November = 11 ! December = 12 ! ! wDayOfWeek ! The day of the week. ! ! Sunday = 0 ! Monday = 1 ! Tuesday = 2 ! Wednesday = 3 ! Thursday = 4 ! Friday = 5 ! Saturday = 6 ! ! wDay ! The day of the month (0-31). ! wHour ! The hour (0-23). ! wMinute ! The minute (0-59). ! wSecond ! The second (0-59). ! wMilliseconds ! The millisecond (0-999). ! Comment; ! #THEN \ ------------------------------------------------------------------------ --- 64,115 ---- set-time-pointers + #then + \ TODO: Move the SystemTime-struct into class. So that every instance of the \ control becomes his own set of values. ! \ *P The MonthCalendar and TimeDatePicker controls both use the _SystemTime structure ! \ ** defined in the file ANSFILE.F , the members of which are; ! \ *Q wYear ! \ ** The year (1601 - 30827). ! \ ** ! \ ** wMonth ! \ ** The month. ! \ ** ! \ ** January = 1 ! \ ** February = 2 ! \ ** March = 3 ! \ ** April = 4 ! \ ** May = 5 ! \ ** June = 6 ! \ ** July = 7 ! \ ** August = 8 ! \ ** September = 9 ! \ ** October = 10 ! \ ** November = 11 ! \ ** December = 12 ! \ ** ! \ ** wDayOfWeek ! \ ** The day of the week. ! \ ** ! \ ** Sunday = 0 ! \ ** Monday = 1 ! \ ** Tuesday = 2 ! \ ** Wednesday = 3 ! \ ** Thursday = 4 ! \ ** Friday = 5 ! \ ** Saturday = 6 ! \ ** ! \ ** wDay ! \ ** The day of the month (0-31). ! \ ** wHour ! \ ** The hour (0-23). ! \ ** wMinute ! \ ** The minute(s) (0-59). ! \ ** wSecond ! \ ** The second(s) (0-59). ! \ ** wMilliseconds ! \ ** The millisecond(s) (0-999). \ ------------------------------------------------------------------------ *************** *** 91,95 **** \ *S MonthCalendar class \ ------------------------------------------------------------------------ ! :Class MonthCalendar <Super Control \ *G Month Calendar control. \ ** A month calendar control implements a calendar-like user interface. This --- 117,121 ---- \ *S MonthCalendar class \ ------------------------------------------------------------------------ ! :Class MonthCalendar <Super DateTimeControl \ *G Month Calendar control. \ ** A month calendar control implements a calendar-like user interface. This *************** *** 97,113 **** \ ** or selecting a date. - int style - - :M ClassInit: ( -- ) - \ *G Initialise the class. - ClassInit: super - 0 to style - ;M - - :M AddStyle: ( n -- ) - \ *G Set any additional style of the control. Must be done before the control - \ ** is created. - to style ;M - :M Start: ( Parent -- ) \ *G Create the control. --- 123,126 ---- *************** *** 124,131 **** ;M - :M WindowStyle: ( -- style ) - \ *G Get the window style of the control. Default style is: WS_BORDER. - WindowStyle: super WS_BORDER or style or ;M - :M GetDate: ( -- day month year ) \ *G Retrieves the currently selected date. --- 137,140 ---- *************** *** 150,169 **** \ *S DateTimePicker class \ ------------------------------------------------------------------------ ! :Class DateTimePicker <Super Control \ *G Date and Time Picker control - int style - - :M ClassInit: ( -- ) - \ *G Initialise the class. - ClassInit: super - 0 to style - ;M - - :M AddStyle: ( n -- ) - \ *G Set any additional style of the control. Must be done before the control - \ ** is created. - to style ;M - :M Start: ( Parent -- ) \ *G Create the control. --- 159,165 ---- \ *S DateTimePicker class \ ------------------------------------------------------------------------ ! :Class DateTimePicker <Super DateTimeControl \ *G Date and Time Picker control :M Start: ( Parent -- ) \ *G Create the control. *************** *** 173,231 **** ;M ! :M WindowStyle: ( -- style ) ! \ *G Get the window style of the control. Default style is: WS_BORDER. ! WindowStyle: super WS_BORDER or style or ;M ! ! \ *P Date and Time Picker Control Styles \ ** ! \ ** The window styles listed here are specific to date and time picker controls. \ ** ! \ ** Constants ! \ ** DTS_APPCANPARSE ! \ ** Allows the owner to parse user input and take necessary action. It enables users to edit ! \ ** within the client area of the control when they press the F2 key. The control sends ! \ ** DTN_USERSTRING notification messages when users are finished. \ ** ! \ ** DTS_LONGDATEFORMAT \ ** Displays the date in long format. The default format string for this style is ! \ ** defined by LOCALE_SLONGDATEFORMAT, which produces output like "Friday, April 19, 1996". \ ** ! \ ** DTS_RIGHTALIGN \ ** The drop-down month calendar will be right-aligned with the control instead of ! \ ** left-aligned, which is the default. \ ** ! \ ** DTS_SHOWNONE \ ** It is possible to have no date currently selected in the control. With this style, ! \ ** the control displays a check box that users can check once they have entered or selected ! \ ** a date. Until this check box is checked, the application will not be able to retrieve ! \ ** the date from the control because, in essence, the control has no date. This state can ! \ ** be set with the DTM_SETSYSTEMTIME message or queried with the DTM_GETSYSTEMTIME message. \ ** ! \ ** DTS_SHORTDATEFORMAT ! \ ** Displays the date in short format. The default format string for this style is defined ! \ ** by LOCALE_SSHORTDATE, which produces output like "4/19/96". \ ** ! \ ** DTS_SHORTDATECENTURYFORMAT \ ** Version 5.80. Similar to the DTS_SHORTDATEFORMAT style, except the year is a ! \ ** four-digit field. The default format string for this style is based on LOCALE_SSHORTDATE. ! \ ** The output looks like: "4/19/1996". \ ** ! \ ** DTS_TIMEFORMAT \ ** Displays the time. The default format string for this style is defined by ! \ ** LOCALE_STIMEFORMAT, which produces output like "5:31:42 PM". \ ** ! \ ** DTS_UPDOWN ! \ ** Places an up-down control to the right of the DTP control to modify date-time values. ! \ ** This style can be used in place of the drop-down month calendar, which is the default ! \ ** style. \ ** ! \ ** Remarks \ ** ! \ ** The DTS_XXXFORMAT styles that define the display format cannot be combined. If none of ! \ ** the format styles are suitable, use a DTM_SETFORMAT message to define a custom format. ! ! ! ! :M SetCustomFormat: ( z"format" -- ) --- 169,222 ---- ;M ! \ *P Date and Time Picker Control Styles \n \ ** ! \ ** The window styles listed here are specific to date and time picker controls. \n \ ** ! \ ** Constants \n ! \ ** DTS_APPCANPARSE \n ! \ ** Allows the owner to parse user input and take necessary action. It enables users ! \ ** to edit within the client area of the control when they press the F2 key. ! \ ** The control sends DTN_USERSTRING notification messages when users are finished. \n \ ** ! \ ** DTS_LONGDATEFORMAT \n \ ** Displays the date in long format. The default format string for this style is ! \ ** defined by LOCALE_SLONGDATEFORMAT, which produces output like "Friday, April ! \ ** 19, 1996". \n \ ** ! \ ** DTS_RIGHTALIGN \n \ ** The drop-down month calendar will be right-aligned with the control instead of ! \ ** left-aligned, which is the default. \n \ ** ! \ ** DTS_SHOWNONE \n \ ** It is possible to have no date currently selected in the control. With this style, ! \ ** the control displays a check box that users can check once they have entered or ! \ ** selected a date. Until this check box is checked, the application will not be ! \ ** able to retrieve the date from the control because, in essence, the control has ! \ ** no date. This state can be set with the DTM_SETSYSTEMTIME message or queried ! \ ** with the DTM_GETSYSTEMTIME message. \n \ ** ! \ ** DTS_SHORTDATEFORMAT \n ! \ ** Displays the date in short format. The default format string for this style is ! \ ** defined by LOCALE_SSHORTDATE, which produces output like "4/19/96". \n \ ** ! \ ** DTS_SHORTDATECENTURYFORMAT \n \ ** Version 5.80. Similar to the DTS_SHORTDATEFORMAT style, except the year is a ! \ ** four-digit field. The default format string for this style is based on ! \ ** LOCALE_SSHORTDATE. The output looks like: "4/19/1996". \n \ ** ! \ ** DTS_TIMEFORMAT \n \ ** Displays the time. The default format string for this style is defined by ! \ ** LOCALE_STIMEFORMAT, which produces output like "5:31:42 PM". \n \ ** ! \ ** DTS_UPDOWN \n ! \ ** Places an up-down control to the right of the DTP control to modify date-time ! \ ** values. This style can be used in place of the drop-down month calendar, which ! \ ** is the default style. \n \ ** ! \ ** Remarks \n \ ** ! \ ** The DTS_XXXFORMAT styles that define the display format cannot be combined. ! \ ** If none of the format styles are suitable, use a DTM_SETFORMAT message to ! \ ** define a custom format. :M SetCustomFormat: ( z"format" -- ) *************** *** 235,278 **** \ *P Format Strings ! \ ** A DTP format string consists of a series of elements that represent a particular piece of ! \ ** information and define its display format. The elements will be displayed in the order ! \ ** they appear in the format string. \ ** \ ** Date and time format elements will be replaced by the actual date and time. They are ! \ ** defined by the following groups of characters: \ ** ! \ ** Element Description ! \ ** "d" The one- or two-digit day. ! \ ** "dd" The two-digit day. Single-digit day values are preceded by a zero. ! \ ** "ddd" The three-character weekday abbreviation. ! \ ** "dddd" The full weekday name. ! \ ** "h" The one- or two-digit hour in 12-hour format. ! \ ** "hh" The two-digit hour in 12-hour format. Single-digit values are preceded by a zero. ! \ ** "H" The one- or two-digit hour in 24-hour format. ! \ ** "HH" The two-digit hour in 24-hour format. Single-digit values are preceded by a zero. ! \ ** "m" The one- or two-digit minute. ! \ ** "mm" The two-digit minute. Single-digit values are preceded by a zero. ! \ ** "M" The one- or two-digit month number. ! \ ** "MM" The two-digit month number. Single-digit values are preceded by a zero. ! \ ** "MMM" The three-character month abbreviation. ! \ ** "MMMM" The full month name. ! \ ** "t" The one-letter AM/PM abbreviation (that is, AM is displayed as "A"). ! \ ** "tt" The two-letter AM/PM abbreviation (that is, AM is displayed as "AM"). ! \ ** "yy" The last two digits of the year (that is, 1996 would be displayed as "96"). ! \ ** "yyyy" The full year (that is, 1996 would be displayed as "1996"). \ ** ! \ ** To make the information more readable, you can add body text to the format string by ! \ ** enclosing it in single quotes. Spaces and punctuation marks do not need to be quoted. \ ** ! \ ** Note Nonformat characters that are not delimited by single quotes will result in ! \ ** unpredictable display by the DTP control. \ ** \ ** For example, to display the current date with the format \ ** "'Today is: 04:22:31 Tuesday Mar 23, 1996", the format string is ! \ ** "'Today is: 'hh':'m':'s dddd MMM dd', 'yyyy". To include a single quote in your body text, ! \ ** use two consecutive single quotes. For example, "'Don''t forget' MMM dd',' yyyy" produces ! \ ** output that looks like: Don't forget Mar 23, 1996. It is not necessary to use quotes ! \ ** with the comma, so "'Don''t forget' MMM dd, yyyy" is also valid, and produces the same ! \ ** output. :M GetTime: ( -- hrs min secs ) --- 226,273 ---- \ *P Format Strings ! \ ** A DTP format string consists of a series of elements that represent a particular ! \ ** piece of information and define its display format. The elements will be displayed ! \ ** in the order they appear in the format string. \n \ ** \ ** Date and time format elements will be replaced by the actual date and time. They are ! \ ** defined by the following groups of characters: \n \ ** ! \ ** Element Description \n ! \ ** "d" The one- or two-digit day. \n ! \ ** "dd" The two-digit day. Single-digit day values are preceded by a zero. \n ! \ ** "ddd" The three-character weekday abbreviation. \n ! \ ** "dddd" The full weekday name. \n ! \ ** "h" The one- or two-digit hour in 12-hour format. \n ! \ ** "hh" The two-digit hour in 12-hour format. Single-digit values are preceded by ! \ ** a zero. \n ! \ ** "H" The one- or two-digit hour in 24-hour format. \n ! \ ** "HH" The two-digit hour in 24-hour format. Single-digit values are preceded by ! \ ** a zero. \n ! \ ** "m" The one- or two-digit minute. \n ! \ ** "mm" The two-digit minute. Single-digit values are preceded by a zero. \n ! \ ** "M" The one- or two-digit month number. \n ! \ ** "MM" The two-digit month number. Single-digit values are preceded by a zero. \n ! \ ** "MMM" The three-character month abbreviation. \n ! \ ** "MMMM" The full month name. \n ! \ ** "t" The one-letter AM/PM abbreviation (that is, AM is displayed as "A"). \n ! \ ** "tt" The two-letter AM/PM abbreviation (that is, AM is displayed as "AM"). \n ! \ ** "yy" The last two digits of the year (that is, 1996 would be displayed as "96"). \n ! \ ** "yyyy" The full year (that is, 1996 would be displayed as "1996"). \n \ ** ! \ ** To make the information more readable, you can add body text to the format string ! \ ** by enclosing it in single quotes. Spaces and punctuation marks do not need to be ! \ ** quoted. \n \ ** ! \ ** \b Note \d Nonformat characters that are not delimited by single quotes will ! \ ** result in unpredictable display by the DTP control. \n \ ** \ ** For example, to display the current date with the format \ ** "'Today is: 04:22:31 Tuesday Mar 23, 1996", the format string is ! \ ** "'Today is: 'hh':'m':'s dddd MMM dd', 'yyyy". To include a single quote in your ! \ ** body text, use two consecutive single quotes. For example, ! \ ** "'Don''t forget' MMM dd',' yyyy" produces output that looks like: \n ! \ ** Don't forget Mar 23, 1996. \n ! \ ** It is not necessary to use quotes with the comma, so ! \ ** "'Don''t forget' MMM dd, yyyy" is also valid, and produces the same output. :M GetTime: ( -- hrs min secs ) |