Duane Clark wrote: > > Howdy, > > I wanted to propose a couple of simple fixes for the printer setup > dialogs, and I thought this might be a better forum for my first attempt > at at a Wine patch... Well, the first problem I see is that my email program word wrapped some of the lines in the patch, sorry about that. Probably an attachment would be better, so hopefully people won't object too strongly to a second attempt.
/home/wine/dlls/commdlg > cvs diff -u printdlg.c Index: printdlg.c =================================================================== RCS file: /home/wine/wine/dlls/commdlg/printdlg.c,v retrieving revision 1.26 diff -u -r1.26 printdlg.c --- printdlg.c 2000/06/02 19:36:53 1.26 +++ printdlg.c 2000/06/24 05:24:53 @@ -320,8 +320,30 @@ /* query the dialog box for the current selected value */ Sel = SendDlgItemMessageA(hDlg, nIDComboBox, CB_GETCURSEL, 0, 0); if(Sel != CB_ERR) { - oldWord = SendDlgItemMessageA(hDlg, nIDComboBox, CB_GETITEMDATA, Sel, - 0); + /* we enter here only if a different printer is selected after + * the Print Setup dialog is opened. The current settings are + * stored into the newly selected printer. + */ + oldWord = SendDlgItemMessageA(hDlg, nIDComboBox, CB_GETITEMDATA, + Sel, 0); + if (dm) { + if (nIDComboBox == cmb2) + dm->u1.s1.dmPaperSize = oldWord; + else + dm->dmDefaultSource = oldWord; + } + } + else { + /* we enter here only when the Print setup dialog is initially + * opened. In this case the settings are restored from when + * the dialog was last closed. + */ + if (dm) { + if (nIDComboBox == cmb2) + oldWord = dm->u1.s1.dmPaperSize; + else + oldWord = dm->dmDefaultSource; + } } if (nIDComboBox == cmb2) { @@ -718,6 +740,16 @@ break; } + case rad1: /* Paperorientation */ + if (lppd->Flags & PD_PRINTSETUP) + lpdm->u1.s1.dmOrientation = DMORIENT_PORTRAIT; + break; + + case rad2: /* Paperorientation */ + if (lppd->Flags & PD_PRINTSETUP) + lpdm->u1.s1.dmOrientation = DMORIENT_LANDSCAPE; + break; + case cmb1: case cmb4: /* Printer combobox */ if (HIWORD(wParam)==CBN_SELCHANGE) {