\ File: MonthCal.f \ Author: Jeff Kelm \ Created: 23-Apr-1999 \ Updated: 22-May-1999 \ Generic MonthCal control class Comment: Revision History (most recent first) 19990522 - use stack frame for GetMinReqSize: method instead of HERE 19990520 - Changed InitCommonControlsEx to use 'stack frame' instead of CREATE'd structure. - Changed example to create an application window to hold the control. 19990423 - Created Comment; NEEDS BasicWin.f CR .( Loading MonthCal class...) 0x0008 CONSTANT MCS_NOTODAYCIRCLE \ CREATE lpInitCommonControlsEx \ 8 , ( size of this structure) \ ICC_DATE_CLASSES , ICC_DATE_CLASSES 8 sp@ rel>abs Call InitCommonControlsEx ?WinError 2DROP :Class MonthCal abs 0 MCM_GETMINREQRECT SendMessage: self ?WinError ( h w 0 0) 2DROP SWAP ;M ;Class Comment: ------------------------------------------------------ \ Example of usage. Creates a calendar window. NEEDS ApplWin.f ApplicationWindow wnd Create: wnd \ keep out of taskbar and ALT-TAB list WS_EX_TOOLWINDOW +ExStyle: wnd Z" Month at a Glance" SetText: wnd 184 177 SetSize: wnd ( client size = DesktopCal size) MonthCal DesktopCal GetHandle: wnd Create: DesktopCal 0 0 SetPosition: DesktopCal GetMinReqSize: DesktopCal SetSize: DesktopCal MCS_NOTODAYCIRCLE +Style: DesktopCal \ position at bottom right of screen 4 sframe rel>abs Call GetDesktopWindow Call GetWindowRect ?WinError 2DROP SWAP ( Width Hight) 28 - GetSize: wnd ROT SWAP - ROT ROT - SWAP SetPosition: wnd Show: wnd To see a Y2K bug, set the date to 2/29/2000 (click on month name and year to change these quickly). So far so good (yes, 2000 *is* a leap year). Now change the year (click on the year). The year prints out garbage for all but leap years! This doesn't happen if you have selected days other than the 29th. This was found on Win98 (Platform: Windows 98 Version: 4.10 Build: 16384). M$ may have fixed this in their latest service pack. Don't know about WinNT yet. ------------------------------------------------------ Comment;