[Bug 15833] TreeView control don't save item's state

Vadim Zavgorodniy iwarmouse at gmail.com
Fri Oct 31 05:33:57 CDT 2008


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-bugs at winehq.org>

> http://bugs.winehq.org/show_bug.cgi?id=15833
>
>
>
>
>
> --- Comment #3 from Dmitry Timoshkov <dmitry at 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-patches/attachments/20081031/91bbc855/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: treeview-update-state.patch
Type: application/octet-stream
Size: 553 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20081031/91bbc855/attachment.obj 


More information about the wine-patches mailing list