[[email protected]: The printer setup dialog]

Huw D M Davies h.davies1 at physics.ox.ac.uk
Mon Feb 5 06:13:54 CST 2001


These look good; forwarded from wine-devel.

Huw.
----- Forwarded message from Duane Clark <dclark at akamail.com> -----

Envelope-to: daviesh at nodens.physics.ox.ac.uk
Delivery-date: Mon, 05 Feb 2001 01:09:48 +0000
From: Duane Clark <dclark at akamail.com>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.12-20 i686)
X-Accept-Language: en
To: Wine Devel <wine-devel at winehq.com>
Subject: The printer setup dialog
Errors-To: wine-devel-admin at winehq.com
X-BeenThere: wine-devel at winehq.com
X-Mailman-Version: 2.0
Precedence: bulk
List-Help: <mailto:wine-devel-request at winehq.com?subject=help>
List-Post: <mailto:wine-devel at winehq.com>
List-Subscribe: <http://www.winehq.com/mailman/listinfo/wine-devel>,
	<mailto:wine-devel-request at winehq.com?subject=subscribe>
List-Id: Wine Developer's List <wine-devel.winehq.com>
List-Unsubscribe: <http://www.winehq.com/mailman/listinfo/wine-devel>,
	<mailto:wine-devel-request at winehq.com?subject=unsubscribe>
List-Archive: <http://www.winehq.com/hypermail/wine-devel/>
Date: Sun, 04 Feb 2001 16:48:55 -0800
X-AVtransport: scanmails_remote
X-AVwrapper: AMaViS (http://www.amavis.org/)
X-AVscanner: Sophos sweep (http://www.sophos.com/)

Howdy,

Since I see there has been a fair amount of activity on the printer
stuff lately, I thought I would try submitting this patch to hopefully
fix some things in the printer setup dialog box. I have been using this
patch unchanged for about six months, on a couple of different
applications under wine.

The patch contains two chunks. The first chunk attempts to fix these
problems in the Paper Size and Source combo boxes:
1) Every time the printer setup dialog is opened, the settings are set
back to garbage settings.
2) If the paper size or source is changed, and then the printer is
changed, the new printer does not get the new size and source settings
even though it appears to from the dialog.

The second chunk simply attempts to make the Landscape/Portrait buttons
do something. They were there and could be clicked on, and all the
supporting code for actually printing in a landscape orientation was
there, but the actual code for making the buttons invoke something was
for some mysterious reason missing.

Duane
Index: dlls/commdlg/printdlg.c
===================================================================
RCS file: /home/wine/wine/dlls/commdlg/printdlg.c,v
retrieving revision 1.34
diff -u -r1.34 printdlg.c
--- dlls/commdlg/printdlg.c	2001/01/22 02:13:58	1.34
+++ dlls/commdlg/printdlg.c	2001/02/05 00:13:50
@@ -373,8 +373,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) {
@@ -873,6 +895,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) {


----- End forwarded message -----

-- 
   Dr. Huw D M Davies              | Clarendon Laboratory
   h.davies1 at physics.ox.ac.uk      | Parks Road
   Tel: +44 1865 272390            | Oxford OX1 3PU
   Fax: +44 1865 272400            | UK




More information about the wine-patches mailing list