BUTTON widgets are commonly used as the primary user interface element for touchscreens. Buttons may be displayed with text or with a bitmap.
| BUTTON
|
BUTTON with new skin.
|
| Receives focus
|
Yes
|
| Skinnable
|
Yes
|
| OwnerDraw
|
No
|
| Uses Memory Devices
|
No
|
| Attached widgets
|
None
|
Notification codes
The following events are sent from a BUTTON widget to its parent window as part of a WM_NOTIFY_PARENT message:
| Message |
Description
|
| WM_NOTIFICATION_CLICKED
|
BUTTON has been clicked.
|
| WM_NOTIFICATION_RELEASED
|
BUTTON has been released.
|
| WM_NOTIFICATION_MOVED_OUT
|
BUTTON has been clicked and pointer has been moved out of the BUTTON widget without releasing.
|
Keyboard reaction
The BUTTON widget reacts to the following keys if it has the input focus:
| Message |
Description
|
| GUI_KEY_ENTER
|
If the key is pressed, the BUTTON reacts as it has been pressed and immediately released.
|
| GUI_KEY_SPACE
|
If the key is pressed, the BUTTON state changes to pressed. If the keys is released, the BUTTON state changes to unpressed.
|
Samples
Below are links to samples that demonstrate how to use BUTTON widgets in emWin.