ebmDevMag.com home
ebm Developer's Magazine
links

developer's mag
main page

article
part 1
part 2
part 3
part 4
part 5
part 6
part 7
part 8
part 9


4 - Button Handling

On pressing a button, the form's MsgHandler() is sent a MSG_BUTTON_SELECT message. The sole exception is CRepeatButton, which sends a MSG_BUTTON_REPEAT message repeatedly while pressed. All buttons send the current button state as a Boolean value in the data component of the message, with true representing a down button, and false for up. This is useful to determine if a button is being pressed or released, such as possible with a pushbutton.

Now you have your buttons set up, what to do? Although each provides a variety of functions, the most generally useful are the following:
  • GetDownStatus() - Set button down (or check a checkbox or radio button).
  • SetDownStatus() - Get button down status.
  • SetLabel() - Set button caption.
  • GetLabel() - Get button caption.
Remember, as with most UI objects, the characters passed to SetLabel() must exist for the life of the button object, or until changed by another SetLabel() call.

Previous Section
Next Section

Copyright © 2001-2006 ebmDevMag.com - Legal Notice