BUG 15833: TreeView control don't save item's state

warmouse iwarmouse at gmail.com
Wed Oct 29 06:50:47 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>

I'm offer this patch (attached) to fix this bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-patches/attachments/20081029/8c3daa51/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: treeview-update-state.patch
Type: application/octet-stream
Size: 554 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20081029/8c3daa51/attachment.obj 


More information about the wine-patches mailing list