Line | |
---|
1 | /* $Id: win32wndchild.h,v 1.7 2004-04-20 10:11:44 sandervl Exp $ */
|
---|
2 | /*
|
---|
3 | * Win32 Child/Parent window class for OS/2
|
---|
4 | *
|
---|
5 | *
|
---|
6 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
7 | *
|
---|
8 | *
|
---|
9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
10 | *
|
---|
11 | */
|
---|
12 | #ifndef __WIN32WNDCHILD_H__
|
---|
13 | #define __WIN32WNDCHILD_H__
|
---|
14 |
|
---|
15 | #ifdef OS2_INCLUDED
|
---|
16 | #include <win32api.h>
|
---|
17 | #endif
|
---|
18 | #include <VMutex.h>
|
---|
19 |
|
---|
20 | #ifdef __cplusplus
|
---|
21 |
|
---|
22 | class ChildWindow
|
---|
23 | {
|
---|
24 | public:
|
---|
25 | ChildWindow(VMutex *pLock);
|
---|
26 | virtual ~ChildWindow();
|
---|
27 |
|
---|
28 | ChildWindow *getFirstChild() { return children; };
|
---|
29 | ChildWindow *getNextChild() { return nextchild; };
|
---|
30 |
|
---|
31 | protected:
|
---|
32 |
|
---|
33 | ChildWindow *getParentOfChild() { return parent; };
|
---|
34 | ChildWindow *setParentOfChild(ChildWindow *newParent)
|
---|
35 | {
|
---|
36 | ChildWindow *oldparent = parent;
|
---|
37 |
|
---|
38 | parent = newParent;
|
---|
39 | return oldparent;
|
---|
40 | }
|
---|
41 |
|
---|
42 | BOOL addChild(ChildWindow *child);
|
---|
43 | BOOL removeChild(ChildWindow *child);
|
---|
44 |
|
---|
45 | void setNextChild(ChildWindow *child) { nextchild = child; };
|
---|
46 |
|
---|
47 | BOOL destroyChildren();
|
---|
48 |
|
---|
49 | private:
|
---|
50 | void Lock() { pLockChild->enter(); };
|
---|
51 | void Unlock() { pLockChild->leave(); };
|
---|
52 |
|
---|
53 | VMutex *pLockChild;
|
---|
54 |
|
---|
55 | ChildWindow *parent; //GWL_HWNDPARENT
|
---|
56 | ChildWindow *children; //linked list of children of this window
|
---|
57 | ChildWindow *nextchild; //pointer to next child of our parent window
|
---|
58 | };
|
---|
59 |
|
---|
60 |
|
---|
61 | #endif //__cplusplus
|
---|
62 |
|
---|
63 | #endif //__WIN32WNDCHILD_H__
|
---|
Note:
See
TracBrowser
for help on using the repository browser.