07-21-2015 04:34 AM
Dear sir,
I have implemented the logic for parameter validation when click on pane using mouse down event. But in my logic the events are contradicting. Kindly solve my pane mouse down event for attached Main_draft.vi.
Thanks & Regards,
S Nagaraju
+91 9989554142
07-21-2015 09:52 AM
I'm having a hard time figuring out what you're trying to do with all of these mouse and key events. You have a lot of unnecessary sequence strctures and you do a lot of key focusing and I'm not sure exactly what the point is other than to annoy the user in to putting in the correct values.
If you use a pane mouse-down event, it's going to get triggered when the user clicks within the pane, even if the user clicks on an object that already has another event registered. Why don't you just create a Value Change event for the inputs and buttons? This would only trigger when the user attempts to push a button, or changes a value. You really shouldn't use mouse-down/key-down events when you're checking values because it's overkill.
Also, your application locks the user from stopping the program if they've entered in a wrong value. This doesn't make for a good user experience.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-22-2015 12:09 AM
Thanks for the replay James,
My task is to develop an interactive GUI, for that first i have to validate the parameters entered by the user. Parameters are should validate based on the user inputs. Let us the user entered the value in one control and he moves on to another control, he may use "Tab" or "Enter" on keyboard and may use mouse also. At that time the parameter should validate with respect to the event done by the user. In this case, if i use the value change event difficult to validate because i have a value corresponding to units. Initially i was started with value change event only but due to values with units i faced the difficulties to validate. That’s why i am using the mouse and key down events.
Here i am using the key focus property because if the entered value is invalid it should be highlighted.
If i introduce Pane mouse down event, event contradiction was happened.
Kindly help me to develop the user friendly GUI. And please implement the one example VI for my reference.
Thanks & Regards
S Nagaraju
+91 9989554142
07-22-2015 09:13 AM - edited 07-22-2015 09:15 AM
One alternative may be to not allow bad input to begin with by filtering keystrokes. (Personally, I'd strangle the person who implemented this, though.)
07-22-2015 09:35 AM
@billko wrote:
One alternative may be to not allow bad input to begin with by filtering keystrokes. (Personally, I'd strangle the person who implemented this, though.)
I had a GPS that did this. It was fine-ish for street names, but it even did it for street numbers. Once, I wanted to go to 75 main street or something and it only let me input a 2 as the first digit because for some reason it decided that every address number began with a 2 on that street.
Moral of the story, If you're not careful, this can lead to a pretty annoying UI experience. Strangling well deserved.
07-22-2015 09:46 AM
@11532 wrote:
because if the entered value is invalid it should be highlighted.
Contrary to your other points, this is the perfect reason for a value change event. Everything you do with your mouse and key down events can be done in a value change event. You could even change the value back to it's previous value if the new value invalid and highlight it.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-22-2015 11:51 PM
Hi James,
As you said, i will use value change event. Let us consider the two controls Frequency (value) and Freq units (Hz, KHz, MHz & GHz) both events are edited with value change events. The default value of the both controls are 2200 and MHz. Internally whatever units are given by the user i will convert to MHz and my limits are 2200 to 18000. The user wants to change the frequency value 5 GHz. The user entered 2200 to 5 means that the value change event has been occurred. While change the units it will validate and shows the invalid frequency because it’s taken the units as MHz.
Find the enclosed VI for more clarity and solve the issue.
Thanks & Regards,
S Nagaraju
07-23-2015 08:41 AM
The really simple solution here is to just leave the units as GHz and not let the user change that. Since you are always in the 2.2GHz to 18GHZ range, it makes little since to input MHz or lower. Counting 0s is a pain.
07-24-2015 07:03 AM
But, our customer asking drop down box for units.
07-24-2015 07:38 AM - edited 07-24-2015 07:39 AM
Since it is a hard requirement, here is what I suggest:
Instead of using doing a verification of the frequency when you change the units, change the value in the frequency control. For instance, if you currently have 5000 MHz and you change the units to GHz, change the value in the frequency control to 5. So your underlying frequency has not changed, therefore it is known to be valid.
Note: my full VI is attached in the zip file in case you don't want to mess around with the snippet.