07-18-2012 08:59 AM - edited 07-18-2012 09:05 AM
This little VI is almost complete now - I just have a last couple of bugs to iron out, but I'm not sure how to fix them.
Thank you in advance!
- James
07-18-2012 10:49 AM
@James Mamakos wrote:
- BoolText.Text not being read as expected:
- For some reason, when running the VI with breakpoints and the lightbulb on, I notice that it always reads "Del" no matter what the button shows on the FP or what was written to the property before.
- Why? And how can I fix this?
Your button is set to display mutiple strings and you are only changing the FALSE string. When the button is pressed, you are looking at the TRUE string, whcih is still "Del". To fix, go to the properties dialog of that button and uncheck "multiple strings".
I'll look at the rest later, maybe.
07-18-2012 11:36 AM
Focus is not restored to the string control after a message box.
- If you press the "Enter" button or press "Enter"/"Return" on the keyboard when the string command is empty, a message box will come up prompting you not to leave the string control empty.
- It seems that when the message box is brought up by a KeyDown event, the focus is properly restored to the string control after. But if it's brought up by pressing the button, the focus is not restored.
- Why? And how can I fix this?
This appears to be a timing issue. If you insert a small delay (10 msec is probably adequate) after the dialog box closes, it should shift focus back. Note: You are using a single button dialog, but your message says "Please enter a value or click cancel". This seems to imply that it's supposed to have two buttons? OK and Cancel? This is confusing from a user perspective.
The focus is not given to the string control when the VI is called, if the window appearance is set to 'Floating'.
- I would like the window to be floating without losing the focus thingy.
- Is there a work-around I could use for this?
Again, this is a timing issue. Insert a small delay right before you try to set the focus in your init state.
07-18-2012 01:24 PM - edited 07-18-2012 01:30 PM
@altenbach wrote:
Your button is set to display inutile strings and you are only changing the FALSE string. When the button is pressed, you are looking at the TRUE string, which is still "Del". To fix, go to the properties dialog of that button and uncheck "multiple strings".
Thank you for that - I never knew it was a feature!
@smercurio_fc wrote:
This appears to be a timing issue. If you insert a small delay (10 msec is probably adequate) after the dialog box closes, it should shift focus back. Note: You are using a single button dialog, but your message says "Please enter a value or click cancel". This seems to imply that it's supposed to have two buttons? OK and Cancel? This is confusing from a user perspective.
The dialog message is referring to the keypad FP itself rather than to the message box. One of the buttons (Del/CA) acts as a cancel button if the Display control string is empty. By "enter a value", I mean that you need something in the Display control to be able to exit the VI by pressing the Enter button. Is there perhaps a better way of trying to say this so that the meaning is more transparent to the user?
If the Display string has a value in, then you press Enter to exit with that value as an output. If the Display string is empty, then press the Cancel button to exit with no output.
@smercurio_fc wrote:
Again, this is a timing issue. Insert a small delay right before you try to set the focus in your nit state.
Thank you - I shall try adding the delays when I get back to the office. 🙂