source: trunk/src/user32/new/controls.cpp@ 2396

Last change on this file since 2396 was 2396, checked in by cbratschi, 26 years ago

activated menu code

File size: 4.1 KB
Line 
1/* $Id: controls.cpp,v 1.15 2000-01-10 17:18:07 cbratschi Exp $ */
2/* File: controls.cpp -- Win32 common controls
3 *
4 * Copyright (c) 1999 Christoph Bratschi
5 *
6 */
7
8#include <os2win.h>
9#include <string.h>
10#include "misc.h"
11
12#include "button.h"
13#include "static.h"
14#include "scroll.h"
15#include "combo.h" //listbox,combo,edit
16#include "win32wmdiclient.h"
17#include "win32dlg.h"
18#include "win32wdesktop.h"
19#include "winswitch.h"
20#include "icontitle.h"
21#include "menu.h"
22#include "controls.h"
23
24ATOM controlAtoms[MAX_CONTROLS] = {0};
25
26/* registration */
27
28void CONTROLS_Register()
29{
30 dprintf(("Register BUTTON class"));
31 controlAtoms[BUTTON_CONTROL] = BUTTON_Register();
32 if (!controlAtoms[BUTTON_CONTROL]) dprintf(("failed!!!"));
33
34 dprintf(("Register STATIC class"));
35 controlAtoms[STATIC_CONTROL] = STATIC_Register();
36 if (!controlAtoms[STATIC_CONTROL]) dprintf(("failed!!!"));
37
38 dprintf(("Register SCROLLBAR class"));
39 controlAtoms[SCROLLBAR_CONTROL] = SCROLLBAR_Register();
40 if (!controlAtoms[SCROLLBAR_CONTROL]) dprintf(("failed!!!"));
41
42 dprintf(("Register LISTBOX class"));
43 controlAtoms[LISTBOX_CONTROL] = LISTBOX_Register();
44 if (!controlAtoms[LISTBOX_CONTROL]) dprintf(("failed!!!"));
45
46 dprintf(("Register COMBOLBOX class"));
47 controlAtoms[COMBOLBOX_CONTROL] = COMBOLBOX_Register();
48 if (!controlAtoms[COMBOLBOX_CONTROL]) dprintf(("failed!!!"));
49
50 dprintf(("Register COMBOBOX class"));
51 controlAtoms[COMBOBOX_CONTROL] = COMBOBOX_Register();
52 if (!controlAtoms[COMBOBOX_CONTROL]) dprintf(("failed!!!"));
53
54 dprintf(("Register EDIT class"));
55 controlAtoms[EDIT_CONTROL] = EDIT_Register();
56 if (!controlAtoms[EDIT_CONTROL]) dprintf(("failed!!!"));
57
58 dprintf(("Register MDICLIENT class"));
59 controlAtoms[MDICLIENT_CONTROL] = MDICLIENT_Register();
60 if (!controlAtoms[MDICLIENT_CONTROL]) dprintf(("failed!!!"));
61
62 dprintf(("Register DIALOG class"));
63 controlAtoms[DIALOG_CONTROL] = DIALOG_Register();
64 if (!controlAtoms[DIALOG_CONTROL]) dprintf(("failed!!!"));
65
66 dprintf(("Register DESKTOP class"));
67 controlAtoms[DESKTOP_CONTROL] = DESKTOP_Register();
68 if (!controlAtoms[DESKTOP_CONTROL]) dprintf(("failed!!!"));
69
70 dprintf(("Register WINSWITCH class"));
71 controlAtoms[WINSWITCH_CONTROL] = WINSWITCH_Register();
72 if (!controlAtoms[WINSWITCH_CONTROL]) dprintf(("failed!!!"));
73
74 dprintf(("Register ICONTITLE class"));
75 controlAtoms[ICONTITLE_CONTROL] = ICONTITLE_Register();
76 if (!controlAtoms[ICONTITLE_CONTROL]) dprintf(("failed!!!"));
77
78 dprintf(("Register POPUPMENU class"));
79 controlAtoms[POPUPMENU_CONTROL] = POPUPMENU_Register();
80 if (!controlAtoms[POPUPMENU_CONTROL]) dprintf(("failed!!!"));
81}
82
83void CONTROLS_Unregister()
84{
85 dprintf(("Unregister BUTTON class"));
86 if (!BUTTON_Unregister()) dprintf(("failed!!!"));
87
88 dprintf(("Unregister STATIC class"));
89 if (!STATIC_Unregister()) dprintf(("failed!!!"));
90
91 dprintf(("Unregister SCROLLBAR class"));
92 if (!SCROLLBAR_Unregister()) dprintf(("failed!!!"));
93
94 dprintf(("Unregister LISTBOX class"));
95 if (!LISTBOX_Unregister()) dprintf(("failed!!!"));
96
97 dprintf(("Unregister COMBOLBOX class"));
98 if (!COMBOLBOX_Unregister()) dprintf(("failed!!!"));
99
100 dprintf(("Unregister COMBOBOX class"));
101 if (!COMBOBOX_Unregister()) dprintf(("failed!!!"));
102
103 dprintf(("Unregister EDIT class"));
104 if (!EDIT_Unregister()) dprintf(("failed!!!"));
105
106 dprintf(("Unregister MDICLIENT class"));
107 if (!MDICLIENT_Unregister()) dprintf(("failed!!!"));
108
109 dprintf(("Unregister DIALOG class"));
110 if (!DIALOG_Unregister()) dprintf(("failed!!!"));
111
112 dprintf(("Unregister DESKTOP class"));
113 if (!DESKTOP_Unregister()) dprintf(("failed!!!"));
114
115 dprintf(("Unregister WINSWITCH class"));
116 if (!WINSWITCH_Unregister()) dprintf(("failed!!!"));
117
118 dprintf(("Unregister ICONTITLE class"));
119 if (!ICONTITLE_Unregister()) dprintf(("failed!!!"));
120
121 dprintf(("Unregister POPUPMENU class"));
122 if (!POPUPMENU_Unregister()) dprintf(("failed!!!"));
123
124}
125
126
127BOOL CONTROLS_IsControl(Win32BaseWindow *window, int control)
128{
129 if(control >= MAX_CONTROLS || window == NULL || window->getClass() == NULL)
130 return FALSE;
131
132 return controlAtoms[control] == window->getClass()->getAtom();
133}
134
Note: See TracBrowser for help on using the repository browser.