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]
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);
}
{
HDC hDC;
long temp;
- int w = LOWORD(GetDialogBaseUnits());
+ int w = LOWORD(GetDialogBaseUnits()) / 2;
POINT points[3];
int height;
int oben;
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;
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);
}
}
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;
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 )
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);
}
}
rect.bottom = rect.top;
}
GetClientRect(hwnd, &rect);
- FrameRect(hDC, &rect, GetStockObject(BLACK_BRUSH) );
+ DrawEdge(hDC, &rect, BDR_SUNKENOUTER, BF_RECT);
ReleaseDC(hwnd, hDC);
}
}
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;
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);
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;
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);
}
-
/***********************************************************************
* CC_HookCallChk [internal]
*/
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;
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);
<?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>
<file>rsrc.rc</file>
<file>comdlg32.spec</file>
</module>
+</group>
if(lstrlenW(lpstrPathAndFile) < fodInfos->ofnInfos->nMaxFile -
((fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT) ? 1 : 0))
{
- LPWSTR lpszTemp;
/* fill destination buffer */
if (fodInfos->ofnInfos->lpstrFile)
}
}
- /* set filename offset */
- lpszTemp = PathFindFileNameW(lpstrPathAndFile);
- fodInfos->ofnInfos->nFileOffset = (lpszTemp - lpstrPathAndFile);
+ 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 = PathFindExtensionW(lpstrPathAndFile);
- fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? (lpszTemp - lpstrPathAndFile) + 1 : 0;
+ /* set extension offset */
+ lpszTemp = PathFindExtensionA(ofn->lpstrFile);
+ fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? (lpszTemp - ofn->lpstrFile) + 1 : 0;
+ }
/* set the lpstrFileTitle */
if(fodInfos->ofnInfos->lpstrFileTitle)
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;
}
}
return lfs->callbacks->CWP(lfs, wMsg, wParam, lParam);
}
+/***********************************************************************
+ * FD31_GetFileType [internal]
+ */
+static LPCWSTR FD31_GetFileType(LPCWSTR cfptr, LPCWSTR fptr, const WORD index)
+{
+ int n, i;
+ i = 0;
+ if (cfptr)
+ for ( ;(n = lstrlenW(cfptr)) != 0; i++)
+ {
+ cfptr += n + 1;
+ if (i == index)
+ return cfptr;
+ cfptr += lstrlenW(cfptr) + 1;
+ }
+ if (fptr)
+ for ( ;(n = lstrlenW(fptr)) != 0; i++)
+ {
+ fptr += n + 1;
+ if (i == index)
+ return fptr;
+ fptr += lstrlenW(fptr) + 1;
+ }
+ return FILE_star; /* FIXME */
+}
+
/***********************************************************************
* FD31_ScanDir [internal]
*/
-static BOOL FD31_ScanDir(HWND hWnd, LPCWSTR newPath)
+static BOOL FD31_ScanDir(const OPENFILENAMEW *ofn, HWND hWnd, LPCWSTR newPath)
{
WCHAR buffer[BUFFILE];
HWND hdlg, hdlgDir;
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));
+ lstrcpynW(buffer, FD31_GetFileType(ofn->lpstrCustomFilter,
+ ofn->lpstrFilter, ofn->nFilterIndex - 1), BUFFILE);
hCursorWait = LoadCursorA(0, (LPSTR)IDC_WAIT);
oldCursor = SetCursor(hCursorWait);
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;
+ SendMessageW(hdlg, LB_DIR, 0, (LPARAM)filter);
if (scptr) *scptr = ';';
filter = (scptr) ? (scptr + 1) : 0;
}
return lRet;
}
-/***********************************************************************
- * FD31_GetFileType [internal]
- */
-
-static LPCWSTR FD31_GetFileType(LPCWSTR cfptr, LPCWSTR fptr, const WORD index)
-{
- int n, i;
- i = 0;
- if (cfptr)
- for ( ;(n = lstrlenW(cfptr)) != 0; i++)
- {
- cfptr += n + 1;
- if (i == index)
- return cfptr;
- cfptr += lstrlenW(cfptr) + 1;
- }
- if (fptr)
- for ( ;(n = lstrlenW(fptr)) != 0; i++)
- {
- fptr += n + 1;
- if (i == index)
- return fptr;
- fptr += lstrlenW(fptr) + 1;
- }
- return FILE_star; /* FIXME */
-}
-
/***********************************************************************
* FD31_WMDrawItem [internal]
*/
}
strcatW(tmpstr, FILE_bslash);
- FD31_ScanDir(hWnd, tmpstr);
+ FD31_ScanDir(lfs->ofnW, hWnd, tmpstr);
/* notify the app */
if (lfs->hook)
{
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;
}
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 */
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;
}
FD31_UpdateFileTitle(lfs);
if (lfs->hook)
{
- lRet = (BOOL)FD31_CallWindowProc(lfs, lfs->fileokstring,
+ lRet = FD31_CallWindowProc(lfs, lfs->fileokstring,
0, lfs->lParam );
if (lRet)
{
{
if (ofnW->lpstrFile)
{
- LPWSTR str = (LPWSTR)ofnW->lpstrFile;
+ LPWSTR str = ofnW->lpstrFile;
LPWSTR ptr = strrchrW(str, '\\');
str[lstrlenW(str) + 1] = '\0';
*ptr = 0;
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 );
}
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);
}
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 */
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;
}
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");
}
}
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)
{
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);
}
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);
/***********************************************************************
* ChooseFontA (COMDLG32.@)
*
- * See ChosseFontW.
+ * See ChooseFontW.
*/
BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
{
typedef struct {
LPPAGESETUPDLGW dlga;
PRINTDLGW pdlg;
+ PAGESETUPDLGW curdlg; /* Current dialog state */
} PageSetupDataW;
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;
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;
}
}
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;
- }
- 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;
- }
+ 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;
+ }
+ break;
case cmb1: /* Printer combo */
if(msg == CBN_SELCHANGE){
char crPrinterName[256];
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);
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;
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);
{ '_', '_', '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);
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);
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);