Add support for TB_GETMETRICS and TB_SETMETRICS messages

Robert Shearman R.J.Shearman at warwick.ac.uk
Sun Mar 7 07:52:26 CST 2004


Dmitry Timoshkov wrote:
>
> "Robert Shearman" <R.J.Shearman at warwick.ac.uk> wrote:
>
> > > +    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.
>
> My implementation was based only on MSDN docs. I just compared a
> raw message list
> between latest MSDN and Wine implementation and found that two.
> So I decided to
> add support for them.
>
> A comment for szPadding in Wine says: /* padding values around button */.
>
> Looks like toolbar.c has plenty of similar (and possibly
> redundant) things:
>
> INT      nHeight;        /* height of the toolbar */
> INT      nWidth;         /* width of the toolbar */
> RECT     client_rect;
> RECT     rcBound;        /* bounding rectangle */

Yes, on first inspection it looks as though they are redundant. I'll take a
look at this and see if I can clean it up.
I have a fairly large patch for the drawing code in the works which should
make it much easier to add themeing support and looks much neater, so I'll
get this out of the way first.

> What another field should be used for c[x|y]ButtonSpacing instead?

It looks like it. It shouldn't be too hard to add support for it. You will
just need to change TOOLBAR_CalcToolbar to add on the extra spacing between
the buttons.

Rob





More information about the wine-devel mailing list