LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

command buttons best practice

Solved!
Go to solution

Hello,

 

I would like to ask how others design their GUI with several command buttons (OK button Boolean).

For instance, there is a simple application where the user can start data acquisition by clicking on a button with text "Start monitoring". Instead of having another button with text "Stop monitoring", usually I just change the button label text into "Stop monitoring", so it is obvious to the user that again clicking on it will stop the monitoring process of the app (in the event case of this button I read out the actual label text with property node in order to decide which action to message to the DAQ loop from the GUI Event handler loop).

 

If I have another button with label text like "Start file record", I do the same way: after starting file record, I change the text to "Stop file record".

 

To avoid unnecessary extra programming, this button is only in Enabled state if the application is already in the "monitoring" state. Also, if there is an ongoing file record (+ DAQ obviously), the user cannot operate the "Stop monitoring" button. So depending on the state of the applications, some buttons are Enabled, some in "Disabled and grayed out" state.

 

I wonder how others are doing their GUI/application?

I am not sure if this is a good way to do, but at least I can avoid extra state check programming and minimizing the number of buttons...

0 Kudos
Message 1 of 11
(3,722 Views)
Solution
Accepted by topic author Blokk

I use the Boolean Text options in the properties menu where you can have different text for the TRUE and FALSE states of your buttons.  This eliminates some of the code it sounds like you writing.

 

Play and Pause are the two options that I usually use if buttons.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 11
(3,702 Views)
Haha! I just did not think about it, thanks! 🙂
0 Kudos
Message 3 of 11
(3,698 Views)
Hmm, and i guess i can use " switch when pressed" button behaviour, right?
0 Kudos
Message 4 of 11
(3,693 Views)

@Blokk wrote:
Hmm, and i guess i can use " switch when pressed" button behaviour, right?

Exactly


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 11
(3,677 Views)

Also booleans can have three different images associated with them (well more for things like mouse over but that's not what  I mean).  You can have an image that is shown when the button it True, when the button is False, or an image that is shown when it is either False or True.  So on top of having the text show "Start" or "Stop" I usally replace the True image and the False image with a start and stop icon.  Customize the boolean control, and then right click and choose Import Picture From Clipboard and select the appropriate state.

0 Kudos
Message 6 of 11
(3,671 Views)
Personally I like the switch when released behavior because it allows you to compensate for the ohh-no-second. The ohh-no-second is the discrete amount of time it takes to realize you just did a mouse-down on the wrong button.

Because it doesn't switch until the mouse up, you can slide off the button before letting go of the mouse button and no change is made in the booleans state.

Mike..

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 7 of 11
(3,629 Views)
Yep, but i always pop up an "are you really sure?" window for dangerious actions, like stopping something. Of course if the user cancels the action, i programatically have to switch the button off.
0 Kudos
Message 8 of 11
(3,610 Views)

@mikeporter wrote:
Personally I like the switch when released behavior because it allows you to compensate for the ohh-no-second. The ohh-no-second is the discrete amount of time it takes to realize you just did a mouse-down on the wrong button.

Because it doesn't switch until the mouse up, you can slide off the button before letting go of the mouse button and no change is made in the booleans state.

Mike..

I like this because it is how a lot of buttons work on Windows.  Because of this I tend to just click a lot of buttons and think about what that means when I am holding down the mouse.  

 

I wish I could make use of the ohh-no-second when I fat finger ctrl-w.

Matt J | National Instruments | CLA
0 Kudos
Message 9 of 11
(3,602 Views)

hm, but yes, the switch when released is just more a behaviour what the a general user expects, so i will use this option! thanks for the suggestion!

0 Kudos
Message 10 of 11
(3,600 Views)