Home2L - C/C++ API v1.4-0-g38cc (2024-05-25)
Smart Tools for a Private Home
Classes | Macros | Typedefs | Enumerations | Functions
ui_widgets.H File Reference
#include "ui_screen.H"
Include dependency graph for ui_widgets.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CModalWidget
 Widget that can pop up on a screen, such as a menu or a message box. More...
 
class  CCursorWidget
 Widget with an additional rectangular cursor. More...
 
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...
 
class  CListboxItem
 Listbox item. More...
 
class  CListbox
 Listbox widget. More...
 
class  CMenu
 Menu widget. More...
 
class  CMessageBox
 Message box widget. More...
 
class  CInputLine
 Input line widget. More...
 
class  CInputScreen
 Screen with an input line widget. More...
 
class  CSlider
 Slider widget. 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...
 
#define LISTBOX_ITEM_BORDER   4
 Border spacing around labels in pixels.
 
#define LISTBOX_TRAMPOLINE(CB_NAME, CLASS_NAME, METHOD_NAME)
 Macro to create a trampoline to another class. More...
 
#define MENU_DEFAULT_FONT   FontGet (fntNormal, 20)
 Default font for menus.
 
#define MENU_DEFAULT_COLOR   DARK_GREY
 Default color for menus.
 
#define MSGBOX_DEFAULT_FONT   FontGet (fntNormal, 24)
 Default font for message box contents.
 
#define MSGBOX_TITLE_FONT   FontGet (fntBold, 32)
 Title font for message boxes.
 
#define MSGBOX_COLOR   DARK_GREY
 Default color for message boxes.
 
#define MSGBOX_SPACE_X   32
 Horizontal space around message box contents.
 
#define MSGBOX_SPACE_Y   32
 Vertical space around message box contents and between the title and contents.
 
#define MSGBOX_BUTTON_MINWIDTH   160
 Minimum width of message box buttons.
 
#define mbmCancel   ((int) (1 << mbiCancel))
 Bit mask to select a "Cancel" button.
 
#define mbmOk   ((int) (1 << mbiOk))
 Bit mask to select an "OK" button.
 
#define mbmNo   ((int) (1 << mbiNo))
 Bit mask to select an "No" button.
 
#define mbmYes   ((int) (1 << mbiYes))
 Bit mask to select an "Yes" button.
 
#define mbmOkCancel   (mbmOk | mbmCancel)
 Bit mask for the "OK / Cancel" combination.
 
#define mbmYesNoCancel   (mbmYes | mbmNo | mbmCancel)
 Bit mask for the "Yes / No / Cancel" combination.
 
#define mbmNone   ((int) 0)
 Bit mask for no button.
 
#define SLIDER_WIDTH   48
 Default width of a slider.
 
#define SLIDER_BAR_HEIGHT   16
 Default height of a slider bar.
 
#define SLIDER_TRAMPOLINE(CB_NAME, CLASS_NAME, METHOD_NAME)
 Macro to define a trampoline to another class. More...
 

Typedefs

typedef void FCbButtonPushed(class CButton *button, bool longPush, void *data)
 Function prototype for CButton callbacks.
 
typedef void FCbListboxPushed(class CListbox *, int idx, bool longPush, void *data)
 Callback prototype for CListbox push events.
 

Enumerations

enum  EListboxMode { lmReadOnly , lmActivate , lmSelectSingle , lmSelectAny }
 List box mode. More...
 
enum  EMessageButtonId
 IDs for standard buttons.
 

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.
 
int RunMenu (const char *_itemStr, SDL_Rect _rContainer, int _hAlign=-1, int _vAlign=-1, TColor color=MENU_DEFAULT_COLOR, TTF_Font *_font=NULL, bool *retLongPush=NULL)
 Run a menu with a single function call. More...
 
Running a message box with a single function call ...
int RunMessageBox (const char *title, const char *text, int buttonMask=mbmOk, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run an arbitray message box.
 
int RunInfoBox (const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 
int RunInfoBox (const char *title, const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run an info box with an "OK" button.
 
int RunWarnBox (const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 
int RunWarnBox (const char *title, const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run an warning box with an "OK" button.
 
int RunErrorBox (const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 
int RunErrorBox (const char *title, const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run an error box with an "OK" button.
 
int RunSureBox (const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 
int RunSureBox (const char *title, const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run an "Are you sure?" box. Returns 1 if sure and <= 0 otherwise.
 
int RunQueryBox (const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 
int RunQueryBox (const char *title, const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run a "Yes/No/Cancel" query box. Returns 2 on "yes", 1 on "no" and 0 otherwise.
 
Manually operated message boxes ...

(e.g. for "please wait..." popups)

CMessageBoxStartMessageBox (const char *title, const char *text, SDL_Surface *icon=NULL, int buttonMask=mbmOk, int hAlign=0, TTF_Font *font=NULL)
 
static void IterateMessageBox ()
 
static int GetMessageBoxStatus (CMessageBox *msgBox)
 
void StopMessageBox (CMessageBox *msgBox)