Home2L - C/C++ API  v1.2-2-ga4fe (2023-04-15)
Smart Tools for a Private Home
Classes | Macros | Typedefs | Functions

Description

Push-button widgets.

Collaboration diagram for Button:

Classes

class  CButton
 Push-button widget. More...
 
class  CFlatButton
 Flat Push-button widget. More...
 
struct  TButtonDescriptor
 Descriptor for a button on the main button bar. More...
 

Macros

#define BUTTON_DEFAULT_FONT   FontGet (fntNormal, 24)
 Default font for CButton labels.
 
#define BUTTON_LABEL_BORDER   8
 Border spacing around labels in pixels.
 
#define BUTTON_TRAMPOLINE(CB_NAME, CLASS_NAME, METHOD_NAME)
 Macro to create a trampoline from CButton to another class. More...
 

Typedefs

typedef void FCbButtonPushed(class CButton *button, bool longPush, void *data)
 Function prototype for CButton callbacks.
 

Functions

void CbActivateScreen (class CButton *, bool, void *screen)
 Convenience callback for all sort of "Jump-to-screen" buttons (including home). 'data' must point to a valid CScreen object.
 
CButtonCreateMainButtonBar (int buttons, TButtonDescriptor *descTable, CScreen *screen)
 Create a dynamic array of CButton objects for a main button bar. 'screen' is passed as the user data field to each button. If 'screen != NULL', all buttons are added to the screen as widgets.
 

Macro Definition Documentation

◆ BUTTON_TRAMPOLINE

#define BUTTON_TRAMPOLINE (   CB_NAME,
  CLASS_NAME,
  METHOD_NAME 
)
Value:
void CB_NAME (class CButton *button, bool longPush, void *data) { \
((CLASS_NAME *) data)->METHOD_NAME (button, longPush); \
}
Push-button widget.
Definition: ui_widgets.H:214

Macro to create a trampoline from CButton to another class.

The class must define a method:

void CLASS_NAME::METHOD_NAME (CButton *button, bool longPush)

If the method is protected, the following line may be added to the class:

friend CB_NAME (CButton *, bool, void *);

To the button, the trampoline must be passed by a call like:

CButton::SetCbPushed (CB_NAME, <class object pointer>)

Definition at line 202 of file ui_widgets.H.