Owner drawn menu size fixes with tests.

Rein Klazes wijn at wanadoo.nl
Tue May 24 13:13:27 CDT 2005


Hi,

This fixes the menu elongation problem mentioned on the wine-users list:

http://www.winehq.org/hypermail/wine-users/2005/05/0010.html

The application returns in the WM_MEASUREITEM handler a menu width of -4
to achieve perfect squares for the items. To reproduce that in wine we
have to be nearly pixel-perfect in the size adjustments. That is what
this patch achieves, I think.
If the calculations seem suspicious: the  test has been run on hundreds
of combinations of Windows versions (win95 up to winXP), menu fonts and
menu font sizes.

Also included is an improvement of fix sent in previously by Felix
Nawothnig but which was not committed. 

Changelog:

dlls/user	: menu.c
dlls/user/tests	: menu.c

Owner drawn menu item size calculation fixes:
- Correct width calculation of owner drawn menu items;
- Set the height value in the MEASUREITEM struct to the same value as
Windows (NT/2k/XP) does (problem debugged by Felix Nawothnig);
- Add tests for the fixes above;
- Also add tests for menu bars with owner drawn items.

Rein.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: menu-od-width.diff
Type: text/x-diff
Size: 11437 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20050524/aac830c6/menu-od-width.bin


More information about the wine-patches mailing list