# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1326125040 0 # Node ID ad8181f70f318ff5a517f4eced1422e1bff042a0 # Parent 7bc189ef0cd070acba39beec124cf51293fda7a2 Add a separate class for the calendar control on OS/2. Add code to automatically size the calendar control. diff -r 7bc189ef0cd0 -r ad8181f70f31 os2/dw.c --- a/os2/dw.c Mon Jan 09 15:18:04 2012 +0000 +++ b/os2/dw.c Mon Jan 09 16:04:00 2012 +0000 @@ -67,6 +67,7 @@ char ClassName[] = "dynamicwindows"; char SplitbarClassName[] = "dwsplitbar"; char ScrollClassName[] = "dwscroll"; +char CalendarClassName[] = "dwcalendar"; char *DefaultFont = "9.WarpSans"; HAB dwhab = 0; @@ -3988,6 +3989,7 @@ rc = WinRegisterClass(dwhab, (PSZ)ClassName, _wndproc, CS_SIZEREDRAW | CS_CLIPCHILDREN, 32); rc = WinRegisterClass(dwhab, (PSZ)SplitbarClassName, _splitwndproc, 0L, 32); rc = WinRegisterClass(dwhab, (PSZ)ScrollClassName, _scrollwndproc, 0L, 32); + rc = WinRegisterClass(dwhab, (PSZ)CalendarClassName, _calendarproc, 0L, 32); /* Get the OS/2 version. */ DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_MS_COUNT,(void *)aulBuffer, 4*sizeof(ULONG)); @@ -4664,6 +4666,12 @@ if(thisheight < 18) thisheight = 18; } + /* Calendar */ + else if(strncmp(tmpbuf, CalendarClassName, strlen(CalendarClassName)+1)==0) + { + thiswidth = 200; + thisheight = 150; + } /* Bitmap/Static */ else if(strncmp(tmpbuf, "#5", 3)==0) { @@ -12066,16 +12074,15 @@ WindowData *blah = calloc(sizeof(WindowData), 1); DATETIME dt; HWND tmp = WinCreateWindow(HWND_OBJECT, - WC_STATIC, + CalendarClassName, NULL, - WS_VISIBLE | SS_TEXT, + WS_VISIBLE, 0,0,2000,1000, NULLHANDLE, HWND_TOP, id, NULL, NULL); - blah->oldproc = WinSubclassWindow(tmp, _calendarproc); WinSetWindowPtr(tmp, QWP_USER, blah); dw_window_set_font(tmp, DefaultFont); if(!DosGetDateTime(&dt))