1 | /* $Id: win32wmdiclient.cpp,v 1.39 2001-09-19 15:39:51 sandervl Exp $ */
|
---|
2 | /*
|
---|
3 | * Win32 MDI Client Window Class for OS/2
|
---|
4 | *
|
---|
5 | * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
6 | * Copyright 1999 Daniela Engert (dani@ngrt.de)
|
---|
7 | *
|
---|
8 | * Parts based on Wine (windows\mdi.c)
|
---|
9 | *
|
---|
10 | * Copyright 1994, Bob Amstadt
|
---|
11 | * 1995,1996 Alex Korobka
|
---|
12 | *
|
---|
13 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
14 | *
|
---|
15 | */
|
---|
16 | #include <os2win.h>
|
---|
17 | #include <win.h>
|
---|
18 | #include <stdlib.h>
|
---|
19 | #include <math.h>
|
---|
20 | #include <string.h>
|
---|
21 | #include <stdarg.h>
|
---|
22 | #include <assert.h>
|
---|
23 | #include <misc.h>
|
---|
24 | #include <heapstring.h>
|
---|
25 | #include <win32wnd.h>
|
---|
26 | #include <win32wmdiclient.h>
|
---|
27 | #include <spy.h>
|
---|
28 | #include "wndmsg.h"
|
---|
29 | #include <oslibwin.h>
|
---|
30 | #include <oslibutil.h>
|
---|
31 | #include <oslibgdi.h>
|
---|
32 | #include <oslibres.h>
|
---|
33 | #include "oslibdos.h"
|
---|
34 | #include "syscolor.h"
|
---|
35 | #include "win32wndhandle.h"
|
---|
36 |
|
---|
37 | #define DBG_LOCALLOG DBG_win32wmdiclient
|
---|
38 | #include "dbglocal.h"
|
---|
39 |
|
---|
40 |
|
---|
41 | //******************************************************************************
|
---|
42 | //******************************************************************************
|
---|
43 | Win32MDIClientWindow::Win32MDIClientWindow(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode)
|
---|
44 | : Win32BaseWindow()
|
---|
45 | {
|
---|
46 | Init();
|
---|
47 | this->isUnicode = isUnicode;
|
---|
48 | memset(&mdiClientInfo, 0, sizeof(mdiClientInfo));
|
---|
49 | cbExtra = sizeof(mdiClientInfo);
|
---|
50 | pExtra = (PVOID)&mdiClientInfo;
|
---|
51 | CreateWindowExA(lpCreateStructA, classAtom);
|
---|
52 | }
|
---|
53 | //******************************************************************************
|
---|
54 | //******************************************************************************
|
---|
55 | Win32MDIClientWindow::~Win32MDIClientWindow()
|
---|
56 | {
|
---|
57 | }
|
---|
58 | //******************************************************************************
|
---|
59 | //******************************************************************************
|
---|
60 | BOOL Win32MDIClientWindow::isMDIClient()
|
---|
61 | {
|
---|
62 | return TRUE;
|
---|
63 | }
|
---|
64 |
|
---|
65 | /*************************************************************************
|
---|
66 | * SCROLL_SetNCSbState
|
---|
67 | *
|
---|
68 | * Updates both scrollbars at the same time. Used by MDI CalcChildScroll().
|
---|
69 | */
|
---|
70 | INT SCROLL_SetNCSbState(HWND hwnd, int vMin, int vMax, int vPos,
|
---|
71 | int hMin, int hMax, int hPos)
|
---|
72 | {
|
---|
73 | SCROLLINFO vInfo, hInfo;
|
---|
74 |
|
---|
75 | vInfo.cbSize = hInfo.cbSize = sizeof(SCROLLINFO);
|
---|
76 | vInfo.nMin = vMin;
|
---|
77 | vInfo.nMax = vMax;
|
---|
78 | vInfo.nPos = vPos;
|
---|
79 | hInfo.nMin = hMin;
|
---|
80 | hInfo.nMax = hMax;
|
---|
81 | hInfo.nPos = hPos;
|
---|
82 | vInfo.fMask = hInfo.fMask = SIF_RANGE | SIF_POS;
|
---|
83 |
|
---|
84 | SetScrollInfo(hwnd,SB_VERT,&vInfo,TRUE);
|
---|
85 | SetScrollInfo(hwnd,SB_HORZ,&hInfo,TRUE);
|
---|
86 | return 0;
|
---|
87 | }
|
---|
88 |
|
---|
89 |
|
---|
90 | /*****************************************************************************
|
---|
91 | * Name : BOOL WIN32API CascadeChildWindows
|
---|
92 | * Purpose : Unknown
|
---|
93 | * Parameters: Unknown
|
---|
94 | * Variables :
|
---|
95 | * Result :
|
---|
96 | * Remark :
|
---|
97 | * Status : UNTESTED UNKNOWN STUB
|
---|
98 | *
|
---|
99 | * Author : Patrick Haller [Wed, 1998/06/16 11:55]
|
---|
100 | *****************************************************************************/
|
---|
101 | BOOL WIN32API CascadeChildWindows(DWORD x1,
|
---|
102 | DWORD x2)
|
---|
103 | {
|
---|
104 | dprintf(("USER32: CascadeChildWindows(%08xh,%08xh) not implemented.\n",
|
---|
105 | x1,
|
---|
106 | x2));
|
---|
107 |
|
---|
108 | return (FALSE); /* default */
|
---|
109 | }
|
---|
110 |
|
---|
111 | /*****************************************************************************
|
---|
112 | * Name : BOOL WIN32API TileChildWindows
|
---|
113 | * Purpose : Unknown
|
---|
114 | * Parameters: Unknown
|
---|
115 | * Variables :
|
---|
116 | * Result :
|
---|
117 | * Remark :
|
---|
118 | * Status : UNTESTED UNKNOWN STUB
|
---|
119 | *
|
---|
120 | * Author : Patrick Haller [Wed, 1998/06/16 11:55]
|
---|
121 | *****************************************************************************/
|
---|
122 | BOOL WIN32API TileChildWindows(DWORD x1,
|
---|
123 | DWORD x2)
|
---|
124 | {
|
---|
125 | dprintf(("USER32: TileChildWindows(%08xh,%08xh) not implemented.\n",
|
---|
126 | x1,
|
---|
127 | x2));
|
---|
128 |
|
---|
129 | return (FALSE); /* default */
|
---|
130 | }
|
---|
131 |
|
---|
132 | //******************************************************************************
|
---|
133 | //******************************************************************************
|
---|
134 | BOOL MDICLIENT_Register()
|
---|
135 | {
|
---|
136 | WNDCLASSA wndClass;
|
---|
137 |
|
---|
138 | //SvL: Don't check this now
|
---|
139 | // if (GlobalFindAtomA(MDICLIENTCLASSNAMEA)) return FALSE;
|
---|
140 |
|
---|
141 | ZeroMemory(&wndClass,sizeof(WNDCLASSA));
|
---|
142 | wndClass.style = CS_GLOBALCLASS;
|
---|
143 | wndClass.lpfnWndProc = (WNDPROC)MDIClientWndProcA;
|
---|
144 | wndClass.cbClsExtra = 0;
|
---|
145 | wndClass.cbWndExtra = 0;
|
---|
146 | wndClass.hCursor = LoadCursorA(0,IDC_ARROWA);;
|
---|
147 | wndClass.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
|
---|
148 | wndClass.lpszClassName = MDICLIENTCLASSNAMEA;
|
---|
149 |
|
---|
150 | return RegisterClassA(&wndClass);
|
---|
151 | }
|
---|
152 | //******************************************************************************
|
---|
153 | //******************************************************************************
|
---|
154 | BOOL MDICLIENT_Unregister()
|
---|
155 | {
|
---|
156 | if (GlobalFindAtomA(MDICLIENTCLASSNAMEA))
|
---|
157 | return UnregisterClassA(MDICLIENTCLASSNAMEA,(HINSTANCE)NULL);
|
---|
158 | else return FALSE;
|
---|
159 | }
|
---|
160 | //******************************************************************************
|
---|
161 | //******************************************************************************
|
---|