Author: bfreisen Date: Mon Oct 19 19:46:29 2009 New Revision: 43615
URL: http://svn.reactos.org/svn/reactos?rev=43615&view=rev Log: [PAINT] rearranging variable declarations for better MSVC compatiblity
Modified: trunk/reactos/base/applications/paint/dialogs.c trunk/reactos/base/applications/paint/main.c trunk/reactos/base/applications/paint/winproc.c
Modified: trunk/reactos/base/applications/paint/dialogs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/dia... ============================================================================== --- trunk/reactos/base/applications/paint/dialogs.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/dialogs.c [iso-8859-1] Mon Oct 19 19:46:29 2009 @@ -73,30 +73,34 @@ switch (message) { case WM_INITDIALOG: - CheckDlgButton(hwnd, IDD_ATTRIBUTESRB3, BST_CHECKED); - CheckDlgButton(hwnd, IDD_ATTRIBUTESRB5, BST_CHECKED); - SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, imgXRes, FALSE); - SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, imgYRes, FALSE); - TCHAR strrc[100]; - if (isAFile) { - TCHAR date[100]; - TCHAR size[100]; - TCHAR temp[100]; - GetDateFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, date, sizeof(date)); - GetTimeFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, temp, sizeof(temp)); - _tcscat(date, _T(" ")); - _tcscat(date, temp); - LoadString(hProgInstance, IDS_FILESIZE, strrc, sizeof(strrc)); - _stprintf(size, strrc, fileSize); - SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT6, date); - SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT7, size); + TCHAR strrc[100]; + TCHAR res[100]; + + CheckDlgButton(hwnd, IDD_ATTRIBUTESRB3, BST_CHECKED); + CheckDlgButton(hwnd, IDD_ATTRIBUTESRB5, BST_CHECKED); + SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, imgXRes, FALSE); + SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, imgYRes, FALSE); + + if (isAFile) + { + TCHAR date[100]; + TCHAR size[100]; + TCHAR temp[100]; + GetDateFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, date, sizeof(date)); + GetTimeFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, temp, sizeof(temp)); + _tcscat(date, _T(" ")); + _tcscat(date, temp); + LoadString(hProgInstance, IDS_FILESIZE, strrc, sizeof(strrc)); + _stprintf(size, strrc, fileSize); + SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT6, date); + SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT7, size); + } + LoadString(hProgInstance, IDS_PRINTRES, strrc, sizeof(strrc)); + _stprintf(res, strrc, fileHPPM, fileVPPM); + SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT8, res); + return TRUE; } - TCHAR res[100]; - LoadString(hProgInstance, IDS_PRINTRES, strrc, sizeof(strrc)); - _stprintf(res, strrc, fileHPPM, fileVPPM); - SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT8, res); - return TRUE; case WM_CLOSE: EndDialog(hwnd, 0); break;
Modified: trunk/reactos/base/applications/paint/main.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/mai... ============================================================================== --- trunk/reactos/base/applications/paint/main.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/main.c [iso-8859-1] Mon Oct 19 19:46:29 2009 @@ -351,8 +351,8 @@ { TCHAR tempstr[1000]; TCHAR resstr[100]; + TCHAR *temp; insertReversible(bmNew); - TCHAR *temp; GetFullPathName(lpszArgument, sizeof(filepathname), filepathname, &temp); _tcscpy(filename, temp); LoadString(hProgInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr));
Modified: trunk/reactos/base/applications/paint/winproc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/win... ============================================================================== --- trunk/reactos/base/applications/paint/winproc.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/winproc.c [iso-8859-1] Mon Oct 19 19:46:29 2009 @@ -50,11 +50,14 @@
void zoomTo(int newZoom, int mouseX, int mouseY) { + int tbPos = 0; + int tempZoom = newZoom; + long clientRectScrollbox[4]; long clientRectImageArea[4]; + int x, y, w, h; GetClientRect(hScrollbox, (LPRECT)&clientRectScrollbox); GetClientRect(hImageArea, (LPRECT)&clientRectImageArea); - int x, y, w, h; w = clientRectImageArea[2] * clientRectScrollbox[2] / (clientRectImageArea[2] * newZoom / zoom); h = clientRectImageArea[3] * clientRectScrollbox[3] / (clientRectImageArea[3] * newZoom / zoom); x = max(0, min(clientRectImageArea[2] - w, mouseX - w / 2)) * newZoom / zoom; @@ -70,8 +73,6 @@ SendMessage(hScrollbox, WM_HSCROLL, SB_THUMBPOSITION | (x << 16), 0); SendMessage(hScrollbox, WM_VSCROLL, SB_THUMBPOSITION | (y << 16), 0);
- int tbPos = 0; - int tempZoom = newZoom; while (tempZoom>125) { tbPos++; @@ -82,24 +83,26 @@
void drawZoomFrame(int mouseX, int mouseY) { + HDC hdc; + HPEN oldPen; + HBRUSH oldBrush; + LOGBRUSH logbrush; + int rop; + long clientRectScrollbox[4]; long clientRectImageArea[4]; + int x, y, w, h; GetClientRect(hScrollbox, (LPRECT)&clientRectScrollbox); GetClientRect(hImageArea, (LPRECT)&clientRectImageArea); - int x, y, w, h; w = clientRectImageArea[2] * clientRectScrollbox[2] / (clientRectImageArea[2] * 2); h = clientRectImageArea[3] * clientRectScrollbox[3] / (clientRectImageArea[3] * 2); x = max(0, min(clientRectImageArea[2] - w, mouseX - w / 2)); y = max(0, min(clientRectImageArea[3] - h, mouseY - h / 2)); - HDC hdc; + hdc = GetDC(hImageArea); - HPEN oldPen; oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 0, 0)); - HBRUSH oldBrush; - LOGBRUSH logbrush; logbrush.lbStyle = BS_HOLLOW; oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); - int rop; rop = SetROP2(hdc, R2_NOT); Rectangle(hdc, x, y, x + w, y + h); SetROP2(hdc, rop); @@ -525,6 +528,8 @@ { if ((!drawing)||(activeTool<=9)) { + TRACKMOUSEEVENT tme; + TCHAR coordStr[100]; _stprintf(coordStr, _T("%d, %d"), (short)LOWORD(lParam)*1000/zoom, (short)HIWORD(lParam)*1000/zoom); SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM)coordStr); @@ -535,7 +540,6 @@ drawZoomFrame((short)LOWORD(lParam), (short)HIWORD(lParam)); }
- TRACKMOUSEEVENT tme; tme.cbSize = sizeof(TRACKMOUSEEVENT); tme.dwFlags = TME_LEAVE; tme.hwndTrack = hImageArea;