Event mouse down in an array

 Hi,
If I use the  the Event "Array" Mouse Down, Is there any way to know which element in the array was clicked??? 
Thanks.
Raymundo Cassani
Solved!
Go to Solution.
Attachments:
imagen.JPG ‏51 KB
imagen.JPG ‏51 KB

In the LAVA Code repository there is a piece of code that check that for you, it takes the current index position into account, size of the eleements.
Unfortunatly the website is currently down. Let me check later.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!

Similar Messages

  • Detect clicked cluster in mouse down event for clusters within multiple stacked clusters

    With the help of Ben (see http://forums.ni.com/t5/LabVIEW/Determine-cluster-element-clicked-in-mouse-down-event/td-p/1245770)
    I could easily find out what sub-cluster had been clicked on (mouse down event) within the main cluster, by using the Label.Text Property.
    However if you have a cluster within a cluster within a cluster then you probably have to use individual mouse down events for each sub-sub cluster.
    I just wanted to use one "Main Cluster":Mouse Down event and from that determine which of the sub-sub clusters had been clicked on - is this even remotely possible?
    Chris.

    Chris Reed wrote:
    With the help of Ben (see http://forums.ni.com/t5/LabVIEW/Determine-cluster-element-clicked-in-mouse-down-event/td-p/1245770)
    I could easily find out what sub-cluster had been clicked on (mouse down event) within the main cluster, by using the Label.Text Property.
    However if you have a cluster within a cluster within a cluster then you probably have to use individual mouse down events for each sub-sub cluster.
    I just wanted to use one "Main Cluster":Mouse Down event and from that determine which of the sub-sub clusters had been clicked on - is this even remotely possible?
    Chris.
    Yes but... you will have to pass through 26 Kudos worth of Nuggets to get there (Well maybe you can skip the last 5 or so).
    This Nugget by Ton teaches us how to use Dynamic Event Registration. (15 Kudos, must read and understand)
    This Nugget by me talks about getting at references inside arbitrary data structures. (11 Kudos, You don't have to read the whole thing, only enough to get at nested objects).
    SO use the stuff I wrote about to gather up the references to the clusters. Build them into an array and then use dynamic event registration and what you learned in that thread you linked in your question.
    So Possible? Yes!
    Easy? YOU tell me.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Determine cluster element clicked in mouse down event

    Is there anything similar to the ArrElem Property Node, that allows a user to detect which element in an array has been clicked on (mouse down event), but for a cluster?
    It seems the only way I can detect which sub-cluster in my main cluster (see attachment) has been clicked on, is to work out the screen coordinates of each element and compare that to the mouse coordinates of the click - is there any other (better) way?  There's is going to be eight of these main clusters all stacked vertically.
    NOTE: All sub-clusters in the main cluster are disabled so that nothing "pops-up" when the user clicks on an object.
    I was thinking of using an array of clusters, but I need the ability to set various properties (eg. blinking) for each individual object.
    Chris
    Attachments:
    Lane Bays.ctl ‏80 KB

    That's not bad Ben - thanks.
    I made up a quick VI based on your solution which works great if I have one cluster, but if I have eight+ Main Clusters I have to repeat this Event eight+ times - no?  I was wondering if there was a more scalable solution?
    I suppose I could just lump ALL the sub-clusters into one massive Main Cluster, but the text string for that Event is going to be very, very long eg. "Main Cluster.Cluster1"....."Main Cluster.Cluster24": Mouse Down
    Chris
    Attachments:
    Get Clicked Cluster Element.vi ‏13 KB

  • How can I (neatly) control mouse click events in a multi-dimensional array?

    Hello everyone!
         I have a question regarding the use of mouse clicks events in a multi-dimensional array (or a "2D" array as we refer to them in Java and C++).
    Background
         I have an array of objects each with a corresponding mouse click event. Each object is stored at a location ranging from [0][0] to [5][8] (hence a 9 x 6 grid) and has the specific column and row number associated with it as well (i.e. tile [2][4] has a row number of 2 and a column number of 4, even though it is on the third row, fifth column). Upon each mouse click, the tile that is selected is stored in a temporary array. The array is cleared if a tile is clicked that does not share a column or row value equal to, minus or plus 1 with the currently targeted tile (i.e. clicking tile [1][1] will clear the array if there aren't any tiles stored that have the row/column number
    [0][0], [0][1], [0][2],
    [1][0], [1][1], [1][2],
    [2][0], [2][1], [2][2]
    or any contiguous column/row with another tile stored in the array, meaning that the newly clicked tile only needs to be sharing a border with one of the tiles in the temp array but not necessarily with the last tile stored).
    Question
         What is a clean, tidy way of programming this in AS3? Here are a couple portions of my code (although the mouse click event isn't finished/working correctly):
      public function tileClick(e:MouseEvent):void
       var tile:Object = e.currentTarget;
       tileSelect.push(uint(tile.currentFrameLabel));
       selectArr.push(tile);
       if (tile.select.visible == false)
        tile.select.visible = true;
       else
        tile.select.visible = false;
       for (var i:uint = 0; i < selectArr.length; i++)
        if ((tile.rowN == selectArr[i].rowN - 1) ||
         (tile.rowN == selectArr[i].rowN) ||
         (tile.rowN == selectArr[i].rowN + 1))
         if ((tile.colN == selectArr[i].colN - 1) ||
         (tile.colN == selectArr[i].colN) ||
         (tile.colN == selectArr[i].colN + 1))
          trace("jackpot!" + i);
        else
         for (var ii:uint = 0; ii < 1; ii++)
          for (var iii:uint = 0; iii < selectArr.length; iii++)
           selectArr[iii].select.visible = false;
          selectArr = [];
          trace("Err!");

    Andrei1,
         So are you saying that if I, rather than assigning a uint to the column and row number for each tile, just assigned a string to each one in the form "#_#" then I could actually just assign the "adjacent" array directly to it instead of using a generic object to hold those values? In this case, my click event would simply check the indexes, one at a time, of all tiles currently stored in my "selectArr" array against the column/row string in the currently selected tile. Am I correct so far? If I am then let's say that "selectArr" is currently holding five tile coordinates (the user has clicked on five adjacent tiles thus far) and a sixth one is being evaluated now:
    Current "selectArr" values:
           1_0
           1_1, 2_1, 3_1
                  2_2
    New tile clicked:
           1_0
           1_1, 2_1, 3_1
                  2_2
                  2_3
    Coordinate search:
           1_-1
    0_0, 1_0, 2_0, 3_0
    0_1, 1_1, 2_1, 3_1, 4_1
           1_2, 2_2, 3_2
                  2_3
         Essentially what is happening here is that the new tile is checking all four coordinates/indexes belonging to each of the five tiles stored in the "selectArr" array as it tries to find a match for one of its own (which it does for the tile at coordinate 2_2). Thus the new tile at coordinate 2_3 would be marked as valid and added to the "selectArr" array as we wait for the next tile to be clicked and validated. Is this correct?

  • Mouse down event reading a string terminal trick

    Hi,
    I wondered why I was getting frustrated entering a pasword that was verified in the mouse down event of the OK button. This is becuase when you click the OK button the entered text is still in the buffer and not copied to the terminal. (Which is more natural than clicking somewhere on the FP first). Note pressing enter or tab gets the string control out of enter text mode.
    Turns out need update value while typing turned on if you want to gaurantee a correct read of a text input control in a mouse down event. As this is one of those not obvious but sometimes happens bugs... I have posted for reference for others :-)
    Example attached v8.6.1.
    Attachments:
    TestMouseDownEvent.vi ‏13 KB

    Nick wrote:
    Turns out need update value while typing turned on if you want to gaurantee a correct read of a text input control in a mouse down event.
    AFAIK, "Update value while typing" will trigger only a Value Change event of the Str Ctl.
    Mouse Down event will preceed a Value Change event, if you have both the event cases configured in your code.
    - Partha
    LabVIEW - Wires that catch bugs!

  • Mouse down event handling of table control in subvi

    Hello Everyone.......
    I have created a vi which has a table control and xy graph... the function of the vi is to plot the data of two particular column of table into xy-graph after user selects the data from table....  In this vi , I have used mouse down event for selecting data set so that the color of selected row get changed for user reference.......  the vi is working fine..... 
    My problem is that this vi is a part of main vi.. and I want to use this vi as a subvi.... So, in my main vi I have a table control which is connected as input to the subvi...  I come to know that I need to register event for triggering a event in a subvi.......
    (1) How to register Mouse down event of table control which is on Main Vi to trigger mouse down event of table in subvi.... Another Important thing is... how to link every property of table control of subvi to the table control of main vi... so it just act as single control adapting every property like when user selects a particular row its color changes in subvi....so it should be reflected even if user selects a row in main vi... I mean table control of main vi and subvi should be a single control...is it possible?
    I hope I am clear......Thanks ..

    See the modified version of the VI. I use the 'Point to Row Column' method to get the cell that was clicked on - your method also worked using 'Selection Start' but I thought I'd show you an alternative.
    I've used a single event structure to update two table controls - the point is that if you have the references to the controls you can update the control from anywhere. You can also 'register for events' to allow you to register for events from a different VI (again, using the references) that doesn't have the control on the front panel.
    Couple of things about your VI:
    You don't need to put a wait node if you have a timeout on your event structure.
    You don't need the for loop for the columns/rows - if you look at the help for the 'Active Cell' property you can use a value of -2 for the row/column to select all cells in the row/column.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets
    Attachments:
    Highlight Selected Row in Table Control_lv2009.vi ‏13 KB

  • PDA Mouse Down Event on Picture Control

    While using the Mouse Down Event on the Picture Control for LabVIEW 7.1 PocketPC PDA, I want to get the xy coordinates on where the user tapped on the pict control. Any ideas or workarounds?
    Robert

    Hello Robert �
    What do you mean by �outputting individual horizontal and vertical components�?
    In the LabVIEW PDA module (and this applies to PocketPC and PalmOS), clusters will not show up in the PDA�s screen. You can use clusters to group controls/indicators but when there is need of sending a new value/showing the value in the screen, the bundle and unbundled functions have to be used, so that you can have individual controls/indicators to pass a new value/see the value, respectively.
    So, from the Coords terminal in a Mouse Down/Up event, you need to unbundle the cluster and create individual indicators for each, the horizontal and vertical position.
    I am attaching an example to show you what I mean. For PalmOS, the same applies.
    H
    ope this helps and if I misunderstood your post, please let me know.
    Have a great day.
    S Vences
    Applications Engineer
    National Instruments
    Attachments:
    PPC_Picture_Events.vi ‏30 KB

  • Mouse down event

    Is there anyway I can keep the control properties as shown in the image attached if I add another event to the same event structure case?
    I currently have an event structure case configured to execute on a mousedown event on a multi column listbox and would like to add a dynamic event to this case also yet keeping hold on the properties show in the image attached..
    Strokes
    Solved!
    Go to Solution.
    Attachments:
    Mouse down event for Multi Column Listbox.PNG ‏2 KB

    sebster wrote:
    Is it not just a case (pun not intended) of right-clicking the event structure and selecting Show Dynamic Event Terminals?
    I understand how to create, register and generate dynamic events but when I add the dynamic event to the event structure it changes (naturally enough) the "CtlRef, Coords,Button" properties to other ones like "time, type, source" etc...

  • Mouse down & mouse down in one event

    I am trying to put a mouse down with a mouse down in the same event. The first mouse down is to control a graph and the second a table. When I add the second mouse down event the Graph mouse down doesn't work.
    What am I doing wrong>
    Paul Power
    I have not lost my mind, it's backed up on a disk somewhere

    By stopped working I mean a broken run arrow and disabled property nodes giving broken wires
    I have attached the xy graph code being used
    Paul Power
    I have not lost my mind, it's backed up on a disk somewhere
    Attachments:
    XY graph - closest point.vi ‏24 KB
    scatter plot.vi ‏27 KB

  • Mouse down event and Click event in List Box Very urgent.

    Hi,
           How can i differentiate mouse down and itemclick in ListBox.Its very urgent.
    Regards,
    Jayagopal.

    Nick wrote:
    Turns out need update value while typing turned on if you want to gaurantee a correct read of a text input control in a mouse down event.
    AFAIK, "Update value while typing" will trigger only a Value Change event of the Str Ctl.
    Mouse Down event will preceed a Value Change event, if you have both the event cases configured in your code.
    - Partha
    LabVIEW - Wires that catch bugs!

  • Graph Mouse Down event issue

    I have an XY graph that is controlled by a mouse down event. When I use the any of the tools like zoom I zoom into an area with a cluster of plots when I go to click on a plot the plot selects but the graph then reinitialises back to its original state.  The VIs I'm using are attached
    Paul Power
    I have not lost my mind, it's backed up on a disk somewhere
    Attachments:
    XY graph - closest point.vi ‏24 KB
    scatter plot.vi ‏27 KB

    Yes, all the tools I'm using are from the graph palette. Say if I have 100 points on my graph and I use the graph palette zoom to zoom into an area of points on the graph I select a specific point with the mouse then the graph goes back to its unzoomed state showing the full plot
    Paul Power
    I have not lost my mind, it's backed up on a disk somewhere

  • How Can I Move the Elements by Tap on Touchscreen or Mouse Down Event in Adobe Edge Animate?

    hi , how can i move the elements by tap on tochscreen or mouse down event in adobe edge animate? like action for moving car.

    in my idea is mousedown action or tap on touchscreen plays the role of car accelerator, (gas pedal) when i left click on mouse my car moves forward and the car doesnt move when I dont click or tap.
    Do you have a solution?

  • [LV2013] Events ordering (mouse down vs. value changed) ?

    Hi,
    I've encountered a problem with my real-time behaving UI.
    The event distribution mechanism registers several events
    linked to various UI controls.
    Two of them are set this way :
    String control: value changed
    Tree control : mouse down
    The problem is that the String control is used both to display
    and modify values within the tree. Click an item, its name is
    displayed in the String control, modify the String control, the
    new value is reflected into the Tree control.
    The issue is when I edit a string inside the String control and
    click another item in the Tree Control, the first event fired is
    the Mouse down event on the Tree control. Then only the
    Value changed event is fired.
    What happens is that case is the value edited in the String
    control gets overwritten with the new clicked item's value,
    then it is saved inside the previous item's value.
    Is there a way to give a kind of priority on some events
    rather than others ?
    David Koch

    How is LabVIEW "nasty, nasty"?
    While it isn't doing what you want for your particular situation, it is doing exactly what it is supposed to do and is pretty logical.
    1.  You are in a control.
    2.  That control's value isn't update until you leave it.
    3.  Your method of leaving the control is by clicking on something else  (the mouse down).
    4.  The mouse down is what happens first, once LabVIEW detects the mouse down on another control, it then says, okay, now I need to take the focus from the first control and place it here.
    5.  It is the loss of focus from the first control that is what fires the value change event on the first control.
    So the precise order of events is:
    1.  Mouse Down event on control 2
    2.  Value change on control 1
    and that makes perfect sense.
    Your idea of reversing the order of events does not make sense to me.  I want LabVIEW to enqueue events as they happen, not rearrange them.  Supposed some other part of your VI is simultaneously issuing another value change event, or a user event.  Where should that event fall into the queue related to the other events you've had LabVIEW rearrange?
    From what I've seen from this message of yours and others in the past is you get quite upset when LabVIEW doesn't conform to your vision of the world and rather than figuring out how LabVIEW works and how to work with it, you try to fight how LabVIEW works and then take to the forums to complain.  If that is actually picture of you in your user icon, then that is exactly how I envision you while you are working on the computer.
     

  • Pane Mouse Down Event

    Dear sir,
    I am using state machine concept in one of my projects. In my VI i have total 20 controls with different events. I introduced the Pane mouse down event to front panel to validate my input parameters. If i click on controls first it is executing the pane mouse down event and then it is going to particular control event means two events are happening. If i click on Pane only Pane mouse down event is executing. I want to discard the pane mouse down event when i click on the controls.
    Kindly let me know how to implement this kind of events.
    Thanks & regards,
    S Nagaraju.

    Crosspost

  • Problems with Mouse Down event for a picture control embedded in tab.

    I noticed that when trying to get a Mouse Down event for a picture control that the Mouse Down will not be 'fired' if the picture is embedded in a tab control. It also appears that this problem exists for other controls (I only tested a slider in addition to the picture). It isn't much of an issue for me now as I can just poll the mouse property of the picture control, but the Mouse Down event has information that I may want access to in my next software revision (button pressed, and Alt mod). I could do that by handling the Mouse Down event for the tab itself and checking to see if the the mouse property isn't -1, -1 for the picture, but that seems a little bit too kludgy (sp?) to me and wouldn
    't address the issue with other control types. Any chance of this being addressed by a patch sometime in the next couple of months???
    Attachments:
    TabProblem.vi ‏69 KB

    The problem I reported above was in LV 6.1.
    As a work-around, I used the mouse down on the tab control and did the math to decide if the picture was clicked.
    I have been told that this was fixed in LV 7.0. I can not confirm.
    You could call NI and ask about the service request number I cited above.
    I hope this helps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • HDTV +mac book HD Content

    Hello All I thought to experiment with viewing HD Content on my Panasonic TV (TX-32LZD80-Widescreen-1080p) using my Macbook Intel C2D 2GHZ 1.5GB RAM. I have a mini-dvi to VGA connector and this didn't do the trick entirely. I mean the resolution opti

  • When i export a video from iMovie the sound goes distorted?

    When i export a video from iMovie to my camera roll or to youtube the music i've added sounds distorted. When i watch it in iMovie it sounds fine. Any idea how i can solve this problem. Many thanks

  • B.area wise clearing

    hi sap guru's how to clear the vendor / customer balance through business area wise clearing. where will configure the b.area wise clearing. what purpose use the b.are wise clearing in ap/ar my mail id [email protected] regards shiva

  • INVOICE MAKING PROCEDURE IN MM

    HI, How can make the invoice in mm and explain the steps to create the invoice and forward me one copy of developed invoice. thanks sujatha

  • ODCI error with spatial operators

    Hi group, I get ODCI errors with spatial operators SDO_RELATE, SDO_FILTER and SDO_WITHIN_DISTANCE (not SDO_NN) called from JDBC (Java 1.2.2). For example: SELECT A.gid FROM FeatureTable1 A, FeatureTable1 B WHERE B.gid = 3 AND SDO_RELATE(A.Geometry, B