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

win32wndchild.h

Go to the documentation of this file.
00001 /* $Id: win32wndchild.h,v 1.6 2001/06/09 14:50:24 sandervl Exp $ */
00002 /*
00003  * Win32 Child/Parent window class for OS/2
00004  *
00005  *
00006  * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
00007  *
00008  *
00009  * Project Odin Software License can be found in LICENSE.TXT
00010  *
00011  */
00012 #ifndef __WIN32WNDCHILD_H__
00013 #define __WIN32WNDCHILD_H__
00014 
00015 #ifdef OS2_INCLUDED
00016 #include <win32api.h>
00017 #endif
00018 
00019 #ifdef __cplusplus
00020 
00021 class ChildWindow
00022 {
00023 public:
00024          ChildWindow(CRITICAL_SECTION *pLock);
00025 virtual ~ChildWindow();
00026 
00027 ChildWindow   *getFirstChild()                  { return children; };
00028 ChildWindow   *getNextChild()                   { return nextchild; };
00029 
00030 protected:
00031 
00032  ChildWindow *getParentOfChild()                { return parent; };
00033  ChildWindow *setParentOfChild(ChildWindow *newParent)
00034  {
00035   ChildWindow *oldparent = parent;
00036 
00037         parent = newParent;
00038         return oldparent;
00039  }                   
00040 
00041         BOOL   addChild(ChildWindow *child);
00042         BOOL   removeChild(ChildWindow *child);
00043 
00044         void   setNextChild(ChildWindow *child) { nextchild = child; };
00045 
00046         BOOL   destroyChildren();
00047 
00048 private:
00049          void  Lock()           { EnterCriticalSection(pLockChild); };
00050          void  Unlock()         { LeaveCriticalSection(pLockChild); };
00051  
00052    CRITICAL_SECTION *pLockChild;
00053 
00054    ChildWindow *parent;         //GWL_HWNDPARENT
00055    ChildWindow *children;       //linked list of children of this window
00056    ChildWindow *nextchild;      //pointer to next child of our parent window
00057 };
00058 
00059 
00060 #endif //__cplusplus
00061 
00062 #endif //__WIN32WNDCHILD_H__

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