tcMenu
Classes | Typedefs | Enumerations | Functions
BaseDialog.h File Reference

The definition of the base dialog object, that can be used with any display type. These are designed to handle simple user informational pages and questions. More...

Go to the source code of this file.

Classes

class  BaseDialogController
 
class  BaseDialog
 
class  LocalDialogButtonMenuItem
 
class  MenuBasedDialog
 

Typedefs

typedef void(* CompletedHandlerFn) (ButtonType buttonPressed, void *yourData)
 
typedef void(* DialogInitialiser) (MenuBasedDialog *)
 

Enumerations

enum  ButtonType : uint8_t {
  BTNTYPE_OK , BTNTYPE_ACCEPT , BTNTYPE_CANCEL , BTNTYPE_CLOSE ,
  BTNTYPE_NONE , BTNTYPE_CUSTOM0 = 15 , BTNTYPE_CUSTOM1 , BTNTYPE_CUSTOM2 ,
  BTNTYPE_CUSTOM3 , BTNTYPE_CUSTOM4 , BTNTYPE_CUSTOM5 , BTNTYPE_CUSTOM6 ,
  BTNTYPE_CUSTOM7
}
 

Functions

int dialogButtonRenderFn (RuntimeMenuItem *item, uint8_t, RenderFnMode mode, char *buffer, int bufferSize)
 
void withMenuDialogIfAvailable (DialogInitialiser dlgFn)
 

Detailed Description

The definition of the base dialog object, that can be used with any display type. These are designed to handle simple user informational pages and questions.

Typedef Documentation

◆ CompletedHandlerFn

typedef void(* CompletedHandlerFn) (ButtonType buttonPressed, void *yourData)

If you need to capture the finished state of the dialog, then you create a function to this spec and it will be called back once the dialog is dismissed. Example: void completedCallback(ButtonType buttonPressed);

◆ DialogInitialiser

typedef void(* DialogInitialiser) (MenuBasedDialog *)

a callback method that is used alongside withMenuDialogIfAvailable(..)

Enumeration Type Documentation

◆ ButtonType

enum ButtonType : uint8_t

The types of button that can be passed to setButton for button 1 and button 2

Function Documentation

◆ dialogButtonRenderFn()

int dialogButtonRenderFn ( RuntimeMenuItem item,
uint8_t  ,
RenderFnMode  mode,
char *  buffer,
int  bufferSize 
)

This is the render function that should be used with the LocalDialogButtonMenuItem

Parameters
item
mode
buffer
bufferSize
Returns

◆ withMenuDialogIfAvailable()

void withMenuDialogIfAvailable ( DialogInitialiser  dlgFn)

A small helper that checks if we can use the dialog, and then calls the provided function if we can. Note: only works with MenuBasedDialog

Parameters
dlgFnthe function to be called with the dialog object pointer, if getting the dialog was successful.