windrobin / winforms-geplugin-control-library

Automatically exported from code.google.com/p/winforms-geplugin-control-library
GNU General Public License v3.0
0 stars 1 forks source link

Double-clicking a KmlTreeView node unchecks it #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Double-clicking on a KmlTreeView node causes the node to be unchecked.

What is the expected output? What do you see instead?

In Google Earth, double-clicking a treeview node does not uncheck it.

What version of the product are you using? On what operating system?

r420 on XP.

Please provide any additional information below.

I did not observe this problem in the previous .NET 3.5/VS2008 version of the 
library.

In KmlTreeView.OnNodeMouseDoubleClick(), I was able to correct the problem by 
changing the following line at the top of the method:

Was:
  bool state = !node.Checked;
Now:
  bool state = node.Checked;

Original issue reported on code.google.com by kco...@gmail.com on 23 Aug 2011 at 3:46

GoogleCodeExporter commented 9 years ago
Yes, the double clicking is a bit of an issue really - in the native tree view 
control the default behaviour is to expand and collapse nodes when they are 
double clicked. That is it.

I originally added the behaviour to 'fly to' the object when the nodes are 
double clicked, this only seemed to make sense though if the object was visible 
(and therefore the node is checked)...thus I set double clicking to toggle the 
visibility and check-state. (Hence double clicking a checked node un-checks it 
and visa-versa 'node.Checked = !node.Checked')

A further issue is created when you double-click on a parent node (folder, 
document, etc) as this sets all its  children to be checked and visible 
too...it is hard to determine what should happen in all cases to children (for 
example, if a tour is checked and visible - you enter the tour...but you 
double-clicked the parent...) this seems confusing behaviour... 

Altering the code like you did simply turned the behaviour off ('node.Checked = 
node.Checked')

Anyhow, to resolve this I have done the same - well I have completely removed 
the check-state-visiblity toggling from the double-click event handler. 
OnNodeMouseDoubleClick now simply 'flys to' the object, 'opens a balloon' or 
'toggles the media player' for nodes, it does not alter the check state.

I plan to commit a new version very soon!

Thanks for reporting this.

F.

Original comment by fraser.c...@gmail.com on 24 Aug 2011 at 7:51

GoogleCodeExporter commented 9 years ago
This is fixed in the latest commit

Original comment by fraser.c...@gmail.com on 8 Oct 2011 at 12:44