Rohit Posted September 27, 2005 Report Share Posted September 27, 2005 Hey all, I am a long time reader, first time poster (not really experienced). I was hoping someone can help me out with this problem. Given an array of say ten elements, all being numeric for example, I want to be able to say click (or double click) on for example the 5th element and bring up another window with information solely for that element. I tried playing with the Events Structure however I can only select the entire array to perform the event, not just a single element in the array. Is there a way to I guess, track where the mouse clicked so that I can perform actions pertaining to the desired element? Or another 'proper' way of doing what I am looking to do? Hope I made sense... Thanks. Rohit Quote Link to comment
Jeffrey Habets Posted September 27, 2005 Report Share Posted September 27, 2005 I would probably display the arrayvalues in a listbox. The listbox click events can easily be captured. Then, use the listbox value to index the array. Quote Link to comment
B Chavez Posted September 27, 2005 Report Share Posted September 27, 2005 I've done what you're explaining (I think..) Give me a chance to dig it up. Quote Link to comment
B Chavez Posted September 28, 2005 Report Share Posted September 28, 2005 Hope this helps. Download File:post-1591-1127863509.llb Quote Link to comment
Rohit Posted September 28, 2005 Author Report Share Posted September 28, 2005 Thanks a lot for the input guys. Both the listbox and the array will come in handy. One thing I like about the listbox is that it has a vertical scrollbar. Is there any way of inputting a scrollbar on an array? Quote Link to comment
Jeffrey Habets Posted September 28, 2005 Report Share Posted September 28, 2005 Thanks a lot for the input guys. Both the listbox and the array will come in handy. One thing I like about the listbox is that it has a vertical scrollbar. Is there any way of inputting a scrollbar on an array? It can be done, but you'll need to program it. You can use the IndexVals property of the array in combination with a numeric slider to set the visible part of the array. As of october 3rd it will very probably be built into LabVIEW. :thumbup: Quote Link to comment
Rohit Posted September 28, 2005 Author Report Share Posted September 28, 2005 It can be done, but you'll need to program it. You can use the IndexVals property of the array in combination with a numeric slider to set the visible part of the array.As of october 3rd it will very probably be built into LabVIEW. :thumbup: Hey thats not a bad idea, thanks! Guess you got to be a little creative :thumbup: Quote Link to comment
Mark Balla Posted September 28, 2005 Report Share Posted September 28, 2005 It can be done, but you'll need to program it. : Accutally you don't need to do any programming just replace digital control with a slider in the control editor. Quote Link to comment
Rohit Posted September 28, 2005 Author Report Share Posted September 28, 2005 haha well I guess if you want to get rid of a couple of extra wires edit the control. I have been having so much fun with listboxes, that I've filled them totally up, however just can't seem to figure out how to make sure I have a 'clean' listbox when I start my program. Attached is a simple insert, if someone can tell me how on earth to clear it (because I can't seem to find any property nodes, and if I have a list of 500 items, does it make sense to delete all the rows each time i start up...) Download File:post-3094-1127934686.vi Quote Link to comment
B Chavez Posted September 28, 2005 Report Share Posted September 28, 2005 If you wire an empty array to the "Item Names" property, it will clear it. Download File:post-1591-1127935335.vi Quote Link to comment
Rohit Posted September 28, 2005 Author Report Share Posted September 28, 2005 If you wire an empty array to the "Item Names" property, it will clear it.Download File:post-1591-1127935335.vi haha wow... I think I tried everything else but that. Thanks again. Quote Link to comment
Rohit Posted September 29, 2005 Author Report Share Posted September 29, 2005 Alright last question on this topic which I seemed to have butchered. I am trying to incorporate a boolean control array along with the listbox where each control corresponds to the specific index in the listbox. Idealy I would like the array to scroll along with the scrolling of the listbox, so the controls line up so to speak. I didn't have any luck with finding events or properties that can be manipulated. The only other option I tried was using an array of clusters, where each cluster has some data (like a numeric or string) and the boolean control, in this case a checkbox. However what I found was that for one thing, I would have to play with the pixels of course to get the original question on clicking on an array to work, and another thing I found that I was unable to check off the boxes in the array, they simply acted as indicators. Any suggestions? Attached is the listbox vi and the array of clusters vi. edit: when continuously playing with the array of clusters option, i found that using the pixels as a tracker for the clicks, if i 'scroll' (ie updating the index), and complete a cycle for example in scrolling, if i click on the first element in the new appearing cycle, it gives me the first element of the entire array, so I guess for my application the listbox would be ideal if I can incorporate the boolean checkboxes along with each row. Download File:post-3094-1128000843.vi Download File:post-3094-1128000859.vi Quote Link to comment
B Chavez Posted September 29, 2005 Report Share Posted September 29, 2005 Try this and see what you think. I use the "Top Left Visisble Cell" property to determine which items in the listbox are visible. The boolean array is fixed in size equal to the number of rows visible in the listbox. The array now "adapts" to only the visible items in the listbox. Download File:post-1591-1128008052.vi Quote Link to comment
Neville D Posted September 29, 2005 Report Share Posted September 29, 2005 Alright last question on this topic which I seemed to have butchered. I am trying to incorporate a boolean control array along with the listbox where each control corresponds to the specific index in the listbox. Idealy I would like the array to scroll along with the scrolling of the listbox, so the controls line up so to speak. I didn't have any luck with finding events or properties that can be manipulated. Any suggestions? Attached is the listbox vi and the array of clusters vi. Hi Rohit, The listbox has a property whereby you can display a little symbol next to each entry. Instead of having a complicated series of moving boolean arrays, just display a "check" symbol for true and a "x" for false. Right-click on an item in the listbox and visible items>symbols. You can also access this property through the property nodes. And yes, you can add a scroll-bar to the array by right-clicking on the array>Advanced>Customize and then edit the array control to replace the up and down arrows with a scrollbar. Neville. Quote Link to comment
Rohit Posted September 29, 2005 Author Report Share Posted September 29, 2005 Thanks a lot for your help guys. I am going to play around with it a bit because I am looking to have the user mark the boolean in runtime and have the ability to turn on and off whenever the user pleases. Thanks again. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.