From: <kr_...@us...> - 2004-05-07 14:45:00
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15953/src/cbits/Win32 Modified Files: DockBar.c FileDialog.c Notebook.c ToolBar.c Window.c Log Message: use MoveWindow instead of SetWindowPos where possible Index: DockBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/DockBar.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DockBar.c 7 May 2004 14:33:04 -0000 1.9 --- DockBar.c 7 May 2004 14:44:50 -0000 1.10 *************** *** 54,58 **** pBar->nSize = sz.cy; ! SetWindowPos(pBar->hWnd,NULL,pBand->nOffset,pBar->nOffset,sz.cx,sz.cy,SWP_NOZORDER); } else --- 54,58 ---- pBar->nSize = sz.cy; ! MoveWindow(pBar->hWnd,pBand->nOffset,pBar->nOffset,sz.cx,sz.cy,TRUE); } else *************** *** 61,65 **** pBar->nSize = sz.cx; ! SetWindowPos(pBar->hWnd,NULL,pBar->nOffset,pBand->nOffset,sz.cx,sz.cy,SWP_NOZORDER); } --- 61,65 ---- pBar->nSize = sz.cx; ! MoveWindow(pBar->hWnd,pBar->nOffset,pBand->nOffset,sz.cx,sz.cy,TRUE); } *************** *** 114,125 **** nBottom = GetDockBarSize(pData->hBottomBar); ! SetWindowPos(pData->hLeftBar, NULL,0,nTop,nLeft,nHeight-(nBottom+nTop),SWP_NOZORDER); ! SetWindowPos(pData->hTopBar, NULL,0,0,nWidth,nTop,SWP_NOZORDER); ! SetWindowPos(pData->hRightBar, NULL,nWidth-nRight,nTop,nRight,nHeight-(nBottom+nTop),SWP_NOZORDER); ! SetWindowPos(pData->hBottomBar,NULL,0,nHeight-nBottom,nWidth,nBottom,SWP_NOZORDER); ! SetWindowPos(pData->hClientWnd,NULL,nLeft,nTop,nWidth-(nRight+nLeft),nHeight-(nBottom+nTop),SWP_NOZORDER); ! SetWindowPos(pData->hStatusBar,NULL,0,nHeight,nWidth,nStatusHeight,SWP_NOZORDER); } --- 114,125 ---- nBottom = GetDockBarSize(pData->hBottomBar); ! MoveWindow(pData->hLeftBar, 0,nTop,nLeft,nHeight-(nBottom+nTop),TRUE); ! MoveWindow(pData->hTopBar, 0,0,nWidth,nTop,TRUE); ! MoveWindow(pData->hRightBar, nWidth-nRight,nTop,nRight,nHeight-(nBottom+nTop),TRUE); ! MoveWindow(pData->hBottomBar,0,nHeight-nBottom,nWidth,nBottom,TRUE); ! MoveWindow(pData->hClientWnd,nLeft,nTop,nWidth-(nRight+nLeft),nHeight-(nBottom+nTop),TRUE); ! MoveWindow(pData->hStatusBar,0,nHeight,nWidth,nStatusHeight,TRUE); } *************** *** 213,217 **** int nHeight = HIWORD(lParam); ! SetWindowPos(GetWindow(hWnd, GW_CHILD),NULL,0,0,nWidth,nHeight,SWP_NOZORDER); } break; --- 213,217 ---- int nHeight = HIWORD(lParam); ! MoveWindow(GetWindow(hWnd, GW_CHILD),0,0,nWidth,nHeight,TRUE); } break; Index: FileDialog.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/FileDialog.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileDialog.c 1 May 2003 20:27:38 -0000 1.6 --- FileDialog.c 7 May 2004 14:44:50 -0000 1.7 *************** *** 23,27 **** LPITEMIDLIST pidlReturn; BROWSEINFO bi; ! char *s = NULL; bi.hwndOwner = owner ? owner : ghWndFrame; --- 23,27 ---- LPITEMIDLIST pidlReturn; BROWSEINFO bi; ! char *s = NULL; bi.hwndOwner = owner ? owner : ghWndFrame; *************** *** 120,124 **** int nLen, nSize; char *s, *s2, *buffer; ! nSize = 1; s = ofn.lpstrFile+ofn.nFileOffset; --- 120,124 ---- int nLen, nSize; char *s, *s2, *buffer; ! nSize = 1; s = ofn.lpstrFile+ofn.nFileOffset; *************** *** 129,133 **** nSize += ofn.nFileOffset+nLen+1; } ! buffer = malloc(nSize); if (!buffer) --- 129,133 ---- nSize += ofn.nFileOffset+nLen+1; } ! buffer = malloc(nSize); if (!buffer) *************** *** 149,153 **** } *s2 = 0; ! free(ofn.lpstrFile); return buffer; --- 149,153 ---- } *s2 = 0; ! free(ofn.lpstrFile); return buffer; Index: Notebook.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Notebook.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Notebook.c 8 Oct 2003 22:21:57 -0000 1.7 --- Notebook.c 7 May 2004 14:44:50 -0000 1.8 *************** *** 22,28 **** SendMessage(hWnd, TCM_GETITEM, i, (LPARAM) &item); ! SetWindowPos((HWND) item.lParam,NULL,rect.left,rect.top, (rect.right-rect.left), (rect.bottom-rect.top), ! SWP_NOZORDER); } } --- 22,28 ---- SendMessage(hWnd, TCM_GETITEM, i, (LPARAM) &item); ! MoveWindow((HWND) item.lParam,rect.left,rect.top, (rect.right-rect.left), (rect.bottom-rect.top), ! TRUE); } } *************** *** 139,143 **** { LONG lStyle; ! lStyle = GetWindowLong(notebook, GWL_STYLE); lStyle &= ~(TCS_VERTICAL | TCS_RIGHT | TCS_BOTTOM); --- 139,143 ---- { LONG lStyle; ! lStyle = GetWindowLong(notebook, GWL_STYLE); lStyle &= ~(TCS_VERTICAL | TCS_RIGHT | TCS_BOTTOM); *************** *** 151,158 **** } ! SendMessage(notebook, WM_SETFONT, (WPARAM)NULL, TRUE); SetWindowLong(notebook, GWL_STYLE, lStyle); SendMessage(notebook, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM (TRUE,0)); ! ResizeNotebookPages(notebook); } --- 151,158 ---- } ! SendMessage(notebook, WM_SETFONT, (WPARAM)NULL, TRUE); SetWindowLong(notebook, GWL_STYLE, lStyle); SendMessage(notebook, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM (TRUE,0)); ! ResizeNotebookPages(notebook); } *************** *** 161,165 **** { LONG lStyle = GetWindowLong(notebook, GWL_STYLE); ! if (lStyle & TCS_VERTICAL) if (lStyle & TCS_RIGHT) --- 161,165 ---- { LONG lStyle = GetWindowLong(notebook, GWL_STYLE); ! if (lStyle & TCS_VERTICAL) if (lStyle & TCS_RIGHT) *************** *** 183,195 **** TCITEM item; int nOldIndex; ! item.mask = TCIF_PARAM; ! nOldIndex = SendMessage(notebook, TCM_GETCURSEL, 0, 0); SendMessage(notebook, TCM_SETCURSEL, index, 0); ! SendMessage(notebook, TCM_GETITEM, nOldIndex, (LPARAM) &item); ShowWindow((HWND) item.lParam, SW_HIDE); ! SendMessage(notebook, TCM_GETITEM, index, (LPARAM) &item); ShowWindow((HWND) item.lParam, SW_SHOW); --- 183,195 ---- TCITEM item; int nOldIndex; ! item.mask = TCIF_PARAM; ! nOldIndex = SendMessage(notebook, TCM_GETCURSEL, 0, 0); SendMessage(notebook, TCM_SETCURSEL, index, 0); ! SendMessage(notebook, TCM_GETITEM, nOldIndex, (LPARAM) &item); ShowWindow((HWND) item.lParam, SW_HIDE); ! SendMessage(notebook, TCM_GETITEM, index, (LPARAM) &item); ShowWindow((HWND) item.lParam, SW_SHOW); *************** *** 202,212 **** TCITEM item; int nCount; ! nCount = SendMessage(notebook, TCM_GETITEMCOUNT, 0, 0); if (pos < 0) pos = nCount; ! GetWindowRect(notebook, &rect); SendMessage(notebook, TCM_ADJUSTRECT, FALSE, (LPARAM) &rect); ! hWnd = CreateWindow("HNOTEBOOKPAGE", NULL, --- 202,212 ---- TCITEM item; int nCount; ! nCount = SendMessage(notebook, TCM_GETITEMCOUNT, 0, 0); if (pos < 0) pos = nCount; ! GetWindowRect(notebook, &rect); SendMessage(notebook, TCM_ADJUSTRECT, FALSE, (LPARAM) &rect); ! hWnd = CreateWindow("HNOTEBOOKPAGE", NULL, *************** *** 249,257 **** item.mask = TCIF_PARAM; SendMessage(hNotebook, TCM_GETITEM, i, (LPARAM) &item); ! if (((HWND) item.lParam) == window) return i; } ! return -1; } --- 249,257 ---- item.mask = TCIF_PARAM; SendMessage(hNotebook, TCM_GETITEM, i, (LPARAM) &item); ! if (((HWND) item.lParam) == window) return i; } ! return -1; } *************** *** 275,279 **** int i, nPos, nImage, nCount; HWND hNotebook = GetParent(window); ! // find the page position and an index of the old bitmap nPos = -1; --- 275,279 ---- int i, nPos, nImage, nCount; HWND hNotebook = GetParent(window); ! // find the page position and an index of the old bitmap nPos = -1; *************** *** 292,304 **** } } ! // return if the page is not found if (nPos < 0) return; ! if (nImage > 0) { // remove old bitmap ! BOOL bUsed = FALSE; for (i = 0; i < nCount; i++) --- 292,304 ---- } } ! // return if the page is not found if (nPos < 0) return; ! if (nImage > 0) { // remove old bitmap ! BOOL bUsed = FALSE; for (i = 0; i < nCount; i++) *************** *** 313,321 **** } } ! if (!bUsed) SendMessage(hNotebook, TCM_REMOVEIMAGE, nImage, 0); } ! // set new bitmap if (bitmap) --- 313,321 ---- } } ! if (!bUsed) SendMessage(hNotebook, TCM_REMOVEIMAGE, nImage, 0); } ! // set new bitmap if (bitmap) *************** *** 328,332 **** item.iImage = -1; } ! SendMessage(hNotebook, TCM_SETITEM, nPos, (LPARAM) &item); } --- 328,332 ---- item.iImage = -1; } ! SendMessage(hNotebook, TCM_SETITEM, nPos, (LPARAM) &item); } Index: ToolBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ToolBar.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ToolBar.c 7 May 2004 13:09:46 -0000 1.19 --- ToolBar.c 7 May 2004 14:44:50 -0000 1.20 *************** *** 530,534 **** NULL); SetParent(hToolBar, hDockBar); ! SetWindowPos(hDockBar, NULL, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, SWP_NOZORDER); free(szCaption); --- 530,534 ---- NULL); SetParent(hToolBar, hDockBar); ! MoveWindow(hDockBar, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, TRUE); free(szCaption); Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Window.c 7 May 2004 14:33:04 -0000 1.66 --- Window.c 7 May 2004 14:44:50 -0000 1.67 *************** *** 178,182 **** } ! SetWindowPos(hWnd,NULL,pos.x,pos.y,sz.cx,sz.cy,SWP_NOZORDER); } --- 178,182 ---- } ! MoveWindow(hWnd,pos.x,pos.y,sz.cx,sz.cy,TRUE); } *************** *** 1007,1014 **** GetWindowRect(hTargetWnd,&wrect); ! SetWindowPos(hTargetWnd,NULL,wrect.left,wrect.top, (wrect.right-wrect.left) + (w - (crect.right-crect.left)), (wrect.bottom-wrect.top) + (h - (crect.bottom - crect.top)), ! SWP_NOZORDER); } --- 1007,1014 ---- GetWindowRect(hTargetWnd,&wrect); ! MoveWindow(hTargetWnd,wrect.left,wrect.top, (wrect.right-wrect.left) + (w - (crect.right-crect.left)), (wrect.bottom-wrect.top) + (h - (crect.bottom - crect.top)), ! TRUE); } *************** *** 1269,1273 **** if (_stricmp(buffer, "ComboBox") == 0) h = 150; ! SetWindowPos(ctrl,NULL,x-pData->Origin.x,y-pData->Origin.y,w,h,SWP_NOZORDER); InvalidateRect(ctrl,NULL,TRUE); } --- 1269,1273 ---- if (_stricmp(buffer, "ComboBox") == 0) h = 150; ! MoveWindow(ctrl,x-pData->Origin.x,y-pData->Origin.y,w,h,TRUE); InvalidateRect(ctrl,NULL,TRUE); } *************** *** 1479,1483 **** } ! SetWindowPos(ghWndFrame,NULL,pos.x,pos.y,sz.cx,sz.cy,SWP_NOZORDER); } else --- 1479,1483 ---- } ! MoveWindow(ghWndFrame,pos.x,pos.y,sz.cx,sz.cy,TRUE); } else |