changeset 1534:ad8181f70f31

Add a separate class for the calendar control on OS/2. Add code to automatically size the calendar control.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 09 Jan 2012 16:04:00 +0000
parents 7bc189ef0cd0
children 2913bb58f439
files os2/dw.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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))