Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

controls.cpp

Go to the documentation of this file.
00001 /* $Id: controls.cpp,v 1.10 2000/02/16 14:34:08 sandervl Exp $ */
00002 /* File: controls.cpp -- Win32 common controls
00003  *
00004  * Copyright (c) 1999 Christoph Bratschi
00005  *
00006  */
00007 
00008 #include <os2win.h>
00009 #include <string.h>
00010 #include "misc.h"
00011 
00012 #include "button.h"
00013 #include "static.h"
00014 #include "scroll.h"
00015 #include "combo.h" //listbox,combo,edit
00016 #include "win32wmdiclient.h"
00017 #include "win32dlg.h"
00018 #include "win32wdesktop.h"
00019 #include "winswitch.h"
00020 #include "icontitle.h"
00021 #include "menu.h"
00022 #include "controls.h"
00023 
00024 #define DBG_LOCALLOG    DBG_controls
00025 #include "dbglocal.h"
00026 
00027 ATOM  controlAtoms[MAX_CONTROLS] = {0};
00028 
00029 /* registration */
00030 
00031 void CONTROLS_Register()
00032 {
00033   dprintf(("Register DESKTOP class"));
00034   controlAtoms[DESKTOP_CONTROL] = DESKTOP_Register();
00035   if (!controlAtoms[DESKTOP_CONTROL]) dprintf(("failed!!!"));
00036 
00037   //SvL: Create Desktop Window
00038   CreateWin32Desktop();
00039 
00040   dprintf(("Register BUTTON class"));
00041   controlAtoms[BUTTON_CONTROL] = BUTTON_Register();
00042   if (!controlAtoms[BUTTON_CONTROL]) dprintf(("failed!!!"));
00043 
00044   dprintf(("Register STATIC class"));
00045   controlAtoms[STATIC_CONTROL] = STATIC_Register();
00046   if (!controlAtoms[STATIC_CONTROL]) dprintf(("failed!!!"));
00047 
00048   dprintf(("Register SCROLLBAR class"));
00049   controlAtoms[SCROLLBAR_CONTROL] = SCROLLBAR_Register();
00050   if (!controlAtoms[SCROLLBAR_CONTROL]) dprintf(("failed!!!"));
00051 
00052   dprintf(("Register LISTBOX class"));
00053   controlAtoms[LISTBOX_CONTROL] = LISTBOX_Register();
00054   if (!controlAtoms[LISTBOX_CONTROL]) dprintf(("failed!!!"));
00055 
00056   dprintf(("Register COMBOLBOX class"));
00057   controlAtoms[COMBOLBOX_CONTROL] = COMBOLBOX_Register();
00058   if (!controlAtoms[COMBOLBOX_CONTROL]) dprintf(("failed!!!"));
00059 
00060   dprintf(("Register COMBOBOX class"));
00061   controlAtoms[COMBOBOX_CONTROL] = COMBOBOX_Register();
00062   if (!controlAtoms[COMBOBOX_CONTROL]) dprintf(("failed!!!"));
00063 
00064   dprintf(("Register EDIT class"));
00065   controlAtoms[EDIT_CONTROL] = EDIT_Register();
00066   if (!controlAtoms[EDIT_CONTROL]) dprintf(("failed!!!"));
00067 
00068   dprintf(("Register MDICLIENT class"));
00069   controlAtoms[MDICLIENT_CONTROL] = MDICLIENT_Register();
00070   if (!controlAtoms[MDICLIENT_CONTROL]) dprintf(("failed!!!"));
00071 
00072   dprintf(("Register DIALOG class"));
00073   controlAtoms[DIALOG_CONTROL] = DIALOG_Register();
00074   if (!controlAtoms[DIALOG_CONTROL]) dprintf(("failed!!!"));
00075 
00076   dprintf(("Register WINSWITCH class"));
00077   controlAtoms[WINSWITCH_CONTROL] = WINSWITCH_Register();
00078   if (!controlAtoms[WINSWITCH_CONTROL]) dprintf(("failed!!!"));
00079 
00080   dprintf(("Register ICONTITLE class"));
00081   controlAtoms[ICONTITLE_CONTROL] = ICONTITLE_Register();
00082   if (!controlAtoms[ICONTITLE_CONTROL]) dprintf(("failed!!!"));
00083 
00084   dprintf(("Register POPUPMENU class"));
00085   controlAtoms[POPUPMENU_CONTROL] = POPUPMENU_Register();
00086   if (!controlAtoms[POPUPMENU_CONTROL]) dprintf(("failed!!!"));
00087 }
00088 
00089 void CONTROLS_Unregister()
00090 {
00091   dprintf(("Unregister BUTTON class"));
00092   if (!BUTTON_Unregister()) dprintf(("failed!!!"));
00093 
00094   dprintf(("Unregister STATIC class"));
00095   if (!STATIC_Unregister()) dprintf(("failed!!!"));
00096 
00097   dprintf(("Unregister SCROLLBAR class"));
00098   if (!SCROLLBAR_Unregister()) dprintf(("failed!!!"));
00099 
00100   dprintf(("Unregister LISTBOX class"));
00101   if (!LISTBOX_Unregister()) dprintf(("failed!!!"));
00102 
00103   dprintf(("Unregister COMBOLBOX class"));
00104   if (!COMBOLBOX_Unregister()) dprintf(("failed!!!"));
00105 
00106   dprintf(("Unregister COMBOBOX class"));
00107   if (!COMBOBOX_Unregister()) dprintf(("failed!!!"));
00108 
00109   dprintf(("Unregister EDIT class"));
00110   if (!EDIT_Unregister()) dprintf(("failed!!!"));
00111 
00112   dprintf(("Unregister MDICLIENT class"));
00113   if (!MDICLIENT_Unregister()) dprintf(("failed!!!"));
00114 
00115   dprintf(("Unregister DIALOG class"));
00116   if (!DIALOG_Unregister()) dprintf(("failed!!!"));
00117 
00118   dprintf(("Unregister DESKTOP class"));
00119   if (!DESKTOP_Unregister()) dprintf(("failed!!!"));
00120 
00121   dprintf(("Unregister WINSWITCH class"));
00122   if (!WINSWITCH_Unregister()) dprintf(("failed!!!"));
00123 
00124   dprintf(("Unregister ICONTITLE class"));
00125   if (!ICONTITLE_Unregister()) dprintf(("failed!!!"));
00126 
00127   dprintf(("Unregister POPUPMENU class"));
00128   if (!POPUPMENU_Unregister()) dprintf(("failed!!!"));
00129 
00130 }
00131 
00132 
00133 BOOL CONTROLS_IsControl(Win32BaseWindow *window, int control)
00134 {
00135   if(control >= MAX_CONTROLS || window == NULL || window->getClass() == NULL)
00136         return FALSE;
00137 
00138   return controlAtoms[control] == window->getClass()->getAtom();
00139 }
00140 

Generated on Wed Jan 23 23:17:27 2002 for ODIN-user32 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001