Bug in wxToolbar?? [2.8.2, winXP, VC2005]
Yaron Tadmor
YaronT at HumanEyes.com
Wed Mar 28 09:32:30 PDT 2007
Hi,
I ran into something that looks like a small conceptual bug in PC port
of WX (perhaps this manifests in others as well).
The toolbar's tool ID's are noted as ints. On PC port these are 4-byte
integers.
However, the PC implementation passes the ID in the WPARAM of the
windows message. This means the ID is cast to a 2-byte integer which
causes it to be truncated.
The behavior is seen when using ID's which are greater than 0xffff. In
this case clicking the button of the tool will NOT activate it as the ID
passed in the message is not the correct ID.
This to me seems very wrong, as the API clearly suggests a 4-byte
integer as an ID.
If indeed this IS a bug I can think of several ways to solve it:
1) Change the API so it reflects the correct data size
2) Add asserts on PC to make sure the ID's are in the correct
range.
3) Use a different parameter of the message to pass the proper ID.
I would be happy to here your opinions.
Yaron Tadmor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20070328/3d659648/attachment.htm
More information about the wx-users
mailing list