winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2009
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1348 discussions
Start a n
N
ew thread
Huw Davies : comdlg32: Add a helper for setting the defaultsource.
by Alexandre Julliard
20 Jan '09
20 Jan '09
Module: wine Branch: master Commit: b6ed969ee5c9b8516c84eb4d115da93e0af4a7fb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b6ed969ee5c9b8516c84eb4d1…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Jan 19 16:57:24 2009 +0000 comdlg32: Add a helper for setting the defaultsource. --- dlls/comdlg32/printdlg.c | 33 ++++++++++++++++++--------------- 1 files changed, 18 insertions(+), 15 deletions(-) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index 0634381..3e5eac3 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -2590,6 +2590,13 @@ static WORD pagesetup_get_papersize(PageSetupDataA *pda) return paper; } +static void pagesetup_set_defaultsource(PageSetupDataA *pda, WORD source) +{ + DEVMODEA *dm = GlobalLock(pda->dlga->hDevMode); + dm->u1.s1.dmDefaultSource = source; + GlobalUnlock(pda->dlga->hDevMode); +} + static BOOL pagesetup_update_papersize(PageSetupDataA *pda) { DEVNAMES *dn; @@ -3070,14 +3077,14 @@ PRINTDLG_PS_WMCommandA( FIXME("could not get dialog text for papersize cmbbox?\n"); } break; - case cmb3: - if(msg == CBN_SELCHANGE){ - DEVMODEA *dm = GlobalLock(pda->dlga->hDevMode); - dm->u1.s1.dmDefaultSource = SendDlgItemMessageA(hDlg, cmb3,CB_GETITEMDATA, - SendDlgItemMessageA(hDlg, cmb3, CB_GETCURSEL, 0, 0), 0); - GlobalUnlock(pda->dlga->hDevMode); - } - break; + case cmb3: /* Paper Source */ + if(msg == CBN_SELCHANGE) + { + WORD source = SendDlgItemMessageA(hDlg, cmb3, CB_GETITEMDATA, + SendDlgItemMessageA(hDlg, cmb3, CB_GETCURSEL, 0, 0), 0); + pagesetup_set_defaultsource(pda, source); + } + break; case psh2: /* Printer Properties button */ { HANDLE hPrinter; @@ -3419,7 +3426,6 @@ static void subclass_margin_edits(HWND hDlg) static INT_PTR CALLBACK PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - DEVMODEA *dm; PageSetupDataA *pda; INT_PTR res = FALSE; HWND hDrawWnd; @@ -3489,15 +3495,12 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) EnableWindow(GetDlgItem(hDlg,cmb2),FALSE); EnableWindow(GetDlgItem(hDlg,cmb3),FALSE); } + /* filling combos: printer, paper, source. selecting current printer (from DEVMODEA) */ PRINTDLG_PS_ChangePrinterA(hDlg, pda); pagesetup_update_papersize(pda); - dm = GlobalLock(pda->dlga->hDevMode); - if(dm){ - dm->u1.s1.dmDefaultSource = 15; /*FIXME: Automatic select. Does it always 15 at start? */ - GlobalUnlock(pda->dlga->hDevMode); - } else - WARN("GlobalLock(pda->dlga->hDevMode) fail? hDevMode=%p\n", pda->dlga->hDevMode); + pagesetup_set_defaultsource(pda, DMBIN_FORMSOURCE); /* FIXME: This is the auto select bin. Is this correct? */ + /* Drawing paper prev */ PRINTDLG_PS_ChangePaperPrev(pda); return TRUE;
1
0
0
0
Huw Davies : comdlg32: Add helpers for getting and setting the devmode papersize.
by Alexandre Julliard
20 Jan '09
20 Jan '09
Module: wine Branch: master Commit: 562dd4ab65c11d7221d4a1092643dd447e6b22b9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=562dd4ab65c11d7221d4a1092…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Jan 19 16:38:43 2009 +0000 comdlg32: Add helpers for getting and setting the devmode papersize. --- dlls/comdlg32/printdlg.c | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index d58ddb2..0634381 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -2575,13 +2575,28 @@ static WORD pagesetup_get_orientation(PageSetupDataA *pda) return orient; } +static void pagesetup_set_papersize(PageSetupDataA *pda, WORD paper) +{ + DEVMODEA *dm = GlobalLock(pda->dlga->hDevMode); + dm->u1.s1.dmPaperSize = paper; + GlobalUnlock(pda->dlga->hDevMode); +} + +static WORD pagesetup_get_papersize(PageSetupDataA *pda) +{ + DEVMODEA *dm = GlobalLock(pda->dlga->hDevMode); + WORD paper = dm->u1.s1.dmPaperSize; + GlobalUnlock(pda->dlga->hDevMode); + return paper; +} + static BOOL pagesetup_update_papersize(PageSetupDataA *pda) { DEVNAMES *dn; DEVMODEA *dm; LPSTR devname, portname; int i, num; - WORD *words = NULL; + WORD *words = NULL, paperword; POINT *points = NULL; BOOL retval = FALSE; @@ -2612,13 +2627,15 @@ static BOOL pagesetup_update_papersize(PageSetupDataA *pda) goto end; } + paperword = pagesetup_get_papersize(pda); + for (i = 0; i < num; i++) - if (words[i] == dm->u1.s1.dmPaperSize) + if (words[i] == paperword) break; if (i == num) { - FIXME("Papersize %d not found in list?\n", dm->u1.s1.dmPaperSize); + FIXME("Papersize %d not found in list?\n", paperword); goto end; } @@ -3046,9 +3063,7 @@ PRINTDLG_PS_WMCommandA( SendDlgItemMessageA(hDlg, cmb2, CB_GETCURSEL, 0, 0), 0); if (paperword != CB_ERR) { - DEVMODEA *dm = GlobalLock(pda->dlga->hDevMode); - dm->u1.s1.dmPaperSize = paperword; - GlobalUnlock(pda->dlga->hDevMode); + pagesetup_set_papersize(pda, paperword); pagesetup_update_papersize(pda); PRINTDLG_PS_ChangePaperPrev(pda); } else @@ -3090,9 +3105,10 @@ PRINTDLG_PS_WMCommandA( PRINTDLG_PS_ChangePaperPrev(pda); /* Selecting paper in combo */ count = SendDlgItemMessageA(hDlg, cmb2, CB_GETCOUNT, 0, 0); - if(count != CB_ERR){ + if(count != CB_ERR) { + WORD paperword = pagesetup_get_papersize(pda); for(i=0; i<count; ++i){ - if(SendDlgItemMessageA(hDlg, cmb2, CB_GETITEMDATA, i, 0) == dm->u1.s1.dmPaperSize) { + if(SendDlgItemMessageA(hDlg, cmb2, CB_GETITEMDATA, i, 0) == paperword) { SendDlgItemMessageA(hDlg, cmb2, CB_SETCURSEL, i, 0); break; }
1
0
0
0
Huw Davies : comdlg32: Add a helper for getting the orientation.
by Alexandre Julliard
20 Jan '09
20 Jan '09
Module: wine Branch: master Commit: c1209a68c3484159129ceb93b1d3ab0b05360835 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c1209a68c3484159129ceb93b…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Jan 19 15:52:09 2009 +0000 comdlg32: Add a helper for getting the orientation. --- dlls/comdlg32/printdlg.c | 30 +++++++++++++++++------------- 1 files changed, 17 insertions(+), 13 deletions(-) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index 45b8fb9..d58ddb2 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -2567,6 +2567,14 @@ static void pagesetup_set_orientation(PageSetupDataA *pda, WORD orient) GlobalUnlock(pda->dlga->hDevMode); } +static WORD pagesetup_get_orientation(PageSetupDataA *pda) +{ + DEVMODEA *dm = GlobalLock(pda->dlga->hDevMode); + WORD orient = dm->u1.s1.dmOrientation; + GlobalUnlock(pda->dlga->hDevMode); + return orient; +} + static BOOL pagesetup_update_papersize(PageSetupDataA *pda) { DEVNAMES *dn; @@ -2618,7 +2626,7 @@ static BOOL pagesetup_update_papersize(PageSetupDataA *pda) pda->dlga->ptPaperSize.x = _c_10mm2size(pda->dlga, points[i].x); pda->dlga->ptPaperSize.y = _c_10mm2size(pda->dlga, points[i].y); - if(dm->u1.s1.dmOrientation == DMORIENT_LANDSCAPE) + if(pagesetup_get_orientation(pda) == DMORIENT_LANDSCAPE) { LONG tmp = pda->dlga->ptPaperSize.x; pda->dlga->ptPaperSize.x = pda->dlga->ptPaperSize.y; @@ -3014,8 +3022,8 @@ PRINTDLG_PS_WMCommandA( } case rad1: case rad2: - if((id == rad1 && pda->dlga->ptPaperSize.x > pda->dlga->ptPaperSize.y) || - (id == rad2 && pda->dlga->ptPaperSize.y > pda->dlga->ptPaperSize.x)) + if((id == rad1 && pagesetup_get_orientation(pda) == DMORIENT_LANDSCAPE) || + (id == rad2 && pagesetup_get_orientation(pda) == DMORIENT_PORTRAIT)) { pagesetup_set_orientation(pda, (id == rad1) ? DMORIENT_PORTRAIT : DMORIENT_LANDSCAPE); pagesetup_update_papersize(pda); @@ -3074,7 +3082,7 @@ PRINTDLG_PS_WMCommandA( ClosePrinter(hPrinter); /* Changing paper */ pagesetup_update_papersize(pda); - if (dm->u1.s1.dmOrientation == DMORIENT_LANDSCAPE) + if (pagesetup_get_orientation(pda) == DMORIENT_LANDSCAPE) CheckRadioButton(hDlg, rad1, rad2, rad2); else CheckRadioButton(hDlg, rad1, rad2, rad1); @@ -3433,16 +3441,12 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) EnableWindow(GetDlgItem(hDlg, edt6), FALSE); EnableWindow(GetDlgItem(hDlg, edt7), FALSE); } + /* Set orientation radiobutton properly */ - if(pda->dlga->hDevMode) - { - dm = GlobalLock(pda->dlga->hDevMode); - 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); - } + if (pagesetup_get_orientation(pda) == DMORIENT_LANDSCAPE) + CheckRadioButton(hDlg, rad1, rad2, rad2); + else + CheckRadioButton(hDlg, rad1, rad2, rad1); /* if orientation disabled */ if (pda->dlga->Flags & PSD_DISABLEORIENTATION) {
1
0
0
0
Huw Davies : comdlg32: Add a helper for setting the orientation.
by Alexandre Julliard
20 Jan '09
20 Jan '09
Module: wine Branch: master Commit: 6b6adccc8cc884af019dc5be05c737cc33d195d8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6b6adccc8cc884af019dc5be0…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Jan 19 15:40:02 2009 +0000 comdlg32: Add a helper for setting the orientation. --- dlls/comdlg32/printdlg.c | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index c157799..45b8fb9 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -2557,6 +2557,16 @@ static inline void rotate_rect(RECT *rc, BOOL sense) } } +static void pagesetup_set_orientation(PageSetupDataA *pda, WORD orient) +{ + DEVMODEA *dm = GlobalLock(pda->dlga->hDevMode); + + assert(orient == DMORIENT_PORTRAIT || orient == DMORIENT_LANDSCAPE); + + dm->u1.s1.dmOrientation = orient; + GlobalUnlock(pda->dlga->hDevMode); +} + static BOOL pagesetup_update_papersize(PageSetupDataA *pda) { DEVNAMES *dn; @@ -3007,18 +3017,10 @@ PRINTDLG_PS_WMCommandA( if((id == rad1 && pda->dlga->ptPaperSize.x > pda->dlga->ptPaperSize.y) || (id == rad2 && pda->dlga->ptPaperSize.y > pda->dlga->ptPaperSize.x)) { - DWORD tmp = pda->dlga->ptPaperSize.x; - DEVMODEA *dm = GlobalLock(pda->dlga->hDevMode); - - pda->dlga->ptPaperSize.x = pda->dlga->ptPaperSize.y; - pda->dlga->ptPaperSize.y = tmp; - - dm->u1.s1.dmOrientation = (id == rad1) ? DMORIENT_PORTRAIT : DMORIENT_LANDSCAPE; - GlobalUnlock(pda->dlga->hDevMode); - + pagesetup_set_orientation(pda, (id == rad1) ? DMORIENT_PORTRAIT : DMORIENT_LANDSCAPE); + pagesetup_update_papersize(pda); rotate_rect(&pda->dlga->rtMargin, (id == rad2)); update_margin_edits(hDlg, pda, 0); - PRINTDLG_PS_ChangePaperPrev(pda); } break;
1
0
0
0
Huw Davies : comdlg32: Let pagesetup_update_papersize take care of landscape mode.
by Alexandre Julliard
20 Jan '09
20 Jan '09
Module: wine Branch: master Commit: e75b7ad74523854b764feae2cb70b14440ef4039 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e75b7ad74523854b764feae2c…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Jan 19 15:33:05 2009 +0000 comdlg32: Let pagesetup_update_papersize take care of landscape mode. --- dlls/comdlg32/printdlg.c | 60 ++++++++++++++++++++-------------------------- 1 files changed, 26 insertions(+), 34 deletions(-) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index f9f1ba1..c157799 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -25,6 +25,7 @@ #include <stdarg.h> #include <stdio.h> #include <string.h> +#include <assert.h> #define NONAMELESSUNION #define NONAMELESSSTRUCT @@ -2556,7 +2557,7 @@ static inline void rotate_rect(RECT *rc, BOOL sense) } } -static BOOL pagesetup_papersizeA(PAGESETUPDLGA *dlg, const WORD paperword, LPPOINT size) +static BOOL pagesetup_update_papersize(PageSetupDataA *pda) { DEVNAMES *dn; DEVMODEA *dm; @@ -2566,8 +2567,8 @@ static BOOL pagesetup_papersizeA(PAGESETUPDLGA *dlg, const WORD paperword, LPPOI POINT *points = NULL; BOOL retval = FALSE; - dn = GlobalLock(dlg->hDevNames); - dm = GlobalLock(dlg->hDevMode); + dn = GlobalLock(pda->dlga->hDevNames); + dm = GlobalLock(pda->dlga->hDevMode); devname = ((char*)dn)+dn->wDeviceOffset; portname = ((char*)dn)+dn->wOutputOffset; @@ -2594,25 +2595,32 @@ static BOOL pagesetup_papersizeA(PAGESETUPDLGA *dlg, const WORD paperword, LPPOI } for (i = 0; i < num; i++) - if (words[i] == paperword) + if (words[i] == dm->u1.s1.dmPaperSize) break; if (i == num) { - FIXME("Papersize %d not found in list?\n", paperword); + FIXME("Papersize %d not found in list?\n", dm->u1.s1.dmPaperSize); goto end; } /* this is _10ths_ of a millimeter */ - size->x = _c_10mm2size(dlg, points[i].x); - size->y = _c_10mm2size(dlg, points[i].y); + pda->dlga->ptPaperSize.x = _c_10mm2size(pda->dlga, points[i].x); + pda->dlga->ptPaperSize.y = _c_10mm2size(pda->dlga, points[i].y); + + if(dm->u1.s1.dmOrientation == DMORIENT_LANDSCAPE) + { + LONG tmp = pda->dlga->ptPaperSize.x; + pda->dlga->ptPaperSize.x = pda->dlga->ptPaperSize.y; + pda->dlga->ptPaperSize.y = tmp; + } retval = TRUE; end: HeapFree(GetProcessHeap(), 0, words); HeapFree(GetProcessHeap(), 0, points); - GlobalUnlock(dlg->hDevNames); - GlobalUnlock(dlg->hDevMode); + GlobalUnlock(pda->dlga->hDevNames); + GlobalUnlock(pda->dlga->hDevMode); return retval; } @@ -3031,12 +3039,7 @@ PRINTDLG_PS_WMCommandA( DEVMODEA *dm = GlobalLock(pda->dlga->hDevMode); dm->u1.s1.dmPaperSize = paperword; GlobalUnlock(pda->dlga->hDevMode); - pagesetup_papersizeA(pda->dlga, paperword, &(pda->dlga->ptPaperSize)); - if (IsDlgButtonChecked(hDlg, rad2)) { - DWORD tmp = pda->dlga->ptPaperSize.x; - pda->dlga->ptPaperSize.x = pda->dlga->ptPaperSize.y; - pda->dlga->ptPaperSize.y = tmp; - } + pagesetup_update_papersize(pda); PRINTDLG_PS_ChangePaperPrev(pda); } else FIXME("could not get dialog text for papersize cmbbox?\n"); @@ -3068,13 +3071,9 @@ PRINTDLG_PS_WMCommandA( DM_IN_BUFFER | DM_OUT_BUFFER | DM_IN_PROMPT); ClosePrinter(hPrinter); /* Changing paper */ - pagesetup_papersizeA(pda->dlga, dm->u1.s1.dmPaperSize, &(pda->dlga->ptPaperSize)); - if (dm->u1.s1.dmOrientation == DMORIENT_LANDSCAPE){ - DWORD tmp = pda->dlga->ptPaperSize.x; - pda->dlga->ptPaperSize.x = pda->dlga->ptPaperSize.y; - pda->dlga->ptPaperSize.y = tmp; + pagesetup_update_papersize(pda); + if (dm->u1.s1.dmOrientation == DMORIENT_LANDSCAPE) CheckRadioButton(hDlg, rad1, rad2, rad2); - } else CheckRadioButton(hDlg, rad1, rad2, rad1); /* Changing paper preview */ @@ -3470,16 +3469,11 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) } /* filling combos: printer, paper, source. selecting current printer (from DEVMODEA) */ PRINTDLG_PS_ChangePrinterA(hDlg, pda); + pagesetup_update_papersize(pda); dm = GlobalLock(pda->dlga->hDevMode); if(dm){ dm->u1.s1.dmDefaultSource = 15; /*FIXME: Automatic select. Does it always 15 at start? */ - pagesetup_papersizeA(pda->dlga, dm->u1.s1.dmPaperSize, &pda->dlga->ptPaperSize); GlobalUnlock(pda->dlga->hDevMode); - if (IsDlgButtonChecked(hDlg, rad2) == BST_CHECKED) { /* Landscape orientation */ - DWORD tmp = pda->dlga->ptPaperSize.y; - pda->dlga->ptPaperSize.y = pda->dlga->ptPaperSize.x; - pda->dlga->ptPaperSize.x = tmp; - } } else WARN("GlobalLock(pda->dlga->hDevMode) fail? hDevMode=%p\n", pda->dlga->hDevMode); /* Drawing paper prev */ @@ -3671,12 +3665,13 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg) { setupdlg->hDevNames = pdlg.hDevNames; } + pda = HeapAlloc(GetProcessHeap(),0,sizeof(*pda)); + pda->dlga = setupdlg; + /* short cut exit, just return default values */ if (setupdlg->Flags & PSD_RETURNDEFAULT) { - DEVMODEA *dm; - dm = GlobalLock(setupdlg->hDevMode); - pagesetup_papersizeA(setupdlg, dm->u1.s1.dmPaperSize, &setupdlg->ptPaperSize); - GlobalUnlock(setupdlg->hDevMode); + pagesetup_update_papersize(pda); + HeapFree(GetProcessHeap(), 0, pda); return TRUE; } @@ -3692,9 +3687,6 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg) { return FALSE; } - pda = HeapAlloc(GetProcessHeap(),0,sizeof(*pda)); - pda->dlga = setupdlg; - bRet = (0<DialogBoxIndirectParamW( setupdlg->hInstance, ptr,
1
0
0
0
Huw Davies : comdlg32: Switch to using a locale dependent decimal separator .
by Alexandre Julliard
20 Jan '09
20 Jan '09
Module: wine Branch: master Commit: 276434caa9264d20cf962966f06516c15c244404 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=276434caa9264d20cf962966f…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Jan 19 14:28:43 2009 +0000 comdlg32: Switch to using a locale dependent decimal separator. --- dlls/comdlg32/printdlg.c | 29 +++++++++++++++++++---------- 1 files changed, 19 insertions(+), 10 deletions(-) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index 54de61e..f9f1ba1 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -2416,26 +2416,38 @@ _c_inch2size(PAGESETUPDLGA *dlga,DWORD size) { return (size*254)/100; } +static WCHAR get_decimal_sep(void) +{ + static WCHAR sep; + + if(!sep) + { + WCHAR buf[2] = {'.',0}; + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, buf, sizeof(buf) / sizeof(buf[0])); + sep = buf[0]; + } + return sep; +} + static void size2str(const PageSetupDataA *pda, DWORD size, LPWSTR strout) { - WCHAR decimal[2] = {'.', 0}; WCHAR integer_fmt[] = {'%','d',0}; - WCHAR hundredths_fmt[] = {'%','d','%','s','%','0','2','d',0}; - WCHAR thousandths_fmt[] = {'%','d','%','s','%','0','3','d',0}; + WCHAR hundredths_fmt[] = {'%','d','%','c','%','0','2','d',0}; + WCHAR thousandths_fmt[] = {'%','d','%','c','%','0','3','d',0}; /* FIXME use LOCALE_SDECIMAL when the edit parsing code can cope */ if (is_metric(pda)) { if(size % 100) - wsprintfW(strout, hundredths_fmt, size / 100, decimal, size % 100); + wsprintfW(strout, hundredths_fmt, size / 100, get_decimal_sep(), size % 100); else wsprintfW(strout, integer_fmt, size / 100); } else { if(size % 1000) - wsprintfW(strout, thousandths_fmt, size / 1000, decimal, size % 1000); + wsprintfW(strout, thousandths_fmt, size / 1000, get_decimal_sep(), size % 1000); else wsprintfW(strout, integer_fmt, size / 1000); @@ -2896,7 +2908,7 @@ static void margin_edit_notification(HWND hDlg, PageSetupDataA *pda, WORD msg, W if (GetDlgItemTextW(hDlg, id, buf, sizeof(buf) / sizeof(buf[0])) != 0) { WCHAR *end; - WCHAR decimal = '.'; + WCHAR decimal = get_decimal_sep(); val = strtolW(buf, &end, 10); if(end != buf || *end == decimal) @@ -3351,13 +3363,10 @@ PRINTDLG_PagePaintProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) */ static LRESULT CALLBACK pagesetup_margin_editproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { - WCHAR decimal = '.'; - - /* FIXME use LOCALE_SDECIMAL when the edit parsing code can cope */ - switch(msg) case WM_CHAR: { + WCHAR decimal = get_decimal_sep(); WCHAR wc = (WCHAR)wparam; if(!isdigitW(wc) && wc != decimal && wc != VK_BACK) return 0; }
1
0
0
0
Huw Davies : comdlg32: Fix parsing of the margin edit controls.
by Alexandre Julliard
20 Jan '09
20 Jan '09
Module: wine Branch: master Commit: 5f15c1c12ea1846e8bbb7405b54911770fef41f3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5f15c1c12ea1846e8bbb7405b…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Jan 19 14:11:20 2009 +0000 comdlg32: Fix parsing of the margin edit controls. --- dlls/comdlg32/printdlg.c | 66 ++++++++++++++++++++++++++++++++------------- 1 files changed, 47 insertions(+), 19 deletions(-) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index 41ead34..54de61e 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -2856,14 +2856,6 @@ PRINTDLG_PS_ChangePaperPrev(const PageSetupDataA *pda) return TRUE; } -#define GETVAL(idc,val) \ -if(msg == EN_CHANGE){ \ - if (GetDlgItemTextA(hDlg,idc,buf,sizeof(buf)) > 0)\ - val = _c_str2sizeA(pda->dlga,buf); \ - else\ - FIXME("could not get dlgitemtexta for %x\n",id); \ -} - static inline LONG *element_from_margin_id(RECT *rc, WORD id) { switch(id) @@ -2891,6 +2883,50 @@ static void update_margin_edits(HWND hDlg, const PageSetupDataA *pda, WORD id) } } +static void margin_edit_notification(HWND hDlg, PageSetupDataA *pda, WORD msg, WORD id) +{ + switch (msg) + { + case EN_CHANGE: + { + WCHAR buf[10]; + LONG val = 0; + LONG *value = element_from_margin_id(&pda->dlga->rtMargin, id); + + if (GetDlgItemTextW(hDlg, id, buf, sizeof(buf) / sizeof(buf[0])) != 0) + { + WCHAR *end; + WCHAR decimal = '.'; + + val = strtolW(buf, &end, 10); + if(end != buf || *end == decimal) + { + int mult = is_metric(pda) ? 100 : 1000; + val *= mult; + if(*end == decimal) + { + while(mult > 1) + { + end++; + mult /= 10; + if(isdigitW(*end)) + val += (*end - '0') * mult; + else + break; + } + } + } + } + *value = val; + return; + } + + case EN_KILLFOCUS: + update_margin_edits(hDlg, pda, id); + return; + } +} + static void set_margin_groupbox_title(HWND hDlg, const PageSetupDataA *pda) { WCHAR title[256]; @@ -2917,8 +2953,7 @@ PRINTDLG_PS_WMCommandA( ) { WORD msg = HIWORD(wParam); WORD id = LOWORD(wParam); - char buf[200]; - + TRACE("loword (lparam) %d, wparam 0x%lx, lparam %08lx\n", LOWORD(lParam),wParam,lParam); switch (id) { @@ -3047,22 +3082,15 @@ PRINTDLG_PS_WMCommandA( break; } case edt4: - GETVAL(id, pda->dlga->rtMargin.left); - break; case edt5: - GETVAL(id, pda->dlga->rtMargin.top); - break; case edt6: - GETVAL(id, pda->dlga->rtMargin.right); - break; case edt7: - GETVAL(id, pda->dlga->rtMargin.bottom); - break; + margin_edit_notification(hDlg, pda, msg, id); + break; } InvalidateRect(GetDlgItem(hDlg, rct1), NULL, TRUE); return FALSE; } -#undef GETVAL static BOOL PRINTDLG_PS_WMCommandW(
1
0
0
0
Huw Davies : comdlg32: Give update_margin_edits the ability to update just one edit control if required .
by Alexandre Julliard
20 Jan '09
20 Jan '09
Module: wine Branch: master Commit: 11e028be8e62c5e952880bc9dc5d4b90a83ba892 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=11e028be8e62c5e952880bc9d…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Jan 19 12:50:51 2009 +0000 comdlg32: Give update_margin_edits the ability to update just one edit control if required. --- dlls/comdlg32/printdlg.c | 35 ++++++++++++++++++++++++----------- 1 files changed, 24 insertions(+), 11 deletions(-) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index 8217d0a..41ead34 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -2864,18 +2864,31 @@ if(msg == EN_CHANGE){ \ FIXME("could not get dlgitemtexta for %x\n",id); \ } -static void update_margin_edits(HWND hDlg, const PageSetupDataA *pda) +static inline LONG *element_from_margin_id(RECT *rc, WORD id) +{ + switch(id) + { + case edt4: return &rc->left; + case edt5: return &rc->top; + case edt6: return &rc->right; + case edt7: return &rc->bottom; + } + return NULL; +} + +static void update_margin_edits(HWND hDlg, const PageSetupDataA *pda, WORD id) { WCHAR str[100]; + WORD idx; - size2str(pda, pda->dlga->rtMargin.left, str); - SetDlgItemTextW(hDlg, edt4, str); - size2str(pda, pda->dlga->rtMargin.top, str); - SetDlgItemTextW(hDlg, edt5, str); - size2str(pda, pda->dlga->rtMargin.right, str); - SetDlgItemTextW(hDlg, edt6, str); - size2str(pda, pda->dlga->rtMargin.bottom, str); - SetDlgItemTextW(hDlg, edt7, str); + for(idx = edt4; idx <= edt7; idx++) + { + if(id == 0 || id == idx) + { + size2str(pda, *element_from_margin_id(&pda->dlga->rtMargin, idx), str); + SetDlgItemTextW(hDlg, idx, str); + } + } } static void set_margin_groupbox_title(HWND hDlg, const PageSetupDataA *pda) @@ -2949,7 +2962,7 @@ PRINTDLG_PS_WMCommandA( GlobalUnlock(pda->dlga->hDevMode); rotate_rect(&pda->dlga->rtMargin, (id == rad2)); - update_margin_edits(hDlg, pda); + update_margin_edits(hDlg, pda, 0); PRINTDLG_PS_ChangePaperPrev(pda); } @@ -3409,7 +3422,7 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) pda->dlga->rtMargin.right = size; pda->dlga->rtMargin.bottom = size; } - update_margin_edits(hDlg, pda); + update_margin_edits(hDlg, pda, 0); subclass_margin_edits(hDlg); set_margin_groupbox_title(hDlg, pda);
1
0
0
0
Michael Stefaniuc : ole32/tests: Remove superfluous pointer casts.
by Alexandre Julliard
20 Jan '09
20 Jan '09
Module: wine Branch: master Commit: bdbfac59968bd685881142e7ac009efc4a6ae2a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bdbfac59968bd685881142e7a…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Jan 20 11:21:23 2009 +0100 ole32/tests: Remove superfluous pointer casts. --- dlls/ole32/tests/clipboard.c | 4 ++-- dlls/ole32/tests/compobj.c | 8 ++++---- dlls/ole32/tests/marshal.c | 32 ++++++++++++++++---------------- dlls/ole32/tests/moniker.c | 4 ++-- dlls/ole32/tests/ole2.c | 4 ++-- dlls/ole32/tests/stg_prop.c | 10 +++++----- dlls/ole32/tests/usrmarshal.c | 2 +- 7 files changed, 32 insertions(+), 32 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=bdbfac59968bd68588114…
1
0
0
0
Michael Stefaniuc : objsel: Remove superfluous pointer casts.
by Alexandre Julliard
20 Jan '09
20 Jan '09
Module: wine Branch: master Commit: 170f7f8dc19770421df2deb119e48b4ea404be40 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=170f7f8dc19770421df2deb11…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Jan 20 11:21:10 2009 +0100 objsel: Remove superfluous pointer casts. --- dlls/objsel/factory.c | 2 +- dlls/objsel/objsel.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/objsel/factory.c b/dlls/objsel/factory.c index f104c00..11d81b9 100644 --- a/dlls/objsel/factory.c +++ b/dlls/objsel/factory.c @@ -41,7 +41,7 @@ static HRESULT WINAPI OBJSEL_IClassFactory_QueryInterface( if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IClassFactory)) { - *ppvObj = (LPVOID)iface; + *ppvObj = iface; IClassFactory_AddRef(iface); return S_OK; } diff --git a/dlls/objsel/objsel.c b/dlls/objsel/objsel.c index 06fbf4d..51e8d0b 100644 --- a/dlls/objsel/objsel.c +++ b/dlls/objsel/objsel.c @@ -142,7 +142,7 @@ static HRESULT WINAPI OBJSEL_IDsObjectPicker_QueryInterface( if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDsObjectPicker)) { - *ppvObj = (LPVOID)iface; + *ppvObj = iface; OBJSEL_IDsObjectPicker_AddRef(iface); return S_OK; }
1
0
0
0
← Newer
1
...
49
50
51
52
53
54
55
...
135
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Results per page:
10
25
50
100
200