Jump to content

Tree Coords in expand/contract symbol?


Recommended Posts

Hi,

In a Mouse Down? on a tree, I need to know if the user clicked on a expand/contract symbol, because I need to discard clicking on items but I still need the expand/contract mechanism.
I would need something similar to the InSymbol from the Point To Row Column method, but for the expand/contract symbol.

How can I do that?

Link to post
Share on other sites

That would tell me if the clicked row is opened after the expand/contract mechanism did something, that's not what I need.

What I need to know is if the user clicked the symbol in the Mouse Down? (not in the Mouse Down or Mouse Up), before the mecahnism can even run.

Link to post
Share on other sites

I don't know if there's a way to figure out if the click was specifically on the expand symbol (other than starting to calculate yourself, which could get messy with nested elements), but can you just make the tree an indicator instead of a control? This will allow you to expand, but not to select. If the selection option is needed, Shaun's code from above should work. I'm not sure about dragging and other features.

Link to post
Share on other sites

There are private events on the tree for Item Close? and Item Open? which is a filtering event and allows you to discard the open and close.  You need the super special private special stuff INI to access these.  Then I'd recommend turning that INI off after.

Link to post
Share on other sites
3 hours ago, hooovahh said:

There are private events on the tree for Item Close? and Item Open? which is a filtering event and allows you to discard the open and close.  You need the super special private special stuff INI to access these.  Then I'd recommend turning that INI off after.

From what I can tell, the Item Close(?) and Item Open(?) events are not private. Maybe they were in a previous LabVIEW release?

Link to post
Share on other sites

I forgot to mention those. I actually started with those events, but my understanding was that the desire is to discard actions on the items, not opening and closing, and for those the open/close events don't really help (unless you plan on registering for both the open/close? event and for the mouse down? event and hope that LV will always process events in the order of the frames and then you can try relying on the lack of the first event to discard the second).

Like I said, I assume making it an indicator would do the job.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Kurt Friday
      Hi All
       
      I'm playing around with visualising clusters as a tree structure. I've got some nice code working that I thought I would share.
       
      It's part of an abstract data viewer that I'm working on.
       
      Code is based on Open_G Variant and Open_G Config File tools
       
      ClusterViewer.zip
    • By Manudelavega
      I have been trying to understand what's going on with my tree control and I'd like to share this with the community to see if somebody has seen this behavior before. Maybe there is something obvious that I am not seeing...
       
      I attached the VI (LV2011) with instructions inside (will take you 20s to perform the experiment, I dismantled the VI to its bare minimum). Please don't comment on the overall architecture (state machine...) since I modified the VI just for the sake of posting it here and removed all advanced features.
       
      Long story short, after programmatically modifying the value of the tree, I modify its value a second time by clicking directly on one of the tree items. I then expect the NewVal value given through the left node of the value change event case to match the value of the tree terminal. Depending on the code that first modified the value programmatically, sometimes this expectation is met and sometimes it isn't. Run the code, it's easier to understand that way...
       
      Thanks for your feedback!
      Tree value issue.vi
    • By MisterDesai
      I'm trying to create a better user interface for my tree navigation. The tree will ultimately have hundreds of items within it and I'm adding a search bar (simple string control).
       
      I'm looking for someway to problematically hide all of branches that don't contain the search query but I can't find any methods or properties that can do this.
       
      Any ideas?
    • By jkflying
      I am writing a performance-sensitive application which requires the use of a nearest-neighbor lookup. Originally I used a brute-force method, but unfortunately this gets to be very slow as the data size increases . I have a point cloud of ~100k points in 2D, and need around 50k nearest neighbor lookups per second as a minimum performance requirement.
      As a solution I wrote a kd-tree in .Net and used LabView to call the .Net dll. However, I discovered that each .Net transaction carries with it about a 0.5ms delay. I've tried bunching the data up into groups, but this only helps so much, as I am using an iterative process.
      Armed with my new-found kd-tree knowledge, I then wrote the kd-tree in LV-OOP, using DVRs for both subtrees and leaf values. However, my LV implementation is still 100x slower than the .Net implementation, and 20x slower than brute force. And this is with just 10k points.
      I'm fairly new to LV (about 6 months in an academic environment) and I'm fairly sure I've made a massive blunder somewhere, but I don't have any idea what it might be.
      http://robowiki.net/...d-tree_Tutorial is the tutorial that I used for writing both trees - note that I've only implemented a 1-NN lookup method, so have no need for the priority queue.
      Just some notes:
      I found using in-place data structure unbundle-bundle was much faster than using normal unbundle-bundle for all of the read/writes.
      The tree started out with pure by-value subtrees and data, so was even slower before I changed to DVRs.
      The lookup uses a queue as a stack, rather than being recursive. Not sure if this is good or bad.
      The add element uses recursion. Again, not sure if this is good or bad.

      I've written speed tests for brute force, .Net and LV lookups with names like with test_...... .vi if you want to compare performance.
      kd_tree Folder.zip
      Thanks in advance for any help
      Julian Kent
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.