JAM-Software / Virtual-TreeView

Virtual Treeview is a Delphi treeview control
http://www.jam-software.de/virtual-treeview/
646 stars 253 forks source link

HotNode property and popup menu #477

Closed vincentparrett closed 9 years ago

vincentparrett commented 9 years ago

From dieforme...@gmail.com on September 26, 2014 21:21:23

Hi! I'am using Delphi XE5. How can I get hotnode property when I click right mouse button on VirtualStringTree and menu is popup? It's always "nil" and not highlighted. In Delphi 7 it's work fine. toHotTrack property is "True". Sorry fom my english :)

Original issue: http://code.google.com/p/virtual-treeview/issues/detail?id=477

vincentparrett commented 9 years ago

From dieforme...@gmail.com on September 26, 2014 04:28:21

Attachment: delphi7.jpg delphiXE5.jpg

vincentparrett commented 9 years ago

From joachim....@gmail.com on September 28, 2014 04:38:03

Please follow the guidelines on our homepage. Do not create issues for questions and support.

When reporting a bug please include a sample project that allows us to quickly reproduce the bug. This can also be one of the demo projects that come with Virtual Treeview, modified to show the bug. If only small changes are required, a description is sufficient how a demo projects needs to be changed in order to replicate the bug. If you already have a solution, please supply a patch file.

Owner: joachim....@gmail.com

vincentparrett commented 9 years ago

From dieforme...@gmail.com on September 29, 2014 00:26:53

Ok! Here is a demo project. 1) Run project 2) Right click on then node of VirtualTreeView. 3) Select one of the items (popupmenu) 4) Delphi 7 show message with hotnode caption, Delphi XE2-XE5 show empty caption.

Attachment: VSTDemo.zip

vincentparrett commented 9 years ago

From joachim....@gmail.com on December 01, 2014 12:43:39

The reason for the different behavior lies in the VCL: In Delphi XE5 the VCL calls CMMouseLeave in case a popup menu appears, in Delphi 7 it doesn't.

Only if the mouse is inside a control, it can have a hot node, this is why the virtual treeview (correctly) clears the hotnode property when it receives a CMMouseLeave.

The call stack that leads to the CMMouseLeave() call doesn't contain aynthing suspicous:

VirtualTrees.TBaseVirtualTree.CMMouseLeave((45076, 0, 0, 0, 0, 0, (), 0, 0, (), 0, 0, ())) :0052226c TControl.WndProc + $2C0 :00526d3b TWinControl.WndProc + $5D3 VirtualTrees.TBaseVirtualTree.WndProc((45076, 0, 0, 0, 0, 0, (), 0, 0, (), 0, 0, ())) :00521ea7 TControl.Perform + $27 :005269e9 TWinControl.WndProc + $281 VirtualTrees.TBaseVirtualTree.WndProc((675, 0, 0, 0, 0, 0, (), 0, 0, (), 0, 0, ())) :00526373 TWinControl.MainWndProc + $2F :004c47d6 StdWndProc + $16

vincentparrett commented 9 years ago

From joachim....@gmail.com on December 01, 2014 12:45:21

Possible workarounds:

Labels: -Priority-Medium Priority-Low