[1/2] wineps.drv: Add an ability to select device resolution from UI.

Alexandre Julliard julliard at winehq.org
Fri Dec 21 05:17:59 CST 2012


Dmitry Timoshkov <dmitry at 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 at winehq.org



More information about the wine-devel mailing list