|
Last change
on this file since 6340 was 5935, checked in by sandervl, 24 years ago |
|
reference count (window + class objects) rewrite
|
|
File size:
1.4 KB
|
| Line | |
|---|
| 1 | /* $Id: win32wndchild.h,v 1.6 2001-06-09 14:50:24 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 |
|
|---|
| 19 | #ifdef __cplusplus
|
|---|
| 20 |
|
|---|
| 21 | class ChildWindow
|
|---|
| 22 | {
|
|---|
| 23 | public:
|
|---|
| 24 | ChildWindow(CRITICAL_SECTION *pLock);
|
|---|
| 25 | virtual ~ChildWindow();
|
|---|
| 26 |
|
|---|
| 27 | ChildWindow *getFirstChild() { return children; };
|
|---|
| 28 | ChildWindow *getNextChild() { return nextchild; };
|
|---|
| 29 |
|
|---|
| 30 | protected:
|
|---|
| 31 |
|
|---|
| 32 | ChildWindow *getParentOfChild() { return parent; };
|
|---|
| 33 | ChildWindow *setParentOfChild(ChildWindow *newParent)
|
|---|
| 34 | {
|
|---|
| 35 | ChildWindow *oldparent = parent;
|
|---|
| 36 |
|
|---|
| 37 | parent = newParent;
|
|---|
| 38 | return oldparent;
|
|---|
| 39 | }
|
|---|
| 40 |
|
|---|
| 41 | BOOL addChild(ChildWindow *child);
|
|---|
| 42 | BOOL removeChild(ChildWindow *child);
|
|---|
| 43 |
|
|---|
| 44 | void setNextChild(ChildWindow *child) { nextchild = child; };
|
|---|
| 45 |
|
|---|
| 46 | BOOL destroyChildren();
|
|---|
| 47 |
|
|---|
| 48 | private:
|
|---|
| 49 | void Lock() { EnterCriticalSection(pLockChild); };
|
|---|
| 50 | void Unlock() { LeaveCriticalSection(pLockChild); };
|
|---|
| 51 |
|
|---|
| 52 | CRITICAL_SECTION *pLockChild;
|
|---|
| 53 |
|
|---|
| 54 | ChildWindow *parent; //GWL_HWNDPARENT
|
|---|
| 55 | ChildWindow *children; //linked list of children of this window
|
|---|
| 56 | ChildWindow *nextchild; //pointer to next child of our parent window
|
|---|
| 57 | };
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 | #endif //__cplusplus
|
|---|
| 61 |
|
|---|
| 62 | #endif //__WIN32WNDCHILD_H__
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.