05-08-2013 02:46 PM
Hi all,
I have 2 listboxes one enabled and one disabled & grayed. When I drag an item (from the enabled one) I can drop it in the disabled & grayed!
Is this normal behavior??
Work around: when disable & grayed the lisbox pragmatically, also set the allow dropping off.
Solved! Go to Solution.
05-09-2013 11:24 AM
A LabVIEW pureist would say that the control is disabled because the value of the control cannot be changed and because you aren't changing the value when you drag and drop it is okay.
But the user in me thinks you would be right. When I disable the control I wouldn't want to be able to drag and drop to it.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-09-2013 11:48 AM
Hi Hooovahh,
Thanks for your reply,
When you drag and drop in to the control its value is actually changing.
05-09-2013 12:03 PM
You are right sorry I didn't expect the event "Value Change" to be generated but it is. My vote is bug.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-09-2013 12:46 PM
This is kind of a grayed area...
The 'value' of the listbox is not changing. The selection is the value, not the list of items. I have to side on not a bug, BUT at the same time I have to agree that it is not expected behavior. I think the default behavior should be that disabling a listbox also disables dropping, but it should be possible to turn it on if so desired. Instead of almost always wanting to disable dropping at the same time you disable a control, it should be that the few times you want a disabled control which allows dropping that you have to set it explicitly. Make sense?
05-09-2013 12:52 PM
The value is changing, test it yourself
05-09-2013 01:02 PM
Ha, you are right. I had a brain cramp and tested it using a VI where I overrode the default behavior. You are right a control left to its own devices accepts the drop and changes the value to the new selction.
B-U-G
05-10-2013 03:36 AM
Hello,
I just tested it at my side with an empty install of LabVIEW 2012.
My hunch feeling says that it should not be possible to do that if the control is disabled, but..
If I tested it at my own side from scratch, then something popped up:
The default Modern Listboxes have by default dragging and dropping (inside the listbox) disabled. (i forgot that because I noramlly use a customized version)
So you explicitely have to enable dropping, before you can see this behavior and might be that some people would want to have behavior like this.
Imagine someone that would like to drop into a listbox, that you cannot drag something out anymore (without other "actions"). (I'm thinking about to do lists etc..)
For this you could use a disabled listbox.
I fully agree that it might be weird behavior, but you have to explicitely set that property to enable the dropping.
If you want me to, then I could file it as a Corrective Action Request.
However, I don't know if it will get "accepted".
05-10-2013 04:23 AM
Hi ThiCop,
Thanks for the reply.
There can be several ways to look at it, but Disabled is Disabled
05-10-2013 06:39 AM
Hello Franzo,
From the "User Side" I fully agree with you, but from a programmer's side there's something holding me back.
That's why I also said I agreed with it by following my hunch feeling.
Can you explain me how you're using the drag and drop feature and in which situation you want to disable/enable it?
Having an idea about the use case will help me create a "convincing" Corrective Action Request.
How would you see the "perfect situation" for this control?
Would you like to remember the control's original state (with regards to dragging and dropping) when you disable it (and afterwards re-enable it)?
Should it use the original drag and drop settings when re-enabled afterd disabling?
I'm just asking this, because this will allow me to fully follow the way you want it to behave.
And in this case (bugs or CARs) more documentation and use cases are always better.
Also a good idea would also be to post your idea on the NI Idea Exchange pages:
ni.com/ideas
This could make the idea very popular and likely to be implemented in the next versions of LabVIEW.