Release 950522
[wine.git] / controls / widgets.c
blobf816c769844597b61cbee6964617fb30e6f9abf7
1 /*
2 * Windows widgets (built-in window classes)
4 * Copyright 1993 Alexandre Julliard
5 */
7 #include "win.h"
8 #include "button.h"
9 #include "static.h"
10 #include "scroll.h"
11 #include "desktop.h"
12 #include "mdi.h"
13 #include "gdi.h"
14 #include "user.h"
15 #include "selectors.h"
16 #include "stackframe.h"
19 static WNDCLASS WIDGETS_BuiltinClasses[] =
21 { CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"ButtonWndProc", 0,
22 sizeof(BUTTONINFO), 0, 0, 0, 0, NULL, "BUTTON" },
23 { CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"StaticWndProc", 0,
24 sizeof(STATICINFO), 0, 0, 0, 0, NULL, "STATIC" },
25 { CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"ScrollBarWndProc", 0,
26 sizeof(SCROLLINFO), 0, 0, 0, 0, NULL, "SCROLLBAR" },
27 { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, (WNDPROC)"ListBoxWndProc", 0,
28 8, 0, 0, 0, 0, NULL, "LISTBOX" },
29 { CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"ComboBoxWndProc", 0,
30 8, 0, 0, 0, 0, NULL, "COMBOBOX" },
31 { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, (WNDPROC)"ComboLBoxWndProc", 0,
32 8, 0, 0, 0, 0, NULL, "COMBOLBOX" },
33 { CS_GLOBALCLASS, (WNDPROC)"EditWndProc", 0,
34 sizeof(WORD), 0, 0, 0, 0, NULL, "EDIT" },
35 { CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"PopupMenuWndProc", 0,
36 8, 0, 0, 0, 0, NULL, POPUPMENU_CLASS_NAME },
37 { CS_GLOBALCLASS, (WNDPROC)"DesktopWndProc", 0,
38 sizeof(DESKTOPINFO), 0, 0, 0, 0, NULL, DESKTOP_CLASS_NAME },
39 { CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"DefDlgProc", 0,
40 DLGWINDOWEXTRA, 0, 0, 0, 0, NULL, DIALOG_CLASS_NAME },
41 { CS_GLOBALCLASS, (WNDPROC)"MDIClientWndProc", 0,
42 sizeof(MDICLIENTINFO), 0, 0, 0, STOCK_LTGRAY_BRUSH, NULL, "MDICLIENT" }
45 #define NB_BUILTIN_CLASSES \
46 (sizeof(WIDGETS_BuiltinClasses)/sizeof(WIDGETS_BuiltinClasses[0]))
49 /***********************************************************************
50 * WIDGETS_Init
52 * Initialize the built-in window classes.
54 BOOL WIDGETS_Init(void)
56 int i;
57 char name[20];
58 WNDCLASS *class = WIDGETS_BuiltinClasses;
60 for (i = 0; i < NB_BUILTIN_CLASSES; i++, class++)
62 strcpy( name, class->lpszClassName );
63 class->lpszClassName = (LPSTR)MAKE_SEGPTR(name);
64 class->hCursor = LoadCursor( 0, IDC_ARROW );
65 class->lpfnWndProc = GetWndProcEntry16( (char *)class->lpfnWndProc );
66 if (!RegisterClass( class )) return FALSE;
68 return TRUE;