No subject


Thu Feb 24 14:23:06 CST 2011


st
wxRect& rc) passed into OnDrawItem() member function seems to be width=3D0,
height=3D0, hence the assert().

--- snip ---
Wine-dbg>bt
Backtrace:
=3D>0 0x68392bdb MENU_DrawBitmapItem(hdc=3D0x5e0, lpitem=3D0x160d50, rect=
=3D0x33e0bc,
hmenu=3D0x4021c, hwndOwner=3D0x30236, odaction=3D0x1, menuBar=3D0)
[/opt/projects/wine/wine-git/dlls/user32/menu.c:862] in user32 (0x0033e148)
  1 0x68395866 MENU_DrawPopupMenu+0x293(hwnd=3D0x501a2, hdc=3D0x5e0, hmenu=
=3D0x4021c)
[/opt/projects/wine/wine-git/dlls/user32/menu.c:1775] in user32 (0x0033e1b8)
  2 0x68399e47 PopupMenuWndProc+0x188(hwnd=3D0x501a2, message=3D0xf, wParam=
=3D0,
lParam=3D0) [/opt/projects/wine/wine-git/dlls/user32/menu.c:3493] in user32
(0x0033e258)
...
Wine-dbg>n
867        int w =3D rect->right - rect->left;
...
Wine-dbg>p *rect
{left=3D0x2, top=3D0xb, right=3D0x2, bottom=3D0xb}
...
Wine-dbg>frame 1
...
Wine-dbg>p bmprc
{left=3D0x2, top=3D0xb, right=3D0x2, bottom=3D0xb}
...
Wine-dbg>p *lpitem
{fType=3D0, fState=3D0, wID=3D0x1391, hSubMenu=3D(nil), hCheckBit=3D(nil),
hUnCheckBit=3D(nil), text=3D"&Help contents", dwItemData=3D0x1a6d738,
dwTypeData=3D0x0(nil), hbmpItem=3D0xffffffff, rect=3D{left=3D0x3, top=3D0x3=
, right=3D0xaf,
bottom=3D0x1a}, xTab=3D0xa6, bmpsize=3D{cx=3D0, cy=3D0}}
--- snip ---

I downloaded the sources and found the caller wxWindowMSW::MSWOnDrawItem()
here:

http://trac.wxwidgets.org/browser/wxWidgets/branches/WX_2_8_BRANCH/src/msw/=
window.cpp#L4242

It seems the bitmap rectangle calculation is tries to use a bmpsize (0,0)=
=20
which results in empty rectangle.
hbitmap =3D=3D HBMMENU_CALLBACK -> MENU_GetBitmapItemSize -> WM_MEASUREITEM=
 -> app
returns cx =3D cy =3D0 because it doesn't handle WM_MEASUREITEM at all (def=
ers to
default winproc).
The reason is this code:

http://trac.wxwidgets.org/browser/wxWidgets/branches/WX_2_8_BRANCH/src/msw/=
window.cpp#L4312=20

(id -> wParam)

WM_MEASUREITEM Message MSDN doc:

http://msdn.microsoft.com/en-us/library/bb775925.aspx

--- quote ---
wParam

    Contains the value of the CtlID member of the MEASUREITEMSTRUCT structu=
re
pointed to by the lParam parameter. This value identifies the control that =
sent
the WM_MEASUREITEM message. If the value is zero, the message was sent by a
menu. If the value is nonzero, the message was sent by a combo box or by a =
list
box. If the value is nonzero, and the value of the itemID member of the
MEASUREITEMSTRUCT pointed to by lParam is (UINT) =E2=80=931, the message wa=
s sent by a
combo edit field.
--- quote ---

MENU_GetBitmapItemSize -> HBMMENU_CALLBACK -> WPARAM must be _zero_ for
WM_MEASUREITEM.
If you fix that the app works fine (displays menus).

Regards

--=20
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=3Demail
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.=



More information about the wine-bugs mailing list