Release 941017
[wine/gsoc-2012-control.git] / controls / widgets.c
blob42804768205547cefadd50f85eceafea187e7551
1 /*
2 * Windows widgets (built-in window classes)
4 * Copyright 1993 Alexandre Julliard
5 */
7 static char Copyright[] = "Copyright Alexandre Julliard, 1993";
9 #include "win.h"
10 #include "button.h"
11 #include "static.h"
12 #include "desktop.h"
13 #include "mdi.h"
14 #include "gdi.h"
16 LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam );
17 LONG ListBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
18 LONG ComboBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
19 LONG EditWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam );
20 LONG PopupMenuWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
21 LONG DesktopWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
22 LONG MDIClientWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
25 static WNDCLASS WIDGETS_BuiltinClasses[] =
27 { CS_GLOBALCLASS | CS_PARENTDC, ButtonWndProc, 0, sizeof(BUTTONINFO),
28 0, 0, 0, 0, NULL, "BUTTON" },
29 { CS_GLOBALCLASS | CS_PARENTDC, StaticWndProc, 0, sizeof(STATICINFO),
30 0, 0, 0, 0, NULL, "STATIC" },
31 { CS_GLOBALCLASS | CS_PARENTDC, ScrollBarWndProc, 0, 8,
32 0, 0, 0, 0, NULL, "SCROLLBAR" },
33 { CS_GLOBALCLASS | CS_PARENTDC, ListBoxWndProc, 0, 8,
34 0, 0, 0, 0, NULL, "LISTBOX" },
35 { CS_GLOBALCLASS | CS_PARENTDC, ComboBoxWndProc, 0, 8,
36 0, 0, 0, 0, NULL, "COMBOBOX" },
37 { CS_GLOBALCLASS | CS_PARENTDC, EditWndProc, 0, 4,
38 0, 0, 0, 0, NULL, "EDIT" },
39 { CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc, 0, 8,
40 0, 0, 0, 0, NULL, POPUPMENU_CLASS_NAME },
41 { CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOPINFO),
42 0, 0, 0, 0, NULL, DESKTOP_CLASS_NAME },
43 { CS_GLOBALCLASS | CS_SAVEBITS, DefDlgProc, 0, DLGWINDOWEXTRA,
44 0, 0, 0, 0, NULL, DIALOG_CLASS_NAME },
45 { CS_GLOBALCLASS, MDIClientWndProc, 0, sizeof(MDICLIENTINFO),
46 0, 0, 0, STOCK_LTGRAY_BRUSH, NULL, "MDICLIENT" }
49 #define NB_BUILTIN_CLASSES \
50 (sizeof(WIDGETS_BuiltinClasses)/sizeof(WIDGETS_BuiltinClasses[0]))
53 /***********************************************************************
54 * WIDGETS_Init
56 * Initialize the built-in window classes.
58 BOOL WIDGETS_Init(void)
60 int i;
61 WNDCLASS *class = WIDGETS_BuiltinClasses;
63 for (i = 0; i < NB_BUILTIN_CLASSES; i++, class++)
65 class->hCursor = LoadCursor( 0, IDC_ARROW );
66 if (!RegisterClass( class )) return FALSE;
68 return TRUE;