comparison os2/dw.c @ 963:ea356c38f7b6

Fixed a coordinate system issue with the button press handler on OS/2. Also fixed some formatting issues.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 02 May 2011 17:24:58 +0000
parents e3425875a03a
children 6c6b5bbd3a26
comparison
equal deleted inserted replaced
962:e3425875a03a 963:ea356c38f7b6
359 359
360 if((child = WinWindowFromID(handle, FID_CLIENT)) != NULLHANDLE) 360 if((child = WinWindowFromID(handle, FID_CLIENT)) != NULLHANDLE)
361 { 361 {
362 Box *box = (Box *)WinQueryWindowPtr(child, QWP_USER); 362 Box *box = (Box *)WinQueryWindowPtr(child, QWP_USER);
363 363
364 if(box) 364 if(box && !dw_window_get_data(handle, "_dw_box"))
365 { 365 {
366 if(box->count && box->items) 366 if(box->count && box->items)
367 free(box->items); 367 free(box->items);
368 368
369 WinSetWindowPtr(child, QWP_USER, 0); 369 WinSetWindowPtr(child, QWP_USER, 0);
2317 case WM_BUTTON3DOWN: 2317 case WM_BUTTON3DOWN:
2318 button = 3; 2318 button = 3;
2319 break; 2319 break;
2320 } 2320 }
2321 2321
2322 result = buttonfunc(tmp->window, pts.x, _get_frame_height(tmp->window) - pts.y, button, tmp->data); 2322 result = buttonfunc(tmp->window, pts.x, WinQueryWindow(tmp->window, QW_PARENT) == HWND_DESKTOP ? dw_screen_height() - pts.y : _get_height(tmp->window) - pts.y, button, tmp->data);
2323 tmp = NULL; 2323 tmp = NULL;
2324 } 2324 }
2325 } 2325 }
2326 break; 2326 break;
2327 case WM_BUTTON1UP: 2327 case WM_BUTTON1UP:
3572 break; 3572 break;
3573 case WM_BUTTON1DOWN: 3573 case WM_BUTTON1DOWN:
3574 case WM_BUTTON2DOWN: 3574 case WM_BUTTON2DOWN:
3575 case WM_BUTTON3DOWN: 3575 case WM_BUTTON3DOWN:
3576 if(res == -1) 3576 if(res == -1)
3577 WinSetFocus(HWND_DESKTOP, hwnd); 3577 WinSetFocus(HWND_DESKTOP, hwnd);
3578 else if(res) 3578 else if(res)
3579 return (MPARAM)TRUE; 3579 return (MPARAM)TRUE;
3580 } 3580 }
3581 return WinDefWindowProc(hwnd, msg, mp1, mp2); 3581 return WinDefWindowProc(hwnd, msg, mp1, mp2);
3582 } 3582 }
8684 /* Handle transparency if requested */ 8684 /* Handle transparency if requested */
8685 if(srcp && srcp->transcolor != DW_CLR_DEFAULT) 8685 if(srcp && srcp->transcolor != DW_CLR_DEFAULT)
8686 { 8686 {
8687 IMAGEBUNDLE newIb, oldIb; 8687 IMAGEBUNDLE newIb, oldIb;
8688 /* Transparent color is put into the background color */ 8688 /* Transparent color is put into the background color */
8689 GpiSetBackColor(hpsdest, srcp->transcolor); 8689 GpiSetBackColor(hpsdest, srcp->transcolor);
8690 GpiQueryAttrs(hpsdest, PRIM_IMAGE, IBB_BACK_MIX_MODE, (PBUNDLE)&oldIb); 8690 GpiQueryAttrs(hpsdest, PRIM_IMAGE, IBB_BACK_MIX_MODE, (PBUNDLE)&oldIb);
8691 newIb.usBackMixMode = BM_SRCTRANSPARENT; 8691 newIb.usBackMixMode = BM_SRCTRANSPARENT;
8692 GpiSetAttrs(hpsdest, PRIM_IMAGE, IBB_BACK_MIX_MODE, 0, (PBUNDLE)&newIb); 8692 GpiSetAttrs(hpsdest, PRIM_IMAGE, IBB_BACK_MIX_MODE, 0, (PBUNDLE)&newIb);
8693 GpiBitBlt(hpsdest, hpssrc, 4, ptl, ROP_SRCCOPY, BBO_IGNORE); 8693 GpiBitBlt(hpsdest, hpssrc, 4, ptl, ROP_SRCCOPY, BBO_IGNORE);
8694 GpiSetAttrs(hpsdest, PRIM_IMAGE, IBB_BACK_MIX_MODE, 0, (PBUNDLE)&oldIb); 8694 GpiSetAttrs(hpsdest, PRIM_IMAGE, IBB_BACK_MIX_MODE, 0, (PBUNDLE)&oldIb);
8695 } 8695 }
8696 else 8696 else
8697 { 8697 {
8698 /* Otherwise use the regular BitBlt call */ 8698 /* Otherwise use the regular BitBlt call */
8699 GpiBitBlt(hpsdest, hpssrc, 4, ptl, ROP_SRCCOPY, BBO_IGNORE); 8699 GpiBitBlt(hpsdest, hpssrc, 4, ptl, ROP_SRCCOPY, BBO_IGNORE);
8700 } 8700 }
8701 8701
8702 if(!destp) 8702 if(!destp)
8703 WinReleasePS(hpsdest); 8703 WinReleasePS(hpsdest);
8704 if(!srcp) 8704 if(!srcp)