Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Using the 2-State Buttons (SW1 - SW4)
No permission to create posts
June 24, 2013
8:44 pm
W Pirkle
Forum Posts: 187
Member Since:
January 29, 2017
sp_UserOfflineSmall Offline

I have added 4 new buttons to the UI that you can use similarly to the way you use radio buttons; by creating a UINT and enum{}. The buttons labeled SW1-SW4 are on-off (2-state) types. If you right click on one of the buttons to set it up you will see a similar dialog as the radio-button setup. You provide a UINT variable to connect the button to your code. The enum is hard-coded and can not be changed. The values are {SWITCH_OFF, SWITCH_ON} and the default is the first one OFF. Because these correspond to {0,1} you can use them easily. For example, if you wanted a MUTE button, you could set up one of the 2-state buttons like this:

Control Name: MUTE
variable: m_uMute

Then in your code, you can test the button state:

// do mute processing...

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 41

Peter: 41

Frodson: 40

clau_ste: 39

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 495

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 31

Topics: 511

Posts: 1966

Newest Members:

CoraDias, Edoardo, knooierd, daniel, Merril Bradshaw, BillPlunkett, Pajczur, michaelwayneharwood, RickM, rainbow wind

Moderators: W Pirkle: 187

Administrators: Tom: 66, JD Young: 80, Will Pirkle: 0, W Pirkle: 187