jpdrolet Posted November 24, 2004 Report Share Posted November 24, 2004 I want to replace the value of a numeric control (inside an array of clusters) with NaN when the user hits Shift-Del. The event structure (LV7) doesn't allow to select controls inside an array. Is that possible? Otherwise, the solution I see is to display array elements in a separate cluster and copy/replace element as the index changes. Quote Link to comment
didierj Posted November 25, 2004 Report Share Posted November 25, 2004 The event structure (LV7) doesn't allow to select controls inside an array. Is that possible? 2754[/snapback] It's not just the event structure that doesn't allow selection of array elements, but all property/methods applied on array elements fall into this topic. It it an intended behaviour. Since at designtime you don't know how many elements will be in the array, and at runtime the number or elements can change, you would get problems when wanting to change the property of element that doesn't exist anymore (how would you create an event on the 25th element of an array when your array just hold 20 elements????) On arrays you can just act on the properties/methods of the element type. not the elements itself. The events (e.g. Value Changed) react on the elements not the types - so not possible for array elements. Didier Quote Link to comment
jpdrolet Posted November 25, 2004 Author Report Share Posted November 25, 2004 It's not just the event structure that doesn't allow selection of array elements, but all property/methods applied on array elements fall into this topic.It it an intended behaviour. Since at designtime you don't know how many elements will be in the array, and at runtime the number or elements can change, you would get problems when wanting to change the property of element that doesn't exist anymore (how would you create an event on the 25th element of an array when your array just hold 20 elements????) On arrays you can just act on the properties/methods of the element type. not the elements itself. The events (e.g. Value Changed) react on the elements not the types - so not possible for array elements. Didier 2761[/snapback] But still, there are controls in the array and they could generate UI events. You can type in or click a control even if the array is empty. You can know which element is currently edited (a specific property for that would be convenient) so you could act on this element according to the event.. Quote Link to comment
hfettig Posted November 25, 2004 Report Share Posted November 25, 2004 Actually, it is possible to do what you want to do. It took a bit of creative programming, but I was able to do it. Please see the attached vi. If you want the change of the value to trigger a value change event for the array, change the propertynode from 'Value' to 'Value (Signaling)' Just as an aside, would it not be more convenient to just have the user type 'NaN' into the control? That's three key strokes as compared to two and a lot less programming effort. Cheers, Heiko Download File:post-1022-1101394372.vi Quote Link to comment
jpdrolet Posted November 25, 2004 Author Report Share Posted November 25, 2004 ...Just as an aside, would it not be more convenient to just have the user type 'NaN' into the control? That's three key strokes as compared to two and a lot less programming effort. ... 2764[/snapback] Customer wish... By the way, it was asked that only Delete would be used but it is already a standard key used to edit the number. That would be confusing... Thank you very much hfettig :thumbup: 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.