From: <kr_...@us...> - 2004-05-07 13:09:58
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26605/src/cbits/Win32 Modified Files: ToolBar.c Window.c Log Message: Replace ScreenToClient to MapWindowPoints function in places where an entire rectangle is transformed. This simplifies the code. Index: ToolBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ToolBar.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ToolBar.c 31 Aug 2003 12:56:26 -0000 1.18 --- ToolBar.c 7 May 2004 13:09:46 -0000 1.19 *************** *** 23,27 **** { TOOL_SUBMENU = 1 , TOOL_SEPARATOR = 2 ! , TOOL_ITEM = 4 , TOOL_CHECK_ITEM = 8 , TOOL_RADIO_ITEM = 16 --- 23,27 ---- { TOOL_SUBMENU = 1 , TOOL_SEPARATOR = 2 ! , TOOL_ITEM = 4 , TOOL_CHECK_ITEM = 8 [...1136 lines suppressed...] ! handleToolDestroy(toolItem); ! SendMessage(toolItem->hToolBar, TB_DELETEBUTTON, osGetToolItemPos(toolItem), 0); ! next = toolItem->nextInGroup; while (next->nextInGroup != toolItem) *************** *** 1197,1201 **** next->nextInGroup = toolItem->nextInGroup; free(toolItem); ! RelayoutFrameBars(); } --- 1195,1199 ---- next->nextInGroup = toolItem->nextInGroup; free(toolItem); ! RelayoutFrameBars(); } Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Window.c 7 May 2004 12:44:34 -0000 1.64 --- Window.c 7 May 2004 13:09:46 -0000 1.65 *************** *** 16,20 **** { RECT rect; - POINT origin; HWND hCtrl = GetTopWindow(hWnd); --- 16,19 ---- *************** *** 24,31 **** { GetWindowRect(hCtrl,&rect); ! origin.x = rect.left; ! origin.y = rect.top; ! ScreenToClient(hWnd,&origin); ! SetWindowPos(hCtrl,NULL,origin.x+dx,origin.y+dy,0,0,SWP_NOSIZE|SWP_NOZORDER); } --- 23,28 ---- { GetWindowRect(hCtrl,&rect); ! MapWindowPoints(NULL, hWnd, (LPPOINT) &rect, 2); ! SetWindowPos(hCtrl,NULL,rect.left+dx,rect.top+dy,0,0,SWP_NOSIZE|SWP_NOZORDER); } *************** *** 37,42 **** { RECT rect; - POINT upLeft; - POINT downRight; HRGN hTmpRgn; HWND hCtrl = GetTopWindow(hWnd); --- 34,37 ---- *************** *** 47,58 **** { GetWindowRect(hCtrl,&rect); ! upLeft.x = rect.left; ! upLeft.y = rect.top; ! ScreenToClient(hWnd,&upLeft); ! downRight.x = rect.right; ! downRight.y = rect.bottom; ! ScreenToClient(hWnd,&downRight); ! ! hTmpRgn = CreateRectRgn(upLeft.x, upLeft.y, downRight.x, downRight.y); CombineRgn(hRgn, hRgn, hTmpRgn, RGN_DIFF); DeleteObject(hTmpRgn); --- 42,47 ---- { GetWindowRect(hCtrl,&rect); ! MapWindowPoints(NULL, hWnd, (LPPOINT) &rect, 2); ! hTmpRgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom); CombineRgn(hRgn, hRgn, hTmpRgn, RGN_DIFF); DeleteObject(hTmpRgn); *************** *** 183,187 **** GetCursorPos(&pos); if (hParent) ! ScreenToClient(hParent, &pos); break; default: --- 172,176 ---- GetCursorPos(&pos); if (hParent) ! MapWindowPoints(NULL, hParent, &pos, 1); break; default: *************** *** 1358,1363 **** GetWindowRect(ctrl, &rect); ! ScreenToClient(hParent, ((LPPOINT) &rect) ); ! ScreenToClient(hParent, ((LPPOINT) &rect)+1); InvalidateRect(hParent,&rect,FALSE); } --- 1347,1351 ---- GetWindowRect(ctrl, &rect); ! MapWindowPoints(NULL, hParent, (LPPOINT) &rect, 2); InvalidateRect(hParent,&rect,FALSE); } |