Author: winesync
Date: Mon Jan 14 15:43:19 2008
New Revision: 31774
URL:
http://svn.reactos.org/svn/reactos?rev=31774&view=rev
Log:
Autosyncing with Wine HEAD
Modified:
trunk/reactos/dll/win32/comdlg32/colordlg.c
trunk/reactos/dll/win32/comdlg32/comdlg32.rbuild
trunk/reactos/dll/win32/comdlg32/filedlg.c
trunk/reactos/dll/win32/comdlg32/filedlg31.c
trunk/reactos/dll/win32/comdlg32/filedlgbrowser.c
trunk/reactos/dll/win32/comdlg32/finddlg32.c
trunk/reactos/dll/win32/comdlg32/fontdlg.c
trunk/reactos/dll/win32/comdlg32/printdlg.c
Modified: trunk/reactos/dll/win32/comdlg32/colordlg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/colordl…
==============================================================================
--- trunk/reactos/dll/win32/comdlg32/colordlg.c (original)
+++ trunk/reactos/dll/win32/comdlg32/colordlg.c Mon Jan 14 15:43:19 2008
@@ -337,24 +337,29 @@
ClientToScreen(hDlg, &point);
hwnd = GetDlgItem( hDlg, dlgitem );
GetWindowRect(hwnd, &rect);
- if (PtInRect(&rect, point))
- {
- GetClientRect(hwnd, &rect);
- ScreenToClient(hwnd, &point);
-
- x = (long) point.x * MAXHORI;
- x /= rect.right;
- y = (long) (rect.bottom - point.y) * MAXVERT;
- y /= rect.bottom;
-
- if (hori)
- *hori = x;
- if (vert)
- *vert = y;
- return 1;
- }
- else
+
+ if (!PtInRect(&rect, point))
return 0;
+
+ GetClientRect(hwnd, &rect);
+ ScreenToClient(hwnd, &point);
+
+ x = (long) point.x * MAXHORI;
+ x /= rect.right;
+ y = (long) (rect.bottom - point.y) * MAXVERT;
+ y /= rect.bottom;
+
+ if (x < 0) x = 0;
+ if (y < 0) y = 0;
+ if (x > MAXHORI) x = MAXHORI;
+ if (y > MAXVERT) y = MAXVERT;
+
+ if (hori)
+ *hori = x;
+ if (vert)
+ *vert = y;
+
+ return 1;
}
/***********************************************************************
* CC_MouseCheckResultWindow [internal]
@@ -436,16 +441,8 @@
hBrush = CreateSolidBrush(cr);
if (hBrush)
{
- hBrush = SelectObject(hdc, hBrush) ;
- Rectangle(hdc, rect.left, rect.top, rect.right/2, rect.bottom);
- DeleteObject ( SelectObject(hdc, hBrush) ) ;
- hBrush = CreateSolidBrush( GetNearestColor(hdc, cr) );
- if (hBrush)
- {
- hBrush = SelectObject(hdc, hBrush) ;
- Rectangle(hdc, rect.right/2-1, rect.top, rect.right, rect.bottom);
- DeleteObject(SelectObject(hdc, hBrush)) ;
- }
+ FillRect(hdc, &rect, hBrush);
+ DrawEdge(hdc, &rect, BDR_SUNKENOUTER, BF_RECT);
}
ReleaseDC(hwnd, hdc);
}
@@ -458,7 +455,7 @@
{
HDC hDC;
long temp;
- int w = LOWORD(GetDialogBaseUnits());
+ int w = LOWORD(GetDialogBaseUnits()) / 2;
POINT points[3];
int height;
int oben;
@@ -479,6 +476,7 @@
oben = points[0].y; /* | \ | */
/* | \| */
temp = (long)height * (long)y;
+ points[0].x += 1;
points[0].y = oben + height - temp / (long)MAXVERT;
points[1].y = points[0].y + w;
points[2].y = points[0].y - w;
@@ -491,7 +489,11 @@
lpp->old3angle.right = points[1].x + 1;
lpp->old3angle.top = points[2].y - 1;
lpp->old3angle.bottom= points[1].y + 1;
+
+ hbr = SelectObject(hDC, GetStockObject(BLACK_BRUSH));
Polygon(hDC, points, 3);
+ SelectObject(hDC, hbr);
+
ReleaseDC(hDlg, hDC);
}
}
@@ -503,7 +505,8 @@
void CC_PaintCross( HWND hDlg, int x, int y)
{
HDC hDC;
- int w = GetDialogBaseUnits();
+ int w = GetDialogBaseUnits() - 1;
+ int wc = GetDialogBaseUnits() * 3 / 4;
HWND hwnd = GetDlgItem(hDlg, 0x2c6);
LPCCPRIV lpp = (LPCCPRIV) GetPropW( hDlg, szColourDialogProp );
RECT rect;
@@ -515,8 +518,7 @@
GetClientRect(hwnd, &rect);
hDC = GetDC(hwnd);
SelectClipRgn( hDC, CreateRectRgnIndirect(&rect));
- hPen = CreatePen(PS_SOLID, 2, 0xffffff); /* -white- color */
- hPen = SelectObject(hDC, hPen);
+
point.x = ((long)rect.right * (long)x) / (long)MAXHORI;
point.y = rect.bottom - ((long)rect.bottom * (long)y) / (long)MAXVERT;
if ( lpp->oldcross.left != lpp->oldcross.right )
@@ -529,11 +531,18 @@
lpp->oldcross.top = point.y - w - 1;
lpp->oldcross.bottom = point.y + w + 1;
+ hPen = CreatePen(PS_SOLID, 3, 0x000000); /* -black- color */
+ hPen = SelectObject(hDC, hPen);
MoveToEx(hDC, point.x - w, point.y, &p);
+ LineTo(hDC, point.x - wc, point.y);
+ MoveToEx(hDC, point.x + wc, point.y, &p);
LineTo(hDC, point.x + w, point.y);
MoveToEx(hDC, point.x, point.y - w, &p);
+ LineTo(hDC, point.x, point.y - wc);
+ MoveToEx(hDC, point.x, point.y + wc, &p);
LineTo(hDC, point.x, point.y + w);
- DeleteObject( SelectObject(hDC, hPen)) ;
+ DeleteObject( SelectObject(hDC, hPen));
+
ReleaseDC(hwnd, hDC);
}
}
@@ -642,7 +651,7 @@
rect.bottom = rect.top;
}
GetClientRect(hwnd, &rect);
- FrameRect(hDC, &rect, GetStockObject(BLACK_BRUSH) );
+ DrawEdge(hDC, &rect, BDR_SUNKENOUTER, BF_RECT);
ReleaseDC(hwnd, hDC);
}
}
@@ -730,7 +739,7 @@
static void CC_PaintPredefColorArray( HWND hDlg, int rows, int cols)
{
HWND hwnd = GetDlgItem(hDlg, 0x2d0);
- RECT rect;
+ RECT rect, blockrect;
HDC hdc;
HBRUSH hBrush;
int dx, dy, i, j, k;
@@ -753,14 +762,17 @@
hBrush = CreateSolidBrush(predefcolors[j][i]);
if (hBrush)
{
- hBrush = SelectObject(hdc, hBrush);
- Rectangle(hdc, rect.left, rect.top,
- rect.left + dx - DISTANCE, rect.top + dy - DISTANCE);
- rect.left = rect.left + dx;
- DeleteObject(SelectObject(hdc, hBrush)) ;
+ blockrect.left = rect.left;
+ blockrect.top = rect.top;
+ blockrect.right = rect.left + dx - DISTANCE;
+ blockrect.bottom = rect.top + dy - DISTANCE;
+ FillRect(hdc, &blockrect, hBrush);
+ DrawEdge(hdc, &blockrect, BDR_SUNKEN, BF_RECT);
+ DeleteObject(hBrush);
}
+ rect.left += dx;
}
- rect.top = rect.top + dy;
+ rect.top += dy;
rect.left = k;
}
ReleaseDC(hwnd, hdc);
@@ -774,7 +786,7 @@
void CC_PaintUserColorArray( HWND hDlg, int rows, int cols, const COLORREF *lpcr )
{
HWND hwnd = GetDlgItem(hDlg, 0x2d1);
- RECT rect;
+ RECT rect, blockrect;
HDC hdc;
HBRUSH hBrush;
int dx, dy, i, j, k;
@@ -799,14 +811,17 @@
hBrush = CreateSolidBrush(lpcr[i+j*cols]);
if (hBrush)
{
- hBrush = SelectObject(hdc, hBrush) ;
- Rectangle(hdc, rect.left, rect.top,
- rect.left + dx - DISTANCE, rect.top + dy - DISTANCE);
- rect.left = rect.left + dx;
- DeleteObject( SelectObject(hdc, hBrush) ) ;
+ blockrect.left = rect.left;
+ blockrect.top = rect.top;
+ blockrect.right = rect.left + dx - DISTANCE;
+ blockrect.bottom = rect.top + dy - DISTANCE;
+ FillRect(hdc, &blockrect, hBrush);
+ DrawEdge(hdc, &blockrect, BDR_SUNKEN, BF_RECT);
+ DeleteObject(hBrush);
}
+ rect.left += dx;
}
- rect.top = rect.top + dy;
+ rect.top += dy;
rect.left = k;
}
ReleaseDC(hwnd, hdc);
@@ -814,7 +829,6 @@
if (lpp->hwndFocus == hwnd)
CC_DrawCurrentFocusRect(lpp);
}
-
/***********************************************************************
@@ -1075,10 +1089,10 @@
CC_PaintPredefColorArray(hDlg, 6, 8);
CC_PaintUserColorArray(hDlg, 2, 8, lpp->lpcc->lpCustColors);
CC_PaintLumBar(hDlg, lpp->h, lpp->s);
- CC_PaintCross(hDlg, lpp->h, lpp->s);
CC_PaintTriangle(hDlg, lpp->l);
CC_PaintSelectedColor(hDlg, lpp->lpcc->rgbResult);
CC_PaintColorGraph(hDlg);
+ CC_PaintCross(hDlg, lpp->h, lpp->s);
EndPaint(hDlg, &ps);
return TRUE;
@@ -1346,7 +1360,7 @@
lpcc->lpCustColors = lpChCol->lpCustColors;
lpcc->Flags = lpChCol->Flags;
lpcc->lCustData = lpChCol->lCustData;
- lpcc->lpfnHook = (LPCCHOOKPROC) lpChCol->lpfnHook;
+ lpcc->lpfnHook = lpChCol->lpfnHook;
if ((lpcc->Flags & CC_ENABLETEMPLATE) && (lpChCol->lpTemplateName))
{
if (HIWORD(lpChCol->lpTemplateName)) {
INT len = MultiByteToWideChar( CP_ACP, 0, lpChCol->lpTemplateName, -1, NULL, 0);
Modified: trunk/reactos/dll/win32/comdlg32/comdlg32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/comdlg3…
==============================================================================
--- trunk/reactos/dll/win32/comdlg32/comdlg32.rbuild (original)
+++ trunk/reactos/dll/win32/comdlg32/comdlg32.rbuild Mon Jan 14 15:43:19 2008
@@ -1,5 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
+<group>
<module name="comdlg32" type="win32dll"
baseaddress="${BASEADDRESS_COMDLG32}" installbase="system32"
installname="comdlg32.dll" allowwarnings="true">
<importlibrary definition="comdlg32.spec.def" />
<include base="comdlg32">.</include>
@@ -30,3 +31,4 @@
<file>rsrc.rc</file>
<file>comdlg32.spec</file>
</module>
+</group>
Modified: trunk/reactos/dll/win32/comdlg32/filedlg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
==============================================================================
--- trunk/reactos/dll/win32/comdlg32/filedlg.c (original)
+++ trunk/reactos/dll/win32/comdlg32/filedlg.c Mon Jan 14 15:43:19 2008
@@ -2140,7 +2140,6 @@
if(lstrlenW(lpstrPathAndFile) < fodInfos->ofnInfos->nMaxFile -
((fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT) ? 1 : 0))
{
- LPWSTR lpszTemp;
/* fill destination buffer */
if (fodInfos->ofnInfos->lpstrFile)
@@ -2164,13 +2163,31 @@
}
}
- /* set filename offset */
- lpszTemp = PathFindFileNameW(lpstrPathAndFile);
- fodInfos->ofnInfos->nFileOffset = (lpszTemp - lpstrPathAndFile);
-
- /* set extension offset */
- lpszTemp = PathFindExtensionW(lpstrPathAndFile);
- fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? (lpszTemp -
lpstrPathAndFile) + 1 : 0;
+ if(fodInfos->unicode)
+ {
+ LPWSTR lpszTemp;
+
+ /* set filename offset */
+ lpszTemp = PathFindFileNameW(lpstrPathAndFile);
+ fodInfos->ofnInfos->nFileOffset = (lpszTemp - lpstrPathAndFile);
+
+ /* set extension offset */
+ lpszTemp = PathFindExtensionW(lpstrPathAndFile);
+ fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? (lpszTemp -
lpstrPathAndFile) + 1 : 0;
+ }
+ else
+ {
+ LPSTR lpszTemp;
+ LPOPENFILENAMEA ofn = (LPOPENFILENAMEA)fodInfos->ofnInfos;
+
+ /* set filename offset */
+ lpszTemp = PathFindFileNameA(ofn->lpstrFile);
+ fodInfos->ofnInfos->nFileOffset = (lpszTemp - ofn->lpstrFile);
+
+ /* set extension offset */
+ lpszTemp = PathFindExtensionA(ofn->lpstrFile);
+ fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? (lpszTemp -
ofn->lpstrFile) + 1 : 0;
+ }
/* set the lpstrFileTitle */
if(fodInfos->ofnInfos->lpstrFileTitle)
@@ -3658,12 +3675,20 @@
if (priv->ofnA)
{
+ LPSTR lpszTemp;
if (ofnW->nMaxFile &&
!WideCharToMultiByte( CP_ACP, 0, ofnW->lpstrFile, -1,
priv->ofnA->lpstrFile, ofnW->nMaxFile, NULL,
NULL ))
priv->ofnA->lpstrFile[ofnW->nMaxFile-1] = 0;
- priv->ofnA->nFileOffset = ofnW->nFileOffset;
- priv->ofnA->nFileExtension = ofnW->nFileExtension;
+
+ /* offsets are not guarenteed to be the same in WCHAR to MULTIBYTE conversion */
+ /* set filename offset */
+ lpszTemp = PathFindFileNameA(priv->ofnA->lpstrFile);
+ priv->ofnA->nFileOffset = (lpszTemp - priv->ofnA->lpstrFile);
+
+ /* set extension offset */
+ lpszTemp = PathFindExtensionA(priv->ofnA->lpstrFile);
+ priv->ofnA->nFileExtension = (*lpszTemp) ? (lpszTemp -
priv->ofnA->lpstrFile) + 1 : 0;
}
}
Modified: trunk/reactos/dll/win32/comdlg32/filedlg31.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
==============================================================================
--- trunk/reactos/dll/win32/comdlg32/filedlg31.c (original)
+++ trunk/reactos/dll/win32/comdlg32/filedlg31.c Mon Jan 14 15:43:19 2008
@@ -113,59 +113,8 @@
}
/***********************************************************************
- * FD31_ScanDir [internal]
- */
-static BOOL FD31_ScanDir(HWND hWnd, LPCWSTR newPath)
-{
- WCHAR buffer[BUFFILE];
- HWND hdlg, hdlgDir;
- LRESULT lRet = TRUE;
- HCURSOR hCursorWait, oldCursor;
-
- TRACE("Trying to change to %s\n", debugstr_w(newPath));
- if ( newPath[0] && !SetCurrentDirectoryW( newPath ))
- return FALSE;
- lstrcpynW(buffer, newPath, sizeof(buffer)/sizeof(WCHAR));
-
- /* get the list of spec files */
- GetDlgItemTextW(hWnd, edt1, buffer, sizeof(buffer)/sizeof(WCHAR));
-
- hCursorWait = LoadCursorA(0, (LPSTR)IDC_WAIT);
- oldCursor = SetCursor(hCursorWait);
-
- /* list of files */
- if ((hdlg = GetDlgItem(hWnd, lst1)) != 0) {
- WCHAR* scptr; /* ptr on semi-colon */
- WCHAR* filter = buffer;
-
- TRACE("Using filter %s\n", debugstr_w(filter));
- SendMessageW(hdlg, LB_RESETCONTENT, 0, 0);
- while (filter) {
- scptr = strchrW(filter, ';');
- if (scptr) *scptr = 0;
- while (*filter == ' ') filter++;
- TRACE("Using file spec %s\n", debugstr_w(filter));
- if (SendMessageW(hdlg, LB_DIR, 0, (LPARAM)filter) == LB_ERR)
- return FALSE;
- if (scptr) *scptr = ';';
- filter = (scptr) ? (scptr + 1) : 0;
- }
- }
-
- /* list of directories */
- strcpyW(buffer, FILE_star);
-
- if ((hdlgDir = GetDlgItem(hWnd, lst2)) != 0) {
- lRet = DlgDirListW(hWnd, buffer, lst2, stc1, DDL_EXCLUSIVE | DDL_DIRECTORY);
- }
- SetCursor(oldCursor);
- return lRet;
-}
-
-/***********************************************************************
* FD31_GetFileType [internal]
*/
-
static LPCWSTR FD31_GetFileType(LPCWSTR cfptr, LPCWSTR fptr, const WORD index)
{
int n, i;
@@ -187,6 +136,55 @@
fptr += lstrlenW(fptr) + 1;
}
return FILE_star; /* FIXME */
+}
+
+/***********************************************************************
+ * FD31_ScanDir [internal]
+ */
+static BOOL FD31_ScanDir(const OPENFILENAMEW *ofn, HWND hWnd, LPCWSTR newPath)
+{
+ WCHAR buffer[BUFFILE];
+ HWND hdlg, hdlgDir;
+ LRESULT lRet = TRUE;
+ HCURSOR hCursorWait, oldCursor;
+
+ TRACE("Trying to change to %s\n", debugstr_w(newPath));
+ if ( newPath[0] && !SetCurrentDirectoryW( newPath ))
+ return FALSE;
+
+ /* get the list of spec files */
+ lstrcpynW(buffer, FD31_GetFileType(ofn->lpstrCustomFilter,
+ ofn->lpstrFilter, ofn->nFilterIndex - 1), BUFFILE);
+
+ hCursorWait = LoadCursorA(0, (LPSTR)IDC_WAIT);
+ oldCursor = SetCursor(hCursorWait);
+
+ /* list of files */
+ if ((hdlg = GetDlgItem(hWnd, lst1)) != 0) {
+ WCHAR* scptr; /* ptr on semi-colon */
+ WCHAR* filter = buffer;
+
+ TRACE("Using filter %s\n", debugstr_w(filter));
+ SendMessageW(hdlg, LB_RESETCONTENT, 0, 0);
+ while (filter) {
+ scptr = strchrW(filter, ';');
+ if (scptr) *scptr = 0;
+ while (*filter == ' ') filter++;
+ TRACE("Using file spec %s\n", debugstr_w(filter));
+ SendMessageW(hdlg, LB_DIR, 0, (LPARAM)filter);
+ if (scptr) *scptr = ';';
+ filter = (scptr) ? (scptr + 1) : 0;
+ }
+ }
+
+ /* list of directories */
+ strcpyW(buffer, FILE_star);
+
+ if ((hdlgDir = GetDlgItem(hWnd, lst2)) != 0) {
+ lRet = DlgDirListW(hWnd, buffer, lst2, stc1, DDL_EXCLUSIVE | DDL_DIRECTORY);
+ }
+ SetCursor(oldCursor);
+ return lRet;
}
/***********************************************************************
@@ -375,7 +373,7 @@
}
strcatW(tmpstr, FILE_bslash);
- FD31_ScanDir(hWnd, tmpstr);
+ FD31_ScanDir(lfs->ofnW, hWnd, tmpstr);
/* notify the app */
if (lfs->hook)
{
@@ -450,7 +448,7 @@
TRACE("path=%s, tmpstr2=%s\n", debugstr_w(path), debugstr_w(tmpstr2));
SetDlgItemTextW( hWnd, edt1, tmpstr2 );
- FD31_ScanDir(hWnd, path);
+ FD31_ScanDir(lfs->ofnW, hWnd, path);
return (lfs->ofnW->Flags & OFN_NOVALIDATE) ? TRUE : FALSE;
}
@@ -462,7 +460,7 @@
strcatW(path, FILE_bslash);
/* if ScanDir succeeds, we have changed the directory */
- if (FD31_ScanDir(hWnd, path))
+ if (FD31_ScanDir(lfs->ofnW, hWnd, path))
return FALSE; /* and path is not a valid file name */
/* if not, this must be a filename */
@@ -477,7 +475,7 @@
lstrcpynW(tmpstr2, pBeginFileName + 1, sizeof(tmpstr2)/sizeof(WCHAR) );
/* Should we MessageBox() if this fails? */
- if (!FD31_ScanDir(hWnd, path))
+ if (!FD31_ScanDir(lfs->ofnW, hWnd, path))
{
return FALSE;
}
@@ -531,7 +529,7 @@
FD31_UpdateFileTitle(lfs);
if (lfs->hook)
{
- lRet = (BOOL)FD31_CallWindowProc(lfs, lfs->fileokstring,
+ lRet = FD31_CallWindowProc(lfs, lfs->fileokstring,
0, lfs->lParam );
if (lRet)
{
@@ -543,7 +541,7 @@
{
if (ofnW->lpstrFile)
{
- LPWSTR str = (LPWSTR)ofnW->lpstrFile;
+ LPWSTR str = ofnW->lpstrFile;
LPWSTR ptr = strrchrW(str, '\\');
str[lstrlenW(str) + 1] = '\0';
*ptr = 0;
@@ -590,7 +588,6 @@
return TRUE;
pstr = (LPWSTR)SendDlgItemMessageW(lfs->hwnd, cmb1, CB_GETITEMDATA, lRet, 0);
TRACE("Selected filter : %s\n", debugstr_w(pstr));
- SetDlgItemTextW( lfs->hwnd, edt1, pstr );
return FD31_Validate( lfs, NULL, cmb1, lRet, TRUE );
}
@@ -871,11 +868,19 @@
if (ofn->nFilterIndex == 0 && ofn->lpstrCustomFilter == NULL)
ofn->nFilterIndex = 1;
SendDlgItemMessageW(hWnd, cmb1, CB_SETCURSEL, ofn->nFilterIndex - 1, 0);
- lstrcpynW(tmpstr, FD31_GetFileType(ofn->lpstrCustomFilter,
+ if (ofn->lpstrFile && ofn->lpstrFile[0])
+ {
+ TRACE( "SetText of edt1 to %s\n", debugstr_w(ofn->lpstrFile) );
+ SetDlgItemTextW( hWnd, edt1, ofn->lpstrFile );
+ }
+ else
+ {
+ lstrcpynW(tmpstr, FD31_GetFileType(ofn->lpstrCustomFilter,
ofn->lpstrFilter, ofn->nFilterIndex - 1),BUFFILE);
- TRACE("nFilterIndex = %d, SetText of edt1 to %s\n",
+ TRACE("nFilterIndex = %d, SetText of edt1 to %s\n",
ofn->nFilterIndex, debugstr_w(tmpstr));
- SetDlgItemTextW( hWnd, edt1, tmpstr );
+ SetDlgItemTextW( hWnd, edt1, tmpstr );
+ }
/* get drive list */
*tmpstr = 0;
DlgDirListComboBoxW(hWnd, tmpstr, cmb2, 0, DDL_DRIVES | DDL_EXCLUSIVE);
@@ -896,9 +901,9 @@
}
else
*tmpstr = 0;
- if (!FD31_ScanDir(hWnd, tmpstr)) {
+ if (!FD31_ScanDir(ofn, hWnd, tmpstr)) {
*tmpstr = 0;
- if (!FD31_ScanDir(hWnd, tmpstr))
+ if (!FD31_ScanDir(ofn, hWnd, tmpstr))
WARN("Couldn't read initial directory %s!\n", debugstr_w(tmpstr));
}
/* select current drive in combo 2, omit missing drives */
@@ -919,7 +924,7 @@
if (ofn->Flags & OFN_HIDEREADONLY)
ShowWindow(GetDlgItem(hWnd, chx1), SW_HIDE);
if (lfs->hook)
- return (BOOL) FD31_CallWindowProc(lfs, WM_INITDIALOG, wParam, lfs->lParam);
+ return FD31_CallWindowProc(lfs, WM_INITDIALOG, wParam, lfs->lParam);
return TRUE;
}
Modified: trunk/reactos/dll/win32/comdlg32/filedlgbrowser.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
==============================================================================
--- trunk/reactos/dll/win32/comdlg32/filedlgbrowser.c (original)
+++ trunk/reactos/dll/win32/comdlg32/filedlgbrowser.c Mon Jan 14 15:43:19 2008
@@ -117,11 +117,11 @@
FE(SBSP_INITIATEDBYHLINKFRAME),
};
#undef FE
- DPRINTF("SBSP Flags: %08x =", uflags);
+ TRACE("SBSP Flags: %08x =", uflags);
for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++)
if (flags[i].mask & uflags)
- DPRINTF("%s ", flags[i].name);
- DPRINTF("\n");
+ TRACE("%s ", flags[i].name);
+ TRACE("\n");
}
}
@@ -375,8 +375,7 @@
return hRes;
}
/* create an absolute pidl */
- pidlTmp = COMDLG32_PIDL_ILCombine(fodInfos->ShellInfos.pidlAbsCurrent,
- (LPCITEMIDLIST)pidl);
+ pidlTmp = COMDLG32_PIDL_ILCombine(fodInfos->ShellInfos.pidlAbsCurrent, pidl);
}
else if(wFlags & SBSP_PARENT)
{
@@ -388,7 +387,7 @@
else /* SBSP_ABSOLUTE is 0x0000 */
{
/* An absolute pidl (relative from the desktop) */
- pidlTmp = COMDLG32_PIDL_ILClone((LPCITEMIDLIST)pidl);
+ pidlTmp = COMDLG32_PIDL_ILClone(pidl);
psfTmp = GetShellFolderFromPidl(pidlTmp);
}
Modified: trunk/reactos/dll/win32/comdlg32/finddlg32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/finddlg…
==============================================================================
--- trunk/reactos/dll/win32/comdlg32/finddlg32.c (original)
+++ trunk/reactos/dll/win32/comdlg32/finddlg32.c Mon Jan 14 15:43:19 2008
@@ -382,7 +382,7 @@
HRSRC htemplate;
if(pdata->fr.Flags & FR_ENABLETEMPLATE)
{
- hmod = (HMODULE)pdata->fr.hInstance;
+ hmod = pdata->fr.hInstance;
if(pdata->fr.Flags & FR_WINE_UNICODE)
{
htemplate = FindResourceW(hmod, (LPCWSTR)pdata->fr.lpTemplateName,
(LPWSTR)RT_DIALOG);
Modified: trunk/reactos/dll/win32/comdlg32/fontdlg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/fontdlg…
==============================================================================
--- trunk/reactos/dll/win32/comdlg32/fontdlg.c (original)
+++ trunk/reactos/dll/win32/comdlg32/fontdlg.c Mon Jan 14 15:43:19 2008
@@ -223,7 +223,7 @@
/***********************************************************************
* ChooseFontA (COMDLG32.@)
*
- * See ChosseFontW.
+ * See ChooseFontW.
*/
BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
{
Modified: trunk/reactos/dll/win32/comdlg32/printdlg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/printdl…
==============================================================================
--- trunk/reactos/dll/win32/comdlg32/printdlg.c (original)
+++ trunk/reactos/dll/win32/comdlg32/printdlg.c Mon Jan 14 15:43:19 2008
@@ -2340,6 +2340,7 @@
typedef struct {
LPPAGESETUPDLGW dlga;
PRINTDLGW pdlg;
+ PAGESETUPDLGW curdlg; /* Current dialog state */
} PageSetupDataW;
@@ -2683,6 +2684,46 @@
return TRUE;
}
+static void PRINTDLG_PS_SetOrientationW(HWND hDlg, PageSetupDataW* pda)
+{
+ WCHAR PaperName[64];
+
+ GetDlgItemTextW(hDlg, cmb2, PaperName, sizeof(PaperName)/sizeof(WCHAR));
+ PRINTDLG_PaperSizeW(&pda->pdlg, PaperName, &pda->curdlg.ptPaperSize);
+ pda->curdlg.ptPaperSize.x = _c_10mm2size((LPPAGESETUPDLGA)pda->dlga,
pda->curdlg.ptPaperSize.x);
+ pda->curdlg.ptPaperSize.y = _c_10mm2size((LPPAGESETUPDLGA)pda->dlga,
pda->curdlg.ptPaperSize.y);
+
+ if(IsDlgButtonChecked(hDlg, rad2))
+ {
+ DWORD tmp = pda->curdlg.ptPaperSize.x;
+ pda->curdlg.ptPaperSize.x = pda->curdlg.ptPaperSize.y;
+ pda->curdlg.ptPaperSize.y = tmp;
+ }
+}
+
+static void PRINTDLG_PS_UpdatePrintDlgW(PageSetupDataW* pda, HWND hDlg)
+{
+ DEVMODEW* dm;
+ DWORD sel;
+
+ dm = GlobalLock(pda->pdlg.hDevMode);
+
+ if(!dm)
+ return;
+
+ if(pda->curdlg.ptPaperSize.y > pda->curdlg.ptPaperSize.x)
+ dm->u1.s1.dmOrientation = DMORIENT_PORTRAIT;
+ else
+ dm->u1.s1.dmOrientation = DMORIENT_LANDSCAPE;
+
+ sel = SendDlgItemMessageW(hDlg, cmb2, CB_GETCURSEL, 0, 0);
+
+ if(sel != CB_ERR)
+ dm->u1.s1.dmPaperSize = SendDlgItemMessageW(hDlg, cmb2, CB_GETITEMDATA, sel,
0);
+
+ GlobalUnlock(pda->pdlg.hDevMode);
+}
+
static BOOL
PRINTDLG_PS_ChangePrinterW(HWND hDlg, PageSetupDataW *pda) {
DEVNAMES *dn;
@@ -2695,8 +2736,18 @@
portname = ((WCHAR*)dn)+dn->wOutputOffset;
PRINTDLG_SetUpPaperComboBoxW(hDlg,cmb2,devname,portname,dm);
PRINTDLG_SetUpPaperComboBoxW(hDlg,cmb3,devname,portname,dm);
+
+ /* Landscape orientation */
+ if (dm->u1.s1.dmOrientation == DMORIENT_LANDSCAPE)
+ CheckRadioButton(hDlg, rad1, rad2, rad2);
+ else /* this is default if papersize is not set */
+ CheckRadioButton(hDlg, rad1, rad2, rad1);
+
GlobalUnlock(pda->pdlg.hDevNames);
GlobalUnlock(pda->pdlg.hDevMode);
+
+ PRINTDLG_PS_SetOrientationW(hDlg, pda);
+
return TRUE;
}
@@ -2791,21 +2842,30 @@
}
return TRUE;
case rad1:
- if (pda->curdlg.ptPaperSize.x > pda->curdlg.ptPaperSize.y){
- DWORD tmp = pda->curdlg.ptPaperSize.x;
- pda->curdlg.ptPaperSize.x = pda->curdlg.ptPaperSize.y;
- pda->curdlg.ptPaperSize.y = tmp;
- }
+ case rad2:
+ if((id == rad1 && pda->curdlg.ptPaperSize.x >
pda->curdlg.ptPaperSize.y) ||
+ (id == rad2 && pda->curdlg.ptPaperSize.y >
pda->curdlg.ptPaperSize.x))
+ {
+ char TmpText[25];
+ char TmpText2[25];
+ DWORD tmp = pda->curdlg.ptPaperSize.x;
+
+ pda->curdlg.ptPaperSize.x = pda->curdlg.ptPaperSize.y;
+ pda->curdlg.ptPaperSize.y = tmp;
+
+ GetDlgItemTextA(hDlg, edt4, TmpText, sizeof(TmpText));
+ GetDlgItemTextA(hDlg, edt5, TmpText2, sizeof(TmpText2));
+ SetDlgItemTextA(hDlg, edt5, TmpText);
+ SetDlgItemTextA(hDlg, edt4, TmpText2);
+
+ GetDlgItemTextA(hDlg, edt6, TmpText, sizeof(TmpText));
+ GetDlgItemTextA(hDlg, edt7, TmpText2, sizeof(TmpText2));
+ SetDlgItemTextA(hDlg, edt7, TmpText);
+ SetDlgItemTextA(hDlg, edt6, TmpText2);
+
PRINTDLG_PS_ChangePaperPrev(pda);
+ }
break;
- case rad2:
- if (pda->curdlg.ptPaperSize.y > pda->curdlg.ptPaperSize.x){
- DWORD tmp = pda->curdlg.ptPaperSize.x;
- pda->curdlg.ptPaperSize.x = pda->curdlg.ptPaperSize.y;
- pda->curdlg.ptPaperSize.y = tmp;
- }
- PRINTDLG_PS_ChangePaperPrev(pda);
- break;
case cmb1: /* Printer combo */
if(msg == CBN_SELCHANGE){
char crPrinterName[256];
@@ -2890,10 +2950,10 @@
GETVAL(id, pda->curdlg.rtMargin.left);
break;
case edt5:
- GETVAL(id, pda->curdlg.rtMargin.right);
+ GETVAL(id, pda->curdlg.rtMargin.top);
break;
case edt6:
- GETVAL(id, pda->curdlg.rtMargin.top);
+ GETVAL(id, pda->curdlg.rtMargin.right);
break;
case edt7:
GETVAL(id, pda->curdlg.rtMargin.bottom);
@@ -2921,9 +2981,34 @@
EndDialog(hDlg, FALSE);
return FALSE ;
+ case rad1:
+ case rad2:
+ if((LOWORD(wParam) == rad1 && pda->curdlg.ptPaperSize.x >
pda->curdlg.ptPaperSize.y) ||
+ (LOWORD(wParam) == rad2 && pda->curdlg.ptPaperSize.y >
pda->curdlg.ptPaperSize.x))
+ {
+ WCHAR tmpText[25];
+ WCHAR tmpText2[25];
+ DWORD tmp = pda->curdlg.ptPaperSize.y;
+
+ pda->curdlg.ptPaperSize.y = pda->curdlg.ptPaperSize.x;
+ pda->curdlg.ptPaperSize.x = tmp;
+
+ GetDlgItemTextW(hDlg, edt4, tmpText, sizeof(tmpText)/sizeof(WCHAR));
+ GetDlgItemTextW(hDlg, edt5, tmpText2, sizeof(tmpText2)/sizeof(WCHAR));
+ SetDlgItemTextW(hDlg, edt5, tmpText);
+ SetDlgItemTextW(hDlg, edt4, tmpText2);
+
+ GetDlgItemTextW(hDlg, edt6, tmpText, sizeof(tmpText)/sizeof(WCHAR));
+ GetDlgItemTextW(hDlg, edt7, tmpText2, sizeof(tmpText2)/sizeof(WCHAR));
+ SetDlgItemTextW(hDlg, edt7, tmpText);
+ SetDlgItemTextW(hDlg, edt6, tmpText2);
+ }
+ break;
+
case psh3: {
pda->pdlg.Flags = 0;
pda->pdlg.hwndOwner = hDlg;
+ PRINTDLG_PS_UpdatePrintDlgW(pda, hDlg);
if (PrintDlgW(&(pda->pdlg)))
PRINTDLG_PS_ChangePrinterW(hDlg,pda);
return TRUE;
@@ -3069,12 +3154,12 @@
scalx = rcClient.right / (double)pda->curdlg.ptPaperSize.x;
scaly = rcClient.bottom / (double)pda->curdlg.ptPaperSize.y;
rcMargin = rcClient;
-
- rcMargin.left += (LONG)pda->curdlg.rtMargin.left * scalx;
- rcMargin.top += (LONG)pda->curdlg.rtMargin.top * scalx;
- rcMargin.right -= (LONG)pda->curdlg.rtMargin.right * scaly;
- rcMargin.bottom -= (LONG)pda->curdlg.rtMargin.bottom * scaly;
-
+
+ rcMargin.left += pda->curdlg.rtMargin.left * scalx;
+ rcMargin.top += pda->curdlg.rtMargin.top * scalx;
+ rcMargin.right -= pda->curdlg.rtMargin.right * scaly;
+ rcMargin.bottom -= pda->curdlg.rtMargin.bottom * scaly;
+
/* if the space is too small then we make sure to not draw anything */
rcMargin.left = min(rcMargin.left, rcMargin.right);
rcMargin.top = min(rcMargin.top, rcMargin.bottom);
@@ -3268,12 +3353,12 @@
{ '_', '_', 'W', 'I', 'N', 'E',
'_', 'P', 'A', 'G', 'E',
'S', 'E', 'T', 'U', 'P', 'D',
'L', 'G', 'D', 'A', 'T', 'A', 0 };
PageSetupDataW *pda;
- LPDEVMODEW dm;
BOOL res = FALSE;
if (uMsg==WM_INITDIALOG) {
res = TRUE;
pda = (PageSetupDataW*)lParam;
+ memcpy(&pda->curdlg, pda, sizeof(pda->curdlg));
SetPropW(hDlg, __WINE_PAGESETUPDLGDATA, pda);
if (pda->dlga->Flags & PSD_ENABLEPAGESETUPHOOK) {
res = pda->dlga->lpfnPageSetupHook(hDlg,uMsg,wParam,(LPARAM)pda->dlga);
@@ -3295,16 +3380,7 @@
EnableWindow(GetDlgItem(hDlg, edt7), FALSE);
}
- if(pda->dlga->hDevMode)
- {
- dm = GlobalLock(pda->dlga->hDevMode);
- /* Landscape orientation */
- if (dm->u1.s1.dmOrientation == DMORIENT_LANDSCAPE)
- CheckRadioButton(hDlg, rad1, rad2, rad2);
- else /* this is default if papersize is not set */
- CheckRadioButton(hDlg, rad1, rad2, rad1);
- GlobalUnlock(pda->dlga->hDevMode);
- }
+ PRINTDLG_PS_ChangePrinterW(hDlg,pda);
if (pda->dlga->Flags & PSD_DISABLEORIENTATION) {
EnableWindow(GetDlgItem(hDlg,rad1),FALSE);
@@ -3331,7 +3407,7 @@
SetDlgItemTextW(hDlg,edt6,str);
SetDlgItemTextW(hDlg,edt7,str);
}
- PRINTDLG_PS_ChangePrinterW(hDlg,pda);
+
if (pda->dlga->Flags & PSD_DISABLEPAPER) {
EnableWindow(GetDlgItem(hDlg,cmb2),FALSE);
EnableWindow(GetDlgItem(hDlg,cmb3),FALSE);