comparison win/dw.c @ 1415:ddf9cfb4a074

Add unique status bar class on Windows so we can identify it when calculating control sizes.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 02 Dec 2011 10:57:58 +0000
parents 22ba64e357de
children 131bedf41332
comparison
equal deleted inserted replaced
1414:38c4484f5b90 1415:ddf9cfb4a074
3743 wc.lpszMenuName = NULL; 3743 wc.lpszMenuName = NULL;
3744 wc.lpszClassName = FRAMECLASSNAME; 3744 wc.lpszClassName = FRAMECLASSNAME;
3745 3745
3746 RegisterClass(&wc); 3746 RegisterClass(&wc);
3747 3747
3748 /* Register a status bar control */
3749 memset(&wc, 0, sizeof(WNDCLASS));
3750 wc.style = CS_DBLCLKS;
3751 wc.lpfnWndProc = (WNDPROC)_statuswndproc;
3752 wc.cbClsExtra = 0;
3753 wc.cbWndExtra = 32;
3754 wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_3DFACE);
3755 wc.hCursor = LoadCursor(NULL, IDC_ARROW);
3756 wc.lpszMenuName = NULL;
3757 wc.lpszClassName = StatusbarClassName;
3758
3759 RegisterClass(&wc);
3760
3748 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) && !defined(__MINGW32__) 3761 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) && !defined(__MINGW32__)
3749 /* Register HTML renderer class */ 3762 /* Register HTML renderer class */
3750 memset(&wc, 0, sizeof(WNDCLASS)); 3763 memset(&wc, 0, sizeof(WNDCLASS));
3751 wc.lpfnWndProc = (WNDPROC)_browserWindowProc; 3764 wc.lpfnWndProc = (WNDPROC)_browserWindowProc;
3752 wc.lpszClassName = BrowserClassName; 3765 wc.lpszClassName = BrowserClassName;
4379 { 4392 {
4380 extrawidth = 8; 4393 extrawidth = 8;
4381 extraheight = 4; 4394 extraheight = 4;
4382 } 4395 }
4383 } 4396 }
4397 else if(strnicmp(tmpbuf, StatusbarClassName, strlen(StatusbarClassName)+1) == 0)
4398 {
4399 extrawidth = 4;
4400 extraheight = 2;
4401 }
4402
4384 4403
4385 /* Set the requested sizes */ 4404 /* Set the requested sizes */
4386 if(width) 4405 if(width)
4387 *width = thiswidth + extrawidth; 4406 *width = thiswidth + extrawidth;
4388 if(height) 4407 if(height)
5529 * text: The text to be display by the static text widget. 5548 * text: The text to be display by the static text widget.
5530 * id: An ID to be used with dw_window_from_id() or 0L. 5549 * id: An ID to be used with dw_window_from_id() or 0L.
5531 */ 5550 */
5532 HWND API dw_status_text_new(char *text, ULONG id) 5551 HWND API dw_status_text_new(char *text, ULONG id)
5533 { 5552 {
5534 HWND tmp = CreateWindow(ObjectClassName, 5553 HWND tmp = CreateWindow(StatusbarClassName,
5535 text, 5554 text,
5536 BS_TEXT | WS_VISIBLE | 5555 BS_TEXT | WS_VISIBLE |
5537 WS_CHILD | WS_CLIPCHILDREN, 5556 WS_CHILD | WS_CLIPCHILDREN,
5538 0,0,0,0, 5557 0,0,0,0,
5539 DW_HWND_OBJECT, 5558 DW_HWND_OBJECT,
5540 (HMENU)id, 5559 (HMENU)id,
5541 DWInstance, 5560 DWInstance,
5542 NULL); 5561 NULL);
5543 dw_window_set_font(tmp, DefaultFont); 5562 dw_window_set_font(tmp, DefaultFont);
5544 SubclassWindow(tmp, _statuswndproc);
5545 return tmp; 5563 return tmp;
5546 } 5564 }
5547 5565
5548 /* 5566 /*
5549 * Create a new Multiline Editbox window (widget) to be packed. 5567 * Create a new Multiline Editbox window (widget) to be packed.