Checkboxes, like buttons, can also be clicked by the user. A checkbox is assigned two branch events, one for the checked or SET state and the other for the unchecked or RESET state. If the box is checked, perform Action A, if the box is unchecked, perform Action B. As with buttons, checkboxes can be assigned to events with either bracketed branch events or with subroutines. This demo will continue with branch events. By using checkboxes instead of buttons, the images can be either drawn (checked) or erased (unchecked) with the control. This is the toggling effect. Rather than placing the actual block of code in the appropriate branch event, a Gosub is employed. The use of Gosubs is for a smooth transition to the next demo. Could you just place the actual code beneath each branch event as you did with the buttons? Absolutely.
For more information about Gosubs, read Subroutines and Gosubs by Alyce Watson in Liberty BASIC Newsletter #114
A checkbox is great way to gather yes/no or on/off type of information from the user. Each checkbox is independent of the other checkboxes. Sometimes this isn't desirable. Supposing you don't want your user to have both a sunny day and a cloudy day. Rather than a simple toggling, you might want to restrict the user to just one option. Enter Radiobuttons.
What is a Checkbox?
Checkboxes, like buttons, can also be clicked by the user. A checkbox is assigned two branch events, one for the checked or SET state and the other for the unchecked or RESET state. If the box is checked, perform Action A, if the box is unchecked, perform Action B. As with buttons, checkboxes can be assigned to events with either bracketed branch events or with subroutines. This demo will continue with branch events. By using checkboxes instead of buttons, the images can be either drawn (checked) or erased (unchecked) with the control. This is the toggling effect. Rather than placing the actual block of code in the appropriate branch event, a Gosub is employed. The use of Gosubs is for a smooth transition to the next demo. Could you just place the actual code beneath each branch event as you did with the buttons? Absolutely.
For more information about Gosubs, read Subroutines and Gosubs by Alyce Watson in Liberty BASIC Newsletter #114
A checkbox is great way to gather yes/no or on/off type of information from the user. Each checkbox is independent of the other checkboxes. Sometimes this isn't desirable. Supposing you don't want your user to have both a sunny day and a cloudy day. Rather than a simple toggling, you might want to restrict the user to just one option. Enter Radiobuttons.