05-03-2019 07:54 AM
Thanks for the tip, that does help but adds another issue that I have a solution for. If I double click a parent item, I can use the CellPart to tell me what part was double clicked and if it was the Open/Close Symbol to do nothing.
The only problem I see is that the the Expand/Colapse event is triggered before the double click event. So I don't have a way of knowing if the Expand/Collapse should be discarded until after the event has taken place. So what this means is you'll double click a parent item, and it will Close or Open, and then the dialog comes up. The only solution I came up with so far is to read the state of the Close/Expand and invert it after a double click.This causes a slight blip in a quick close and open on the UI if you double click a parent but I'm okay with it since the code is much simpler.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-03-2019 11:35 AM
This seems like a great case for a Qcontrol to encapsulate all of the filtering, opening, closing, etc.
07-21-2020 07:31 PM
Thread necromancy!
I found this thread as I was trying to figure out how to disable the double-click to expand/collapse functionality in a Tree Control. I still want users to be able to click the expand/collapse symbols, but I don't want to expand/collapse if they double-click anywhere in the tree.
I ultimately stumbled upon this really simple solution that I thought I would describe here, as I didn't see anyone else mention it. The Double Click method of the TreeControl class gives you the tag of the last item that was double-clicked:
This essentially gives us the information from the 'Double Click' event while we're in the Item Open?/Item Close? filter event, so we can know if the Item Open/Close was fired as the result of a double-click. If it was, I can simply discard the event (so the item isn't opened/closed, and then immediately after this diagram executes, the Double Click event fires). I tested it quite a bit and it looks like the method is pretty good about not giving back stale data, i.e. tags that were double-clicked previously before an Item Open/Close happens.
11-01-2022 08:04 PM
Darren's solution works well except for when the user is clicking directly on the expand/collapse symbol rapidly.
This produces a "double click" event, when the user was really just trying to expand/collapse the tree rapidly.
Pretty niche, but also noticeable and undesirable.
11-01-2022 10:15 PM
That could be addressed at the OS level by adjusting the speed of the double click (in the Mouse settings)