Muteki
EABI code execution on Besta® RTOS devices.
Loading...
Searching...
No Matches
button.h File Reference

Button widget constructor and methods. More...

#include "../types/button.h"

Go to the source code of this file.

Functions

void RelatedKeyButton (ui_button_t *button, int keycode)
 Bind a button to a keyboard key.
void RelatedKeyButtonEx (ui_button_t *button, int keycode)
 Bind a button to a keyboard key and attach the prompt string for that key.
void UnRelatedKeyButton (ui_button_t *button)
 Remove existing key binding on a button.
ui_button_t * CreateButton (unsigned short tag, short x0, short y0, short x1, short y1, const UTF16 *label, unsigned int event, unsigned short flags)
 Create a button widget object.
void ChangeButton (ui_button_t *button, const UTF16 *label, unsigned int event)
 Modify and redraw the button.
void PBUTTON_draw (ui_button_t *self)
 Default draw callback of the button widget.

Detailed Description

Button widget constructor and methods.

Function Documentation

◆ ChangeButton()

void ChangeButton ( ui_button_t * button,
const UTF16 * label,
unsigned int event )
extern

Modify and redraw the button.

Syscall Number
0x1014b
Parameters
buttonThe button object.
labelNew UTF-16 encoded string to be used as a label. Will be skipped if set to NULL.
eventNew custom event to be sent on button press. Will be skipped if set to 0.
Returns
None.

◆ CreateButton()

ui_button_t * CreateButton ( unsigned short tag,
short x0,
short y0,
short x1,
short y1,
const UTF16 * label,
unsigned int event,
unsigned short flags )
extern

Create a button widget object.

Todo

Test the event behavior. This needs more reverse engineering on the view event handling process.

Figure out the flags.

Syscall Number
0x1014a
Parameters
tagComponent tag. Can be used to distinguish components under some circumstances (like when sharing a callback with another component, or looking up an item with GetDeskItem()). Does not need to be unique. Usually will be set by AllocBlock() after the memory was allocated.
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive), or 0 to let the function automatically decide the size.
y1Y coordinate of the bottom-right corner, in pixels (inclusive), or 0 to let the function automatically decide the size.
labelUTF-16 encoded string to be used as a label.
eventCustom event to be sent on button press.
flagsFlags. Valid options seem to be 2, 4, 0x40.
Returns
The allocated object.

◆ PBUTTON_draw()

void PBUTTON_draw ( ui_button_t * self)
extern

Default draw callback of the button widget.

Syscall Number
0x1014e
Parameters
self

◆ RelatedKeyButton()

void RelatedKeyButton ( ui_button_t * button,
int keycode )
extern

Bind a button to a keyboard key.

Syscall Number
0x10147
Parameters
buttonThe button object.
keycodeKeycode.
Returns
None.
See also
ui_keycode_e

◆ RelatedKeyButtonEx()

void RelatedKeyButtonEx ( ui_button_t * button,
int keycode )
extern

Bind a button to a keyboard key and attach the prompt string for that key.

The default draw callback will draw the key prompt string before the label string (e.g. F1 Press Me)

Syscall Number
0x10148
Parameters
buttonThe button object.
keycodeKeycode.
Returns
None.
See also
ui_keycode_e
ui_button_s::key_binding_str

◆ UnRelatedKeyButton()

void UnRelatedKeyButton ( ui_button_t * button)
extern

Remove existing key binding on a button.

Syscall Number
0x10149
Parameters
buttonThe button object.
Returns
None.