comparison os2/dw.c @ 607:b4cb30f47a97

dw_calendar_set_date() sets the text of the dummy calendar
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 28 Sep 2006 01:42:32 +0000
parents af25ea2dc5b3
children c5e5671dec8f
comparison
equal deleted inserted replaced
606:df01183257a0 607:b4cb30f47a97
1 /*
2 /* 1 /*
3 * Dynamic Windows: 2 * Dynamic Windows:
4 * A GTK like implementation of the PM GUI 3 * A GTK like implementation of the PM GUI
5 * 4 *
6 * (C) 2000-2004 Brian Smith <dbsoft@technologist.com> 5 * (C) 2000-2004 Brian Smith <dbsoft@technologist.com>
9551 * text: The text to be display by the static text widget. 9550 * text: The text to be display by the static text widget.
9552 * id: An ID to be used with dw_window_from_id() or 0L. 9551 * id: An ID to be used with dw_window_from_id() or 0L.
9553 */ 9552 */
9554 HWND API dw_calendar_new(ULONG id) 9553 HWND API dw_calendar_new(ULONG id)
9555 { 9554 {
9556 char *text = "a calendar"; 9555 char *text = "dummy calendar";
9557 WindowData *blah = calloc(sizeof(WindowData), 1); 9556 WindowData *blah = calloc(sizeof(WindowData), 1);
9558 HWND tmp = WinCreateWindow(HWND_OBJECT, 9557 HWND tmp = WinCreateWindow(HWND_OBJECT,
9559 WC_STATIC, 9558 WC_STATIC,
9560 text, 9559 text,
9561 WS_VISIBLE | SS_TEXT, 9560 WS_VISIBLE | SS_TEXT,
9567 NULL); 9566 NULL);
9568 blah->oldproc = WinSubclassWindow(tmp, _textproc); 9567 blah->oldproc = WinSubclassWindow(tmp, _textproc);
9569 WinSetWindowPtr(tmp, QWP_USER, blah); 9568 WinSetWindowPtr(tmp, QWP_USER, blah);
9570 dw_window_set_font(tmp, DefaultFont); 9569 dw_window_set_font(tmp, DefaultFont);
9571 dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY); 9570 dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
9571 WinSetWindowText(tmp, text);
9572 return tmp; 9572 return tmp;
9573 } 9573 }
9574 9574
9575 void API dw_calendar_set_date( HWND window, int year, int month, int day ) 9575 void API dw_calendar_set_date( HWND window, int year, int month, int day )
9576 { 9576 {
9577 char tmp[30];
9578 sprintf( tmp, "%4.4d-%2.2d-%2.2d", year, month, day);
9579 WinSetWindowText(window, tmp);
9577 } 9580 }
9578 void API dw_calendar_get_date( HWND window, int *year, int *month, int *day ) 9581 void API dw_calendar_get_date( HWND window, int *year, int *month, int *day )
9579 { 9582 {
9580 *year = *month = *day = 0; 9583 *year = *month = *day = 0;
9581 } 9584 }