Add support for TB_GETMETRICS and TB_SETMETRICS messages

Robert Shearman R.J.Shearman at warwick.ac.uk
Sun Mar 7 06:21:28 CST 2004


Dmitry Timoshkov wrote:
>
> Hello,
>
> Changelog:
>     Dmitry Timoshkov <dmitry at codeweavers.com>
>     Add support for TB_GETMETRICS and TB_SETMETRICS messages.
>
> diff -u cvs/hq/wine/dlls/comctl32/toolbar.c wine/dlls/comctl32/toolbar.c
> --- cvs/hq/wine/dlls/comctl32/toolbar.c	2004-03-07
> 17:24:46.000000000 +0800
> +++ wine/dlls/comctl32/toolbar.c	2004-03-07 18:12:44.000000000 +0800
> @@ -5871,6 +5871,60 @@ TOOLBAR_SysColorChange (HWND hwnd)
>  }
>
>
> +static LRESULT TOOLBAR_GetMetrics(HWND hwnd, LPTBMETRICS lpMetrics)
> +{
> +    TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
> +
> +    if (lpMetrics->cbSize != sizeof(TBMETRICS))
> +	return 0;
> +
> +    if (lpMetrics->dwMask & TBMF_PAD)
> +    {
> +	lpMetrics->cxPad = infoPtr->nButtonWidth;
> +	lpMetrics->cyPad = infoPtr->nButtonHeight;
> +    }
> +    if (lpMetrics->dwMask & TBMF_BARPAD)
> +    {
> +	lpMetrics->cxBarPad = infoPtr->nWidth;
> +	lpMetrics->cyBarPad = infoPtr->nHeight;
> +    }
> +    if (lpMetrics->dwMask & TBMF_BUTTONSPACING)
> +    {
> +	lpMetrics->cxButtonSpacing = infoPtr->szPadding.cx;
> +	lpMetrics->cyButtonSpacing = infoPtr->szPadding.cy;

I don't think this is quite right. MSDN says that cxButtonSpacing is "Width
of the space between toolbar buttons", where as padding is "used to create a
blank area between the edge of the button and the button's image and/or
text". If experimentation proves that they are the same then a nice comment
saying MSDN is wrong would be appropriate.

Rob





More information about the wine-devel mailing list