Re: [1/2] wineps.drv: Add an ability to select device resolution from UI.
Dmitry Timoshkov <dmitry(a)baikal.ru> writes:
@@ -224,10 +229,13 @@ typedef struct static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { + static const WCHAR resW[] = {'%','d',' ','d','p','i',0}; + static const WCHAR resxyW[] = {'%','d','x','%','d',' ','d','p','i',0};
The "dpi" string needs to be loaded from resources.
@@ -267,6 +275,59 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg, } SendDlgItemMessageA(hwnd, IDD_DUPLEX, CB_SETCURSEL, Cursel, 0); } + + if (list_empty( &di->pi->ppd->Resolutions )) + { + WCHAR buf[64]; + struct item_res_data *data; + + sprintfW(buf, resW, di->pi->ppd->DefaultResolution); + SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_ADDSTRING, 0, (LPARAM)buf); + + data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data)); + data->resx = data->resy = di->pi->ppd->DefaultResolution; + SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_SETITEMDATA, 0, (LPARAM)data); + Cursel = 0;
You don't need a data structure, you can store the values directly with something like MAKELONG. -- Alexandre Julliard julliard(a)winehq.org
Alexandre Julliard <julliard(a)winehq.org> wrote:
@@ -224,10 +229,13 @@ typedef struct static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { + static const WCHAR resW[] = {'%','d',' ','d','p','i',0}; + static const WCHAR resxyW[] = {'%','d','x','%','d',' ','d','p','i',0};
The "dpi" string needs to be loaded from resources.
Actually I did that, but then tested under Russian Windows7 and it's 'dpi' there, so I'd assume that it's either considered as a common term, or it's driver dependent (although all remaining driver UIs are in Russian here). If you still think that it should be translated please let me know.
+ data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data)); + data->resx = data->resy = di->pi->ppd->DefaultResolution; + SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_SETITEMDATA, 0, (LPARAM)data); + Cursel = 0;
You don't need a data structure, you can store the values directly with something like MAKELONG.
Good point, thanks. -- Dmitry.
Dmitry Timoshkov <dmitry(a)baikal.ru> writes:
Actually I did that, but then tested under Russian Windows7 and it's 'dpi' there, so I'd assume that it's either considered as a common term, or it's driver dependent (although all remaining driver UIs are in Russian here). If you still think that it should be translated please let me know.
Sure, I see no reason to hardcode it. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Dmitry Timoshkov