Hi.
BUG:
TreeView sends TVS_GETDISPINFO notifycation. Main application catch it and
change "mask","state" and "stateMask" in a TVITEM structure. After returning
from message handler, item's state don't changed. TreeView don't save new item
state in function TREEVIEW_UpdateDispInfo after calling
TREEVIEW_SendRealNotify.
This is Delphi code sample, TMyTreeView inherits from TCustomTreeView
//-----------------------------------------------------------------
procedure TMyTreeView.CNNotify(var Message: TWMNotify);
var
hNode: Integer;
begin
with Message do
case NMHdr^.code of
TVN_GETDISPINFO:
with PTVDispInfo(NMHdr)^ do begin
hNode := item.hItem;
with PTVDispInfo(NMHdr)^.item do begin
mask := mask or TVIF_STATE or TVIF_HANDLE;
stateMask := stateMask or TVIS_STATEIMAGEMASK;
state := (state and not TVIS_STATEIMAGEMASK)
or UINT(IndexToStateImageMask(MyGetItemImageIndex(hNode)));
end;
end;
end;
inherited;
end;
//-----------------------------------------------------------------
This's link to MSDN page, where described how it must work:
http://msdn.microsoft.com/en-us/library/bb773456(VS.85).aspx
<http://msdn.microsoft.com/en-us/library/bb773456%28VS.85%29.aspx>
Thx, I'm fix the patch.
Unfortuntley, by some reason, I can't include the test case. Only MSDN link.
I resend it with real name.
2008/10/30 <wine...@winehq.org>
> http://bugs.winehq.org/show_bug.cgi?id=15833
>
>
>
>
>
> --- Comment #3 from Dmitry Timoshkov <dmi...@codeweavers.com> 2008-10-30
> 10:36:23 ---
> Please resend with your real name in the From: field. Thanks.
>
>
> --
> Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
> Do not reply to this email, post in Bugzilla using the
> above URL to reply.
> ------- You are receiving this mail because: -------
> You reported the bug.
>
[HTML message skipped]
--- a/dlls/comctl32/treeview.c 2008-10-30 09:26:49.000000000 +0300
+++ b/dlls/comctl32/treeview.c 2008-10-28 11:32:49.000000000 +0300
@@ -823,6 +823,11 @@
/* These members are now permanently set. */
if (callback.item.mask & TVIF_DI_SETITEM)
wineItem->callbackMask &= ~callback.item.mask;
+
+ if (callback.item.mask & TVIF_STATE) {
+ wineItem->state &= ~callback.item.stateMask;
+ wineItem->state |= (callback.item.state & callback.item.stateMask);
+ }
}
/***************************************************************************