| 1 | /* $Id: pmframe.cpp,v 1.8 2000-01-08 16:47:47 cbratschi Exp $ */
|
|---|
| 2 | /*
|
|---|
| 3 | * Win32 Frame Managment Code for OS/2
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright 1999 by Christoph Bratschi (cbratschi@datacomm.ch)
|
|---|
| 6 | *
|
|---|
| 7 | *
|
|---|
| 8 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 9 | *
|
|---|
| 10 | */
|
|---|
| 11 |
|
|---|
| 12 | #define INCL_WIN
|
|---|
| 13 | #define INCL_GPI
|
|---|
| 14 |
|
|---|
| 15 | #include <os2.h> /* PM header file */
|
|---|
| 16 | #include <os2wrap.h>
|
|---|
| 17 | #include <stdlib.h>
|
|---|
| 18 | #include <string.h>
|
|---|
| 19 | #include "win32type.h"
|
|---|
| 20 | #include <misc.h>
|
|---|
| 21 | #include <win32wbase.h>
|
|---|
| 22 | #include "wprocess.h"
|
|---|
| 23 | #include "pmframe.h"
|
|---|
| 24 | #include "oslibutil.h"
|
|---|
| 25 | #include "oslibwin.h"
|
|---|
| 26 | #include "caret.h"
|
|---|
| 27 | #include "oslibmsg.h"
|
|---|
| 28 |
|
|---|
| 29 | #define PMFRAMELOG
|
|---|
| 30 |
|
|---|
| 31 | //******************************************************************************
|
|---|
| 32 | //******************************************************************************
|
|---|
| 33 | VOID Draw3DRect(HPS hps,RECTL rect,LONG colorBR,LONG colorTL)
|
|---|
| 34 | {
|
|---|
| 35 | POINTL point;
|
|---|
| 36 |
|
|---|
| 37 | GpiSetColor(hps,colorBR);
|
|---|
| 38 | point.x = rect.xLeft;
|
|---|
| 39 | point.y = rect.yBottom;
|
|---|
| 40 | GpiMove(hps,&point);
|
|---|
| 41 | point.x = rect.xRight-1;
|
|---|
| 42 | GpiLine(hps,&point);
|
|---|
| 43 | point.y = rect.yTop-1;
|
|---|
| 44 | GpiLine(hps,&point);
|
|---|
| 45 | GpiSetColor(hps,colorTL);
|
|---|
| 46 | point.x--;
|
|---|
| 47 | GpiMove(hps,&point);
|
|---|
| 48 | point.x = rect.xLeft;
|
|---|
| 49 | GpiLine(hps,&point);
|
|---|
| 50 | point.y = rect.yBottom+1;
|
|---|
| 51 | GpiLine(hps,&point);
|
|---|
| 52 | }
|
|---|
| 53 | //******************************************************************************
|
|---|
| 54 | //******************************************************************************
|
|---|
| 55 | inline VOID DeflateRect(RECTL *rect)
|
|---|
| 56 | {
|
|---|
| 57 | rect->xLeft++;
|
|---|
| 58 | rect->xRight--;
|
|---|
| 59 | rect->yTop--;
|
|---|
| 60 | rect->yBottom++;
|
|---|
| 61 | }
|
|---|
| 62 | //******************************************************************************
|
|---|
| 63 | //******************************************************************************
|
|---|
| 64 | VOID DrawFrame(HPS hps,RECTL *rect,Win32BaseWindow *win32wnd)
|
|---|
| 65 | {
|
|---|
| 66 | LONG clrWhite,clrBlack,clrDark,clrLight;
|
|---|
| 67 | POINTL point;
|
|---|
| 68 | DWORD dwExStyle = win32wnd->getExStyle();
|
|---|
| 69 | DWORD dwStyle = win32wnd->getStyle();
|
|---|
| 70 |
|
|---|
| 71 | //CB: todo: switch to RGB mode and use win colors
|
|---|
| 72 | clrWhite = CLR_WHITE;
|
|---|
| 73 | clrBlack = CLR_BLACK;
|
|---|
| 74 | clrLight = CLR_PALEGRAY;
|
|---|
| 75 | clrDark = CLR_DARKGRAY;
|
|---|
| 76 |
|
|---|
| 77 | if (dwExStyle & WS_EX_CLIENTEDGE_W)
|
|---|
| 78 | {
|
|---|
| 79 | Draw3DRect(hps,*rect,clrWhite,clrDark);
|
|---|
| 80 | DeflateRect(rect);
|
|---|
| 81 | Draw3DRect(hps,*rect,clrLight,clrBlack);
|
|---|
| 82 | }
|
|---|
| 83 | else if (dwExStyle & WS_EX_DLGMODALFRAME_W)
|
|---|
| 84 | {
|
|---|
| 85 | Draw3DRect(hps,*rect,clrBlack,clrLight);
|
|---|
| 86 | DeflateRect(rect);
|
|---|
| 87 | Draw3DRect(hps,*rect,clrDark,clrWhite);
|
|---|
| 88 | DeflateRect(rect);
|
|---|
| 89 | Draw3DRect(hps,*rect,clrLight,clrLight);
|
|---|
| 90 | }
|
|---|
| 91 | else if (dwExStyle & WS_EX_STATICEDGE_W)
|
|---|
| 92 | {
|
|---|
| 93 | Draw3DRect(hps,*rect,clrWhite,clrDark);
|
|---|
| 94 | }
|
|---|
| 95 | else if (dwExStyle & WS_EX_WINDOWEDGE_W);
|
|---|
| 96 | else if (dwStyle & WS_BORDER_W)
|
|---|
| 97 | {
|
|---|
| 98 | Draw3DRect(hps,*rect,clrBlack,clrBlack);
|
|---|
| 99 | }
|
|---|
| 100 |
|
|---|
| 101 | DeflateRect(rect);
|
|---|
| 102 | }
|
|---|
| 103 | //******************************************************************************
|
|---|
| 104 | //******************************************************************************
|
|---|
| 105 | BOOL CanDrawSizeBox(Win32BaseWindow *win32wnd)
|
|---|
| 106 | {
|
|---|
| 107 | return ((win32wnd->getStyle() & WS_SIZEBOX_W) && (WinQueryWindowULong(win32wnd->getOS2FrameWindowHandle(),QWL_STYLE) & FS_SIZEBORDER)
|
|---|
| 108 | && win32wnd->getVertScrollHandle() && WinQueryWindow(win32wnd->getVertScrollHandle(),QW_PARENT) == win32wnd->getOS2FrameWindowHandle()
|
|---|
| 109 | && win32wnd->getHorzScrollHandle() && WinQueryWindow(win32wnd->getHorzScrollHandle(),QW_PARENT) == win32wnd->getOS2FrameWindowHandle());
|
|---|
| 110 | }
|
|---|
| 111 | //******************************************************************************
|
|---|
| 112 | //******************************************************************************
|
|---|
| 113 | VOID GetSizeBox(Win32BaseWindow *win32wnd,RECTL *rect)
|
|---|
| 114 | {
|
|---|
| 115 | SWP swpHorz,swpVert;
|
|---|
| 116 |
|
|---|
| 117 | WinQueryWindowPos(win32wnd->getVertScrollHandle(),&swpVert);
|
|---|
| 118 | WinQueryWindowPos(win32wnd->getHorzScrollHandle(),&swpHorz);
|
|---|
| 119 | rect->xLeft = swpVert.x;
|
|---|
| 120 | rect->xRight = swpVert.x+swpVert.cx;
|
|---|
| 121 | rect->yTop = swpHorz.y+swpHorz.cy;
|
|---|
| 122 | rect->yBottom = swpHorz.y;
|
|---|
| 123 | }
|
|---|
| 124 | //******************************************************************************
|
|---|
| 125 | //******************************************************************************
|
|---|
| 126 | BOOL InSizeBox(Win32BaseWindow *win32wnd,POINTS *points)
|
|---|
| 127 | {
|
|---|
| 128 | if (CanDrawSizeBox(win32wnd))
|
|---|
| 129 | {
|
|---|
| 130 | RECTL rect;
|
|---|
| 131 | POINTL point;
|
|---|
| 132 |
|
|---|
| 133 | point.x = points->x;
|
|---|
| 134 | point.y = points->y;
|
|---|
| 135 | GetSizeBox(win32wnd,&rect);
|
|---|
| 136 | return (WinPtInRect(GetThreadHAB(),&rect,&point));
|
|---|
| 137 | }
|
|---|
| 138 |
|
|---|
| 139 | return FALSE;
|
|---|
| 140 | }
|
|---|
| 141 | //******************************************************************************
|
|---|
| 142 | //******************************************************************************
|
|---|
| 143 | VOID DrawSizeBox(HPS hps,RECTL rect)
|
|---|
| 144 | {
|
|---|
| 145 | POINTL p1,p2;
|
|---|
| 146 | LONG clrDark = CLR_DARKGRAY,clrWhite = CLR_WHITE;
|
|---|
| 147 | INT x;
|
|---|
| 148 |
|
|---|
| 149 | //CB: todo: switch to RGB mode and use win colors
|
|---|
| 150 | WinFillRect(hps,&rect,SYSCLR_DIALOGBACKGROUND);
|
|---|
| 151 | p1.x = rect.xRight-2;
|
|---|
| 152 | p1.y = rect.yBottom;
|
|---|
| 153 | p2.x = rect.xRight-1;
|
|---|
| 154 | p2.y = rect.yBottom+1;
|
|---|
| 155 | for (x = 0;x < 3;x++)
|
|---|
| 156 | {
|
|---|
| 157 | GpiSetColor(hps,clrDark);
|
|---|
| 158 | GpiMove(hps,&p1);
|
|---|
| 159 | GpiLine(hps,&p2);
|
|---|
| 160 | p1.x--;
|
|---|
| 161 | p2.y++;
|
|---|
| 162 | GpiMove(hps,&p1);
|
|---|
| 163 | GpiLine(hps,&p2);
|
|---|
| 164 | GpiSetColor(hps,clrWhite);
|
|---|
| 165 | p1.x--;
|
|---|
| 166 | p2.y++;
|
|---|
| 167 | GpiMove(hps,&p1);
|
|---|
| 168 | GpiLine(hps,&p2);
|
|---|
| 169 | p1.x -= 2;
|
|---|
| 170 | p2.y += 2;
|
|---|
| 171 | }
|
|---|
| 172 | }
|
|---|
| 173 | //******************************************************************************
|
|---|
| 174 | //******************************************************************************
|
|---|
| 175 | void DrawActivate(Win32BaseWindow *win32wnd, HWND hwnd)
|
|---|
| 176 | {
|
|---|
| 177 | if (!win32wnd->isChild())
|
|---|
| 178 | {
|
|---|
| 179 | if (CanDrawSizeBox(win32wnd))
|
|---|
| 180 | {
|
|---|
| 181 | HPS hps;
|
|---|
| 182 | RECTL rect;
|
|---|
| 183 |
|
|---|
| 184 | GetSizeBox(win32wnd,&rect);
|
|---|
| 185 | hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN | PSF_CLIPSIBLINGS);
|
|---|
| 186 | DrawSizeBox(hps,rect);
|
|---|
| 187 | WinReleasePS(hps);
|
|---|
| 188 |
|
|---|
| 189 | }
|
|---|
| 190 | }
|
|---|
| 191 | else
|
|---|
| 192 | {
|
|---|
| 193 | HPS hps;
|
|---|
| 194 | RECTL rect;
|
|---|
| 195 |
|
|---|
| 196 | WinQueryWindowRect(hwnd,&rect);
|
|---|
| 197 | rect.xRight = rect.xRight-rect.xLeft;
|
|---|
| 198 | rect.yTop = rect.yTop-rect.yBottom;
|
|---|
| 199 | rect.xLeft = rect.yBottom = 0;
|
|---|
| 200 | hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN | PSF_CLIPSIBLINGS);
|
|---|
| 201 | DrawFrame(hps,&rect,win32wnd);
|
|---|
| 202 | WinReleasePS(hps);
|
|---|
| 203 | }
|
|---|
| 204 | }
|
|---|
| 205 | //******************************************************************************
|
|---|
| 206 | //******************************************************************************
|
|---|
| 207 | VOID FrameTrackFrame(Win32BaseWindow *win32wnd,DWORD flags)
|
|---|
| 208 | {
|
|---|
| 209 | WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_TRACKFRAME,(MPARAM)flags,(MPARAM)0);
|
|---|
| 210 | }
|
|---|
| 211 | //******************************************************************************
|
|---|
| 212 | //******************************************************************************
|
|---|
| 213 | VOID FrameUpdateChildPositions(HWND hwnd)
|
|---|
| 214 | {
|
|---|
| 215 | HENUM henum;
|
|---|
| 216 | HWND hchild;
|
|---|
| 217 | RECTL rectl;
|
|---|
| 218 |
|
|---|
| 219 | henum = WinBeginEnumWindows(hwnd);
|
|---|
| 220 | while ((hchild = WinGetNextWindow(henum)) != NULLHANDLE)
|
|---|
| 221 | {
|
|---|
| 222 | Win32BaseWindow *child = Win32BaseWindow::GetWindowFromOS2FrameHandle(hchild);
|
|---|
| 223 |
|
|---|
| 224 | if (child)
|
|---|
| 225 | {
|
|---|
| 226 | WinQueryWindowRect(child->getOS2FrameWindowHandle(),&rectl);
|
|---|
| 227 | mapOS2ToWin32Rect(child->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,child->getWindowRect());
|
|---|
| 228 | FrameUpdateChildPositions(child->getOS2WindowHandle());
|
|---|
| 229 | }
|
|---|
| 230 | }
|
|---|
| 231 | WinEndEnumWindows(henum);
|
|---|
| 232 | }
|
|---|
| 233 | //******************************************************************************
|
|---|
| 234 | //Win32 frame message handler
|
|---|
| 235 | //******************************************************************************
|
|---|
| 236 | MRESULT EXPENTRY Win32FrameProc(HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
|
|---|
| 237 | {
|
|---|
| 238 | Win32BaseWindow *win32wnd;
|
|---|
| 239 | PFNWP OldFrameProc;
|
|---|
| 240 | MRESULT rc;
|
|---|
| 241 | THDB *thdb;
|
|---|
| 242 | MSG *pWinMsg,winMsg;
|
|---|
| 243 |
|
|---|
| 244 | SetWin32TIB();
|
|---|
| 245 |
|
|---|
| 246 | thdb = GetThreadTHDB();
|
|---|
| 247 | win32wnd = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwnd);
|
|---|
| 248 |
|
|---|
| 249 | if (!thdb || (win32wnd == NULL) || !win32wnd->getOldFrameProc())
|
|---|
| 250 | {
|
|---|
| 251 | dprintf(("Invalid win32wnd pointer for frame %x!!", hwnd));
|
|---|
| 252 | goto RunDefWndProc;
|
|---|
| 253 | }
|
|---|
| 254 |
|
|---|
| 255 | if((thdb->msgstate & 1) == 0)
|
|---|
| 256 | {//message that was sent directly to our window proc handler; translate it here
|
|---|
| 257 | QMSG qmsg;
|
|---|
| 258 |
|
|---|
| 259 | qmsg.msg = msg;
|
|---|
| 260 | qmsg.hwnd = hwnd;
|
|---|
| 261 | qmsg.mp1 = mp1;
|
|---|
| 262 | qmsg.mp2 = mp2;
|
|---|
| 263 | qmsg.time = WinQueryMsgTime(thdb->hab);
|
|---|
| 264 | WinQueryMsgPos(thdb->hab, &qmsg.ptl);
|
|---|
| 265 | qmsg.reserved = 0;
|
|---|
| 266 |
|
|---|
| 267 | if(OS2ToWinMsgTranslate((PVOID)thdb, &qmsg, &winMsg, FALSE, MSG_REMOVE) == FALSE)
|
|---|
| 268 | {//message was not translated
|
|---|
| 269 | memset(&winMsg, 0, sizeof(MSG));
|
|---|
| 270 | }
|
|---|
| 271 | pWinMsg = &winMsg;
|
|---|
| 272 | }
|
|---|
| 273 | else {
|
|---|
| 274 | pWinMsg = &thdb->msg;
|
|---|
| 275 | thdb->msgstate++;
|
|---|
| 276 | }
|
|---|
| 277 |
|
|---|
| 278 | OldFrameProc = (PFNWP)win32wnd->getOldFrameProc();
|
|---|
| 279 |
|
|---|
| 280 | switch(msg)
|
|---|
| 281 | {
|
|---|
| 282 | case WM_FORMATFRAME:
|
|---|
| 283 | {
|
|---|
| 284 | PSWP pswp = (PSWP)mp1,swpClient;
|
|---|
| 285 | RECTL *client = (PRECTL)mp2,rect;
|
|---|
| 286 | RECT winRect;
|
|---|
| 287 | INT ccount;
|
|---|
| 288 |
|
|---|
| 289 | if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc;
|
|---|
| 290 | dprintf(("PMFRAME: WM_FORMATFRAME %x",hwnd));
|
|---|
| 291 | RestoreOS2TIB();
|
|---|
| 292 | ccount = (INT)OldFrameProc(hwnd,msg,mp1,mp2);
|
|---|
| 293 | SetWin32TIB();
|
|---|
| 294 | dprintf(("Frame size: %d %d",win32wnd->getWindowWidth(),win32wnd->getWindowHeight()));
|
|---|
| 295 | win32wnd->MsgFormatFrame();
|
|---|
| 296 | //CB: todo: use result for WM_CALCVALIDRECTS
|
|---|
| 297 | mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
|
|---|
| 298 | swpClient = &pswp[ccount-1];
|
|---|
| 299 | swpClient->x = rect.xLeft;
|
|---|
| 300 | swpClient->y = rect.yBottom;
|
|---|
| 301 | swpClient->cx = rect.xRight-rect.xLeft;
|
|---|
| 302 | swpClient->cy = rect.yTop-rect.yBottom;
|
|---|
| 303 | dprintf(("New client position: x=%d y=%d w=%d h=%d",swpClient->x,swpClient->y,swpClient->cx,swpClient->cy));
|
|---|
| 304 | RestoreOS2TIB();
|
|---|
| 305 | return (MRESULT)ccount;
|
|---|
| 306 | }
|
|---|
| 307 |
|
|---|
| 308 | case WM_MINMAXFRAME:
|
|---|
| 309 | {
|
|---|
| 310 | PSWP swp = (PSWP)mp1;
|
|---|
| 311 |
|
|---|
| 312 | if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc;
|
|---|
| 313 | dprintf(("PMFRAME: WM_MINMAXFRAME %x",hwnd));
|
|---|
| 314 | if ((swp->fl & SWP_MAXIMIZE) == SWP_MAXIMIZE)
|
|---|
| 315 | {
|
|---|
| 316 | win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W);
|
|---|
| 317 | } else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE)
|
|---|
| 318 | {
|
|---|
| 319 | win32wnd->setStyle((win32wnd->getStyle() & ~WS_MAXIMIZE_W) | WS_MINIMIZE_W);
|
|---|
| 320 | } else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE)
|
|---|
| 321 | {
|
|---|
| 322 | win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MINIMIZE_W | WS_MAXIMIZE_W));
|
|---|
| 323 | }
|
|---|
| 324 | goto RunDefFrameProc;
|
|---|
| 325 | }
|
|---|
| 326 |
|
|---|
| 327 | case WM_QUERYBORDERSIZE:
|
|---|
| 328 | goto RunDefFrameProc;
|
|---|
| 329 |
|
|---|
| 330 | case WM_BUTTON1DOWN:
|
|---|
| 331 | case WM_BUTTON1UP:
|
|---|
| 332 | case WM_BUTTON1DBLCLK:
|
|---|
| 333 | case WM_BUTTON2DOWN:
|
|---|
| 334 | case WM_BUTTON2UP:
|
|---|
| 335 | case WM_BUTTON2DBLCLK:
|
|---|
| 336 | case WM_BUTTON3DOWN:
|
|---|
| 337 | case WM_BUTTON3UP:
|
|---|
| 338 | case WM_BUTTON3DBLCLK:
|
|---|
| 339 | {
|
|---|
| 340 | if (win32wnd->IsWindowCreated())
|
|---|
| 341 | {
|
|---|
| 342 | win32wnd->MsgButton(pWinMsg);
|
|---|
| 343 | RestoreOS2TIB();
|
|---|
| 344 | }
|
|---|
| 345 | return (MRESULT)TRUE;
|
|---|
| 346 | }
|
|---|
| 347 |
|
|---|
| 348 | case WM_BUTTON2MOTIONSTART:
|
|---|
| 349 | case WM_BUTTON2MOTIONEND:
|
|---|
| 350 | case WM_BUTTON2CLICK:
|
|---|
| 351 | case WM_BUTTON1MOTIONSTART:
|
|---|
| 352 | case WM_BUTTON1MOTIONEND:
|
|---|
| 353 | case WM_BUTTON1CLICK:
|
|---|
| 354 | case WM_BUTTON3MOTIONSTART:
|
|---|
| 355 | case WM_BUTTON3MOTIONEND:
|
|---|
| 356 | case WM_BUTTON3CLICK:
|
|---|
| 357 | RestoreOS2TIB();
|
|---|
| 358 | return (MRESULT)TRUE;
|
|---|
| 359 |
|
|---|
| 360 | case WM_MOUSEMOVE:
|
|---|
| 361 | {
|
|---|
| 362 | //OS/2 Window coordinates -> Win32 Window coordinates
|
|---|
| 363 | if (win32wnd->IsWindowCreated())
|
|---|
| 364 | win32wnd->MsgMouseMove(pWinMsg);
|
|---|
| 365 | RestoreOS2TIB();
|
|---|
| 366 | return (MRESULT)TRUE;
|
|---|
| 367 | }
|
|---|
| 368 |
|
|---|
| 369 | case WM_HITTEST:
|
|---|
| 370 | {
|
|---|
| 371 | DWORD res;
|
|---|
| 372 |
|
|---|
| 373 | // Only send this message if the window is enabled
|
|---|
| 374 | if (!win32wnd->IsWindowCreated())
|
|---|
| 375 | res = HT_NORMAL;
|
|---|
| 376 | else if (!WinIsWindowEnabled(hwnd))
|
|---|
| 377 | res = HT_ERROR;
|
|---|
| 378 | else if (win32wnd->getIgnoreHitTest())
|
|---|
| 379 | res = HT_NORMAL;
|
|---|
| 380 | else
|
|---|
| 381 | {
|
|---|
| 382 | dprintf(("PMFRAME: WM_HITTEST %x (%d,%d)",hwnd,(*(POINTS *)&mp1).x,(*(POINTS *)&mp1).y));
|
|---|
| 383 |
|
|---|
| 384 | //CB: WinWindowFromPoint: PM sends WM_HITTEST -> loop -> stack overflow
|
|---|
| 385 | win32wnd->setIgnoreHitTest(TRUE);
|
|---|
| 386 | res = win32wnd->MsgHitTest(pWinMsg);
|
|---|
| 387 | win32wnd->setIgnoreHitTest(FALSE);
|
|---|
| 388 | }
|
|---|
| 389 | RestoreOS2TIB();
|
|---|
| 390 | return (MRESULT)res;
|
|---|
| 391 | }
|
|---|
| 392 |
|
|---|
| 393 | case WM_PAINT:
|
|---|
| 394 | {
|
|---|
| 395 | dprintf(("PMFRAME: WM_PAINT"));
|
|---|
| 396 | if (win32wnd->getStyle() & WS_MINIMIZE_W)
|
|---|
| 397 | goto RunDefFrameProc;
|
|---|
| 398 | if (win32wnd->IsWindowCreated())
|
|---|
| 399 | win32wnd->MsgNCPaint();
|
|---|
| 400 | goto RunDefWndProc;
|
|---|
| 401 | }
|
|---|
| 402 |
|
|---|
| 403 | case WM_SIZE:
|
|---|
| 404 | dprintf(("PMFRAME: WM_SIZE"));
|
|---|
| 405 | goto RunDefFrameProc;
|
|---|
| 406 |
|
|---|
| 407 | case WM_ADJUSTWINDOWPOS:
|
|---|
| 408 | {
|
|---|
| 409 | PSWP pswp = (PSWP)mp1;
|
|---|
| 410 | SWP swpOld;
|
|---|
| 411 | WINDOWPOS wp;
|
|---|
| 412 | HWND hParent = NULLHANDLE, hwndAfter;
|
|---|
| 413 |
|
|---|
| 414 | dprintf(("PMFRAME: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
|
|---|
| 415 |
|
|---|
| 416 | //CB: show dialog in front of owner
|
|---|
| 417 | if (win32wnd->IsModalDialogOwner())
|
|---|
| 418 | {
|
|---|
| 419 | pswp->fl |= SWP_ZORDER;
|
|---|
| 420 | pswp->hwndInsertBehind = win32wnd->getOS2HwndModalDialog();
|
|---|
| 421 | if (pswp->fl & SWP_ACTIVATE)
|
|---|
| 422 | {
|
|---|
| 423 | pswp->fl &= ~SWP_ACTIVATE;
|
|---|
| 424 | WinSetWindowPos(win32wnd->getOS2HwndModalDialog(),0,0,0,0,0,SWP_ACTIVATE);
|
|---|
| 425 | }
|
|---|
| 426 | }
|
|---|
| 427 |
|
|---|
| 428 | if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
|
|---|
| 429 | goto RunDefFrameProc;
|
|---|
| 430 |
|
|---|
| 431 | if(!win32wnd->CanReceiveSizeMsgs())
|
|---|
| 432 | break;
|
|---|
| 433 |
|
|---|
| 434 | WinQueryWindowPos(hwnd, &swpOld);
|
|---|
| 435 | if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
|
|---|
| 436 | if (win32wnd->isChild()) {
|
|---|
| 437 | if(win32wnd->getParent()) {
|
|---|
| 438 | hParent = win32wnd->getParent()->getOS2WindowHandle();
|
|---|
| 439 | }
|
|---|
| 440 | else goto RunDefFrameProc;
|
|---|
| 441 | }
|
|---|
| 442 | }
|
|---|
| 443 | hwndAfter = pswp->hwndInsertBehind;
|
|---|
| 444 | OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd);
|
|---|
| 445 |
|
|---|
| 446 | wp.hwnd = win32wnd->getWindowHandle();
|
|---|
| 447 | if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
|
|---|
| 448 | {
|
|---|
| 449 | Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
|
|---|
| 450 | if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle();
|
|---|
| 451 | }
|
|---|
| 452 |
|
|---|
| 453 | //CB: problems with profmine titlebar tracking
|
|---|
| 454 | if(win32wnd->MsgPosChanging((LPARAM)&wp) == 0)
|
|---|
| 455 | {//app or default window handler changed wp
|
|---|
| 456 | dprintf(("PMFRAME: WM_ADJUSTWINDOWPOS, app changed windowpos struct"));
|
|---|
| 457 | dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
|
|---|
| 458 |
|
|---|
| 459 | OSLibMapWINDOWPOStoSWPFrame(&wp, pswp, &swpOld, hParent, hwnd);
|
|---|
| 460 | dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
|
|---|
| 461 | pswp->fl |= SWP_NOADJUST;
|
|---|
| 462 | pswp->hwndInsertBehind = hwndAfter;
|
|---|
| 463 | pswp->hwnd = hwnd;
|
|---|
| 464 |
|
|---|
| 465 | RestoreOS2TIB();
|
|---|
| 466 | return (MRESULT)0xf;
|
|---|
| 467 | }
|
|---|
| 468 | goto RunDefFrameProc;
|
|---|
| 469 | }
|
|---|
| 470 |
|
|---|
| 471 | case WM_WINDOWPOSCHANGED:
|
|---|
| 472 | {
|
|---|
| 473 | PSWP pswp = (PSWP)mp1;
|
|---|
| 474 | SWP swpOld = *(pswp + 1);
|
|---|
| 475 | WINDOWPOS wp;
|
|---|
| 476 | HWND hParent = NULLHANDLE;
|
|---|
| 477 |
|
|---|
| 478 | dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
|
|---|
| 479 |
|
|---|
| 480 | if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
|
|---|
| 481 | goto PosChangedEnd;
|
|---|
| 482 |
|
|---|
| 483 | if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
|
|---|
| 484 | if (win32wnd->isChild()) {
|
|---|
| 485 | if(win32wnd->getParent()) {
|
|---|
| 486 | hParent = win32wnd->getParent()->getOS2WindowHandle();
|
|---|
| 487 | }
|
|---|
| 488 | else goto PosChangedEnd; //parent has just been destroyed
|
|---|
| 489 | }
|
|---|
| 490 | }
|
|---|
| 491 | OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd);
|
|---|
| 492 |
|
|---|
| 493 | win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
|
|---|
| 494 |
|
|---|
| 495 | if(win32wnd->CanReceiveSizeMsgs())
|
|---|
| 496 | win32wnd->MsgPosChanged((LPARAM)&wp);
|
|---|
| 497 |
|
|---|
| 498 | PosChangedEnd:
|
|---|
| 499 | //update the client rect
|
|---|
| 500 | RECTL rectl;
|
|---|
| 501 |
|
|---|
| 502 | WinQueryWindowRect(win32wnd->getOS2FrameWindowHandle(),&rectl);
|
|---|
| 503 | mapOS2ToWin32Rect(win32wnd->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,win32wnd->getWindowRect());
|
|---|
| 504 | WinQueryWindowRect(win32wnd->getOS2WindowHandle(),&rectl);
|
|---|
| 505 | mapOS2ToWin32Rect(win32wnd->getOS2WindowHandle(),WinQueryWindow(hwnd,QW_PARENT),(PRECTLOS2)&rectl,win32wnd->getClientRectPtr());
|
|---|
| 506 |
|
|---|
| 507 | //calls WM_FORMATFRAME if SWP_SIZE is set
|
|---|
| 508 | RestoreOS2TIB();
|
|---|
| 509 | rc = OldFrameProc(hwnd,msg,mp1,mp2);
|
|---|
| 510 | SetWin32TIB();
|
|---|
| 511 | //update child positions: rectWindow is in window coordinates
|
|---|
| 512 | FrameUpdateChildPositions(win32wnd->getOS2WindowHandle());
|
|---|
| 513 | RestoreOS2TIB();
|
|---|
| 514 | return rc;
|
|---|
| 515 | }
|
|---|
| 516 |
|
|---|
| 517 | case WM_CALCVALIDRECTS:
|
|---|
| 518 | {
|
|---|
| 519 | PRECTL oldRect = (PRECTL)mp1,newRect = oldRect+1;
|
|---|
| 520 | UINT res = CVR_ALIGNLEFT | CVR_ALIGNTOP;
|
|---|
| 521 |
|
|---|
| 522 | //CB: todo: use WM_NCCALCSIZE result
|
|---|
| 523 | if (win32wnd->getWindowClass())
|
|---|
| 524 | {
|
|---|
| 525 | DWORD dwStyle = win32wnd->getWindowClass()->getClassLongA(GCL_STYLE_W);
|
|---|
| 526 |
|
|---|
| 527 | if ((dwStyle & CS_HREDRAW_W) && (newRect->xRight-newRect->xLeft != oldRect->xRight-oldRect->xLeft))
|
|---|
| 528 | res |= CVR_REDRAW;
|
|---|
| 529 | else if ((dwStyle & CS_VREDRAW_W) && (newRect->yTop-newRect->yBottom != oldRect->yTop-oldRect->yBottom))
|
|---|
| 530 | res |= CVR_REDRAW;
|
|---|
| 531 | } else res |= CVR_REDRAW;
|
|---|
| 532 |
|
|---|
| 533 | //CB: PM sets client window position
|
|---|
| 534 | RestoreOS2TIB();
|
|---|
| 535 | OldFrameProc(hwnd,msg,mp1,mp2);
|
|---|
| 536 | SetWin32TIB();
|
|---|
| 537 |
|
|---|
| 538 | RestoreOS2TIB();
|
|---|
| 539 | return (MRESULT)res;
|
|---|
| 540 | }
|
|---|
| 541 |
|
|---|
| 542 | case WM_ACTIVATE:
|
|---|
| 543 | {
|
|---|
| 544 | HWND hwndTitle;
|
|---|
| 545 | USHORT flags = WinQueryWindowUShort(hwnd,QWS_FLAGS);
|
|---|
| 546 |
|
|---|
| 547 | if (win32wnd->IsWindowCreated())
|
|---|
| 548 | {
|
|---|
| 549 | WinSendMsg(WinWindowFromID(hwnd,FID_CLIENT),WM_ACTIVATE,mp1,mp2);
|
|---|
| 550 | WinSetWindowUShort(hwnd,QWS_FLAGS,mp1 ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE));
|
|---|
| 551 |
|
|---|
| 552 | //CB: show owner behind the dialog
|
|---|
| 553 | if (win32wnd->IsModalDialog())
|
|---|
| 554 | {
|
|---|
| 555 | Win32BaseWindow *topOwner = win32wnd->getOwner()->GetTopParent();
|
|---|
| 556 |
|
|---|
| 557 | if (topOwner) WinSetWindowPos(topOwner->getOS2FrameWindowHandle(),hwnd,0,0,0,0,SWP_ZORDER);
|
|---|
| 558 | }
|
|---|
| 559 | } else
|
|---|
| 560 | {
|
|---|
| 561 | WinSetWindowUShort(hwnd,QWS_FLAGS,mp1 ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE));
|
|---|
| 562 | }
|
|---|
| 563 |
|
|---|
| 564 | RestoreOS2TIB();
|
|---|
| 565 | return 0;
|
|---|
| 566 | }
|
|---|
| 567 |
|
|---|
| 568 | case WM_DESTROY:
|
|---|
| 569 | dprintf(("PMFRAME: WM_DESTROY %x",hwnd));
|
|---|
| 570 | WinSubclassWindow(hwnd,OldFrameProc);
|
|---|
| 571 | win32wnd->setOldFrameProc(NULL);
|
|---|
| 572 | goto RunDefFrameProc;
|
|---|
| 573 |
|
|---|
| 574 | default:
|
|---|
| 575 | RestoreOS2TIB();
|
|---|
| 576 | return OldFrameProc(hwnd,msg,mp1,mp2);
|
|---|
| 577 | }
|
|---|
| 578 |
|
|---|
| 579 | RestoreOS2TIB();
|
|---|
| 580 | return (MRESULT)FALSE;
|
|---|
| 581 |
|
|---|
| 582 | RunDefFrameProc:
|
|---|
| 583 | RestoreOS2TIB();
|
|---|
| 584 | return OldFrameProc(hwnd,msg,mp1,mp2);
|
|---|
| 585 |
|
|---|
| 586 | RunDefWndProc:
|
|---|
| 587 | RestoreOS2TIB();
|
|---|
| 588 | return WinDefWindowProc(hwnd,msg,mp1,mp2);
|
|---|
| 589 | }
|
|---|
| 590 |
|
|---|
| 591 | PVOID FrameSubclassFrameWindow(Win32BaseWindow *win32wnd)
|
|---|
| 592 | {
|
|---|
| 593 | return WinSubclassWindow(win32wnd->getOS2FrameWindowHandle(),PFNWP(Win32FrameProc));
|
|---|
| 594 | }
|
|---|
| 595 |
|
|---|
| 596 | VOID FrameGetBorderSize(Win32BaseWindow *win32wnd,PWPOINT pSize)
|
|---|
| 597 | {
|
|---|
| 598 | WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_QUERYBORDERSIZE,(MPARAM)pSize,(MPARAM)0);
|
|---|
| 599 | }
|
|---|
| 600 |
|
|---|
| 601 | VOID FrameSetBorderSize(Win32BaseWindow *win32wnd,BOOL resize)
|
|---|
| 602 | {
|
|---|
| 603 | POINTL point;
|
|---|
| 604 |
|
|---|
| 605 | if (!resize)
|
|---|
| 606 | {
|
|---|
| 607 | WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_SETBORDERSIZE,(MPARAM)win32wnd->getBorderWidth(),(MPARAM)win32wnd->getBorderHeight());
|
|---|
| 608 |
|
|---|
| 609 | return;
|
|---|
| 610 | }
|
|---|
| 611 |
|
|---|
| 612 | FrameGetBorderSize(win32wnd,&point);
|
|---|
| 613 | WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_SETBORDERSIZE,(MPARAM)win32wnd->getBorderWidth(),(MPARAM)win32wnd->getBorderHeight());
|
|---|
| 614 | if ((point.x != win32wnd->getBorderWidth()) || (point.y != win32wnd->getBorderHeight()))
|
|---|
| 615 | {
|
|---|
| 616 | INT xDiff = win32wnd->getBorderWidth()-point.x;
|
|---|
| 617 | INT yDiff = win32wnd->getBorderHeight()-point.y;
|
|---|
| 618 | SWP swp;
|
|---|
| 619 |
|
|---|
| 620 | WinQueryWindowPos(win32wnd->getOS2FrameWindowHandle(),&swp);
|
|---|
| 621 | swp.x += xDiff;
|
|---|
| 622 | swp.y += yDiff;
|
|---|
| 623 | swp.cx -= 2*xDiff;
|
|---|
| 624 | swp.cy -= 2*yDiff;
|
|---|
| 625 | WinSetWindowPos(win32wnd->getOS2FrameWindowHandle(),0,swp.x,swp.y,swp.cx,swp.cy,SWP_MOVE | SWP_SIZE);
|
|---|
| 626 | }
|
|---|
| 627 | }
|
|---|
| 628 |
|
|---|
| 629 | UINT FrameGetDefSizeBorderSize(VOID)
|
|---|
| 630 | {
|
|---|
| 631 | return WinQuerySysValue(HWND_DESKTOP,SV_CXSIZEBORDER);
|
|---|
| 632 | }
|
|---|
| 633 |
|
|---|
| 634 | BOOL FrameCreateScrollBars(Win32BaseWindow *win32wnd,BOOL createHorz,BOOL createVert,BOOL updateFrame,DWORD *flags)
|
|---|
| 635 | {
|
|---|
| 636 | HWND hwndHScroll = 0,hwndVScroll = 0;
|
|---|
| 637 | ULONG updateFlags = 0;
|
|---|
| 638 |
|
|---|
| 639 | if (createHorz)
|
|---|
| 640 | {
|
|---|
| 641 | hwndHScroll = WinCreateWindow(win32wnd->getOS2FrameWindowHandle(),WC_SCROLLBAR,"",WS_VISIBLE | WS_PARENTCLIP | WS_SYNCPAINT | SBS_HORZ,0,0,0,0,win32wnd->getOS2FrameWindowHandle(),HWND_TOP,FID_HORZSCROLL,NULL,NULL);
|
|---|
| 642 | if (hwndHScroll) win32wnd->setHorzScrollHandle(hwndHScroll);
|
|---|
| 643 | else return FALSE;
|
|---|
| 644 | updateFlags = FCF_HORZSCROLL;
|
|---|
| 645 | }
|
|---|
| 646 |
|
|---|
| 647 | if (createVert)
|
|---|
| 648 | {
|
|---|
| 649 | hwndVScroll = WinCreateWindow(win32wnd->getOS2FrameWindowHandle(),WC_SCROLLBAR,"",WS_VISIBLE | WS_PARENTCLIP | WS_SYNCPAINT | SBS_VERT,0,0,0,0,win32wnd->getOS2FrameWindowHandle(),HWND_TOP,FID_VERTSCROLL,NULL,NULL);
|
|---|
| 650 | if (hwndVScroll) win32wnd->setVertScrollHandle(hwndVScroll); else
|
|---|
| 651 | {
|
|---|
| 652 | if (hwndHScroll) WinDestroyWindow(hwndHScroll);
|
|---|
| 653 |
|
|---|
| 654 | return FALSE;
|
|---|
| 655 | }
|
|---|
| 656 | updateFlags |= FCF_VERTSCROLL;
|
|---|
| 657 | }
|
|---|
| 658 |
|
|---|
| 659 | win32wnd->subclassScrollBars(hwndHScroll,hwndVScroll);
|
|---|
| 660 |
|
|---|
| 661 | if (updateFrame && updateFlags) WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_UPDATEFRAME,(MPARAM)0,(MPARAM)0);
|
|---|
| 662 | if (flags) *flags = updateFlags;
|
|---|
| 663 |
|
|---|
| 664 | return TRUE;
|
|---|
| 665 | }
|
|---|
| 666 |
|
|---|
| 667 | VOID FrameGetScrollBarHandles(Win32BaseWindow *win32wnd,BOOL getHorz,BOOL getVert)
|
|---|
| 668 | {
|
|---|
| 669 | if (getHorz) win32wnd->setHorzScrollHandle(WinWindowFromID(win32wnd->getOS2FrameWindowHandle(),FID_HORZSCROLL));
|
|---|
| 670 | if (getVert) win32wnd->setVertScrollHandle(WinWindowFromID(win32wnd->getOS2FrameWindowHandle(),FID_VERTSCROLL));
|
|---|
| 671 | }
|
|---|
| 672 |
|
|---|
| 673 | BOOL FrameShowScrollBars(Win32BaseWindow *win32wnd,BOOL changeHorz,BOOL changeVert,BOOL fShow,BOOL updateFrame,DWORD *flags)
|
|---|
| 674 | {
|
|---|
| 675 | HWND hwndObj = WinQueryObjectWindow(HWND_DESKTOP);
|
|---|
| 676 | ULONG updateFlags = 0;
|
|---|
| 677 |
|
|---|
| 678 | if (changeHorz)
|
|---|
| 679 | {
|
|---|
| 680 | HWND hwndCurPar = WinQueryWindow(win32wnd->getHorzScrollHandle(),QW_PARENT);
|
|---|
| 681 |
|
|---|
| 682 | if ((fShow && (hwndCurPar == hwndObj)) || (!fShow && (hwndCurPar != hwndObj)))
|
|---|
| 683 | {
|
|---|
| 684 | WinSetParent(win32wnd->getHorzScrollHandle(),fShow ? win32wnd->getOS2FrameWindowHandle():HWND_OBJECT,FALSE);
|
|---|
| 685 | updateFlags |= FCF_HORZSCROLL;
|
|---|
| 686 | }
|
|---|
| 687 | }
|
|---|
| 688 |
|
|---|
| 689 | if (changeVert)
|
|---|
| 690 | {
|
|---|
| 691 | HWND hwndCurPar = WinQueryWindow(win32wnd->getVertScrollHandle(),QW_PARENT);
|
|---|
| 692 |
|
|---|
| 693 | if ((fShow && (hwndCurPar == hwndObj)) || (!fShow && (hwndCurPar != hwndObj)))
|
|---|
| 694 | {
|
|---|
| 695 | WinSetParent(win32wnd->getVertScrollHandle(),fShow ? win32wnd->getOS2FrameWindowHandle():HWND_OBJECT,FALSE);
|
|---|
| 696 | updateFlags |= FCF_VERTSCROLL;
|
|---|
| 697 | }
|
|---|
| 698 | }
|
|---|
| 699 |
|
|---|
| 700 | if (updateFrame && updateFlags) WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_UPDATEFRAME,(MPARAM)updateFlags,(MPARAM)0);
|
|---|
| 701 | if (flags) *flags = updateFlags;
|
|---|
| 702 |
|
|---|
| 703 | return TRUE;
|
|---|
| 704 | }
|
|---|
| 705 |
|
|---|
| 706 | VOID FrameUpdateFrame(Win32BaseWindow *win32wnd,DWORD flags)
|
|---|
| 707 | {
|
|---|
| 708 | WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_UPDATEFRAME,(MPARAM)flags,(MPARAM)0);
|
|---|
| 709 | }
|
|---|
| 710 |
|
|---|
| 711 | DWORD FrameHitTest(Win32BaseWindow *win32wnd,INT x,INT y)
|
|---|
| 712 | {
|
|---|
| 713 | POINTL point;
|
|---|
| 714 | HWND hwnd = win32wnd->getOS2FrameWindowHandle(),child;
|
|---|
| 715 |
|
|---|
| 716 | if (hwnd == win32wnd->getOS2WindowHandle()) return HTCLIENT_W;
|
|---|
| 717 | if (win32wnd->getOS2WindowHandle() == WinQueryCapture(HWND_DESKTOP)) return HTCLIENT_W;
|
|---|
| 718 | point.x = x;
|
|---|
| 719 | point.y = mapScreenY(y);
|
|---|
| 720 | WinMapWindowPoints(HWND_DESKTOP,hwnd,&point,1);
|
|---|
| 721 | child = WinWindowFromPoint(hwnd,&point,FALSE);
|
|---|
| 722 |
|
|---|
| 723 | if (child == 0) return HTERROR_W;
|
|---|
| 724 | if (child == win32wnd->getOS2FrameWindowHandle())
|
|---|
| 725 | {
|
|---|
| 726 | RECTL client,frame;
|
|---|
| 727 |
|
|---|
| 728 | if (CanDrawSizeBox(win32wnd))
|
|---|
| 729 | {
|
|---|
| 730 | RECTL rect;
|
|---|
| 731 |
|
|---|
| 732 | GetSizeBox(win32wnd,&rect);
|
|---|
| 733 | if (WinPtInRect(GetThreadHAB(),&rect,&point)) return HTGROWBOX_W;
|
|---|
| 734 | }
|
|---|
| 735 | //somewhere in the border
|
|---|
| 736 | INT w = WinQuerySysValue(HWND_DESKTOP,SV_CXMINMAXBUTTON);
|
|---|
| 737 | INT h = WinQuerySysValue(HWND_DESKTOP,SV_CXMINMAXBUTTON);
|
|---|
| 738 | WinQueryWindowRect(hwnd,&frame);
|
|---|
| 739 |
|
|---|
| 740 | if (point.y < h)
|
|---|
| 741 | {
|
|---|
| 742 | if (point.x < w) return HTBOTTOMLEFT_W;
|
|---|
| 743 | if (point.x > frame.xRight-1-w) return HTBOTTOMRIGHT_W;
|
|---|
| 744 | return HTBOTTOM_W;
|
|---|
| 745 | }
|
|---|
| 746 | if (point.y > frame.yTop-1-h)
|
|---|
| 747 | {
|
|---|
| 748 | if (point.x < w) return HTTOPLEFT_W;
|
|---|
| 749 | if (point.x > frame.xRight-1-w) return HTTOPRIGHT_W;
|
|---|
| 750 | return HTTOP_W;
|
|---|
| 751 | }
|
|---|
| 752 | return HTBORDER_W;
|
|---|
| 753 | } else
|
|---|
| 754 | {
|
|---|
| 755 | if (child == WinWindowFromID(hwnd,FID_CLIENT)) return HTCLIENT_W;
|
|---|
| 756 | if (child == WinWindowFromID(hwnd,FID_VERTSCROLL)) return HTVSCROLL_W;
|
|---|
| 757 | if (child == WinWindowFromID(hwnd,FID_HORZSCROLL)) return HTHSCROLL_W;
|
|---|
| 758 | if (child == WinWindowFromID(hwnd,FID_SYSMENU)) return HTSYSMENU_W;
|
|---|
| 759 | if (child == WinWindowFromID(hwnd,FID_TITLEBAR)) return HTCAPTION_W;
|
|---|
| 760 | if (child == WinWindowFromID(hwnd,FID_MENU)) return HTMENU_W;
|
|---|
| 761 | if (child == WinWindowFromID(hwnd,FID_MINMAX))
|
|---|
| 762 | {
|
|---|
| 763 | //CB: close, reduce or zoom
|
|---|
| 764 | return HTZOOM_W;
|
|---|
| 765 | }
|
|---|
| 766 |
|
|---|
| 767 | return HTERROR_W;
|
|---|
| 768 | }
|
|---|
| 769 | }
|
|---|