LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview events and disabled controls on a tab control

Phil,

See if this does what you are looking to do.


-Mike
Message 11 of 22
(1,686 Views)
The whole point of this exercise is to make my user interface intuitive. I can't possible have disable buttons on my control panel and not explain why the user can't use them. If a user without access comes along and presses a button they do not have access to, then they are politely told that they do not have access to this button and then given the option to log into the system. With what you are suggesting the user shouldn�t get any help and allowed to stand there like a lemon trying to press button and having no idea why they don't work. This is a feature I�m having to program myself as it was missed out of the labview DSC module.
As far as I can see, NI has given me the option to use events on disable controls and all they have done i
s made a few mistakes on the implementation. I am sure it is not just me who has used this feature and many users probable use disabled event happily and not come across this problem. If NI removes this feature from further releases then it runs the risk of make code written in 6.1 non-functional in future version. Ni has made their bead and rightly or wrongly they have to sleep in it.
0 Kudos
Message 12 of 22
(1,893 Views)
Hiya,
OK. No offence to the general population, but sometimes users do things with your program that you don't really expect. Ever written a program that does something simple? Example I wrote (useing cvi here) that put a time and date into a string on the front panel. I had users who tried to change the value in that box because the computer clock didn't match the time on their wrist watch. Program defensively, and you can catch for almost anything.
The next example is a little more realistic - what if you have a touch screen. What if you have a user handling system that automatically enables and disables controls by passwords. What if someone wants to do something, but they're not logged in. Ever tried to hit a menu on a touch screen? What about if the system is left alone, and set to automatically log a user out if it's not in use? (Just in case the user has forgotten to log out and doesn't want to allow users with less access rights to do certain things).

And finally - what if, as a programmer, your customer said that was the behaviour they wanted?

Counter intuative becomes a way of life when you deal with the multitude of us humans, who always search for a way to do something different. I've seen a lot of software test procedures, that have been written for military applications, and they're always designed to stress the software to breaking point by doing things out of the ordinary. It's not to be awkward, it's just so that a new user doesn't have to go through the whole of the manual looking for the caveats.

I agree in principle that there are times when you can change the way the program works by giving the user a login button, and getting them to login first, and then they'll have access to particular options. But it's just so nice when you can give the user extra information, like - "Go fetch your supervisor to gain administrator access" when they do try something "counter intuative"

Clicking on a disabled item and expecting a reaction is down to how you program. If you don't want a reaction, then check to see if it's disabled, and ignore it, but please don't take away the ability to do this.

Try writing a handler that doesn't need multiple transparent overlayed controls to catch the disabled button on the front panel, and without sitting in a permanent polling loop. It's not impossible, but it's complex. (Or maybe someone has an answer there that will make us all look dumb).

That's all - programming should be fun - that's one of the reasons behind LabVIEW.

2 cents worth plus 2.

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 13 of 22
(1,686 Views)
Hi all,
you know what I said about there might be an elegant solution that I was missing - here it is. (well I think it's kinda elegant. ok so it's not elegant, but it's another possibility that should be consistent for future versions....

Not ideal, as you have to handle buttons in groups, but it does at least allow you to use events again, reasonably sensibly. - Not easily expandable either.
Guess it's just another option.

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 14 of 22
(1,686 Views)
You still haven't convinced me that you need an event handler for a disabled control. If all you are going to do is tell the user they can't use the control, then isn't the "disabled grey" of the control enough feedback without enlisting the help of the ever annoying popup box? Secondly, If I saw a disabled control, I would not click on it, and I wouldn't receive your intended message anyway.

If you want to give explicit information to the user about the state of the system, there should be a status box somewhere. If you want to give information about an individual control, use the "Tip Strip" property so that the little yellow tool help text shows up.
0 Kudos
Message 15 of 22
(1,686 Views)
Hi,
You said it exactly -
"Secondly, If I saw a disabled control, I would not click on it, and I wouldn't receive your intended message anyway."

There are other people who will press the button. I like the idea of useing the tip-strip, though it doesn't trigger anything like the ability to automatically bring up a login prompt, but then again the program could be re-designed. Also, the cursor isn't really in existence on a touch screen - what I mean is, it's designed to be pressed, not drag the cursor over the control and then hit a control, so tip-strips won't work for this case unless you've already clicked on the item.

I think we'll let this one go, agree to disagree, and see what National Instruments do in future versio
ns.
Remember what sparked this off was a need to get consistent behaviour between events on the panel, and events on a tab control.

Thanks

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 16 of 22
(1,699 Views)
I think you guys all missed the point of his post!

His issue was not wether or not the event responded to a disabled item. His issue was that it is INCONSISTENT. If the control is on a tab it behaves one way, of its not on a tab it behaves completely opposite.

My two cents, disabled controls are disabled. thats why you disable them. You can press the play button on your DVD player when the  power light off, and you dont get a popup saying "You cant play right now, the powers off".

Its a major hassle having to put extra property and case structures in to check whether a control is disabled.  AT LEAST give us a disabled state terminal on the left side of the event structure.

I think NI just missed the inconsistency on and off tabs.

0 Kudos
Message 17 of 22
(1,606 Views)

Or maybe it's you who's missed the point, since a mouse up event should not care whether a control is disabled or not or whether it's on a tab or not, as the original poster suggested. It should always work.

Also, this doesn't really matter since this information is 3 versions old and the problem has been fixed long ago.

___________________
Try to take over the world!
Message 18 of 22
(1,591 Views)
If you wanted to grey out a control and still react to its events, why would you not mark is "Greyed" as opposed to "Disabled and Greyed" ?

0 Kudos
Message 19 of 22
(1,583 Views)

I think you don't understand what the mouse up event is. All it does it to check whether you released the mouse button while the mouse pointer was over the control, which means it is not affected by enabled state.

To get an event which actually interacts with the control, you usually use Value Change, which is affected by the enabled state.


___________________
Try to take over the world!
Message 20 of 22
(1,578 Views)