diff os2/dw.c @ 1354:1f22addc2722

Changed the behavior of dw_html_new() to return NULL on failure like the documentation indicates... Instead of creating a text widget with an error message. This error message is now sent to the console. This allows programs to be able to gracefully handle the failure to create the HTML widget. Also updated the dwtest program to create a text widget in a similar fashion on failure. Also updated the dw_calendar_* comments to no longer be unsupported on OS/2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 18 Nov 2011 13:34:36 +0000
parents 19aa1af6855e
children 46c3bcd25b53
line wrap: on
line diff
--- a/os2/dw.c	Wed Nov 16 20:31:35 2011 +0000
+++ b/os2/dw.c	Fri Nov 18 13:34:36 2011 +0000
@@ -10733,7 +10733,8 @@
 HWND API dw_html_new(unsigned long id)
 {
    id = id;
-   return dw_box_new(DW_HORZ, 0);
+   dw_debug("HTML widget not available; OS/2 currently does not support it.");
+   return 0;
 }
 
 typedef struct _dwprint 
@@ -11471,14 +11472,12 @@
    }
 }
 
-
-
-/*
- * Create a new static text window (widget) to be packed.
- * Not available under OS/2, eCS
- * Parameters:
- *       text: The text to be display by the static text widget.
+/*
+ * Create a new calendar window (widget) to be packed.
+ * Parameters:
  *       id: An ID to be used with dw_window_from_id() or 0L.
+ * Returns:
+ *       Handle to the created calendar or NULL on error.
  */
 HWND API dw_calendar_new(ULONG id)
 {
@@ -11503,7 +11502,10 @@
 }
 
 /*
- * The following are stubs
+ * Sets the current date of a calendar.
+ * Parameters:
+ *       handle: The handle to the calendar returned by dw_calendar_new().
+ *       year, month, day: To set the calendar to display.
  */
 void API dw_calendar_set_date( HWND window, unsigned int year, unsigned int month, unsigned int day )
 {
@@ -11522,6 +11524,14 @@
     WinPostMsg(window, WM_PAINT, 0, 0);
 }
 
+/*
+ * Gets the year, month and day set in the calendar widget.
+ * Parameters:
+ *       handle: The handle to the calendar returned by dw_calendar_new().
+ *       year: Variable to store the year or NULL.
+ *       month: Variable to store the month or NULL.
+ *       day: Variable to store the day or NULL.
+ */
 void API dw_calendar_get_date( HWND window, unsigned int *year, unsigned int *month, unsigned int *day )
 {
     if(year)