EmbAJAX
Simplistic framework for creating and handling displays and controls on a web page served by an embeddable device (Arduino or other microcontroller with Arduino support).
Public Member Functions | List of all members
EmbAJAXRadioGroup< NUM > Class Template Reference

A set of radio buttons (mutally exclusive buttons), e.g. for on/off, or low/mid/high, etc. More...

#include <EmbAJAX.h>

Inheritance diagram for EmbAJAXRadioGroup< NUM >:
Inheritance graph
[legend]
Collaboration diagram for EmbAJAXRadioGroup< NUM >:
Collaboration graph
[legend]

Public Member Functions

 EmbAJAXRadioGroup (const char *id_base, const char *options[NUM], uint8_t selected_option=0)
 
void selectOption (uint8_t num)
 
uint8_t selectedOption () const
 
EmbAJAXBasebutton (uint8_t num)
 
- Public Member Functions inherited from EmbAJAXContainer< NUM >
 EmbAJAXContainer (EmbAJAXBase *children[NUM])
 
void print () const override
 
bool sendUpdates (uint16_t since, bool first) override
 
EmbAJAXElementfindChild (const char *id) const override final
 
- Public Member Functions inherited from EmbAJAXBase
virtual EmbAJAXElementtoElement ()
 
void setVisible (bool visible)
 
void setEnabled (bool enabled)
 

Additional Inherited Members

- Public Types inherited from EmbAJAXBase
enum  Property {
  Visibility , Enabledness , Value , FirstElementSpecificProperty ,
  HTMLAllowed
}
 
- Static Public Member Functions inherited from EmbAJAXBase
static void setDriver (EmbAJAXOutputDriverBase *driver)
 
- Protected Member Functions inherited from EmbAJAXContainer< NUM >
void setBasicProperty (uint8_t num, bool status) override
 
- Protected Member Functions inherited from EmbAJAXBase
void printChildren (EmbAJAXBase **children, size_t num) const
 
bool sendUpdates (EmbAJAXBase **children, size_t num, uint16_t since, bool first)
 
EmbAJAXElementfindChild (EmbAJAXBase **children, size_t num, const char *id) const
 
void printPage (EmbAJAXBase **children, size_t num, const char *_title, const char *_header, uint16_t _min_interval) const
 
void handleRequest (EmbAJAXBase **children, size_t num, void(*change_callback)())
 
- Protected Attributes inherited from EmbAJAXContainer< NUM >
EmbAJAXBase ** _children
 
- Protected Attributes inherited from EmbAJAXRadioGroupBase
const char * _name
 
- Static Protected Attributes inherited from EmbAJAXBase
static EmbAJAXOutputDriverBase_driver
 
static char itoa_buf [8]
 
constexpr static const char null_string [1]
 

Detailed Description

template<size_t NUM>
class EmbAJAXRadioGroup< NUM >

A set of radio buttons (mutally exclusive buttons), e.g. for on/off, or low/mid/high, etc.

You can insert either the whole group into an EmbAJAXPage at once, or - for more flexbile layouting - retrieve the individual buttons using() button, and insert them into the page as independent elements.

Constructor & Destructor Documentation

◆ EmbAJAXRadioGroup()

template<size_t NUM>
EmbAJAXRadioGroup< NUM >::EmbAJAXRadioGroup ( const char *  id_base,
const char *  options[NUM],
uint8_t  selected_option = 0 
)
inline

ctor.

Parameters
id_basethe "base" id. Internally, radio buttons with id_s id_base0, id_base1, etc. will be created.
optionslabels for the options. Note: The array of options may be a temporary, but the option-strings themselves will have to be persistent!
selected_optionindex of the default option. 0 by default, for the first option, may be > NUM, for no option selected by default.

Member Function Documentation

◆ button()

template<size_t NUM>
EmbAJAXBase* EmbAJAXRadioGroup< NUM >::button ( uint8_t  num)
inline
Returns
a representation of an individual option element. You can use this to insert the individual buttons at arbitrary positions in the page layout.

◆ selectedOption()

template<size_t NUM>
uint8_t EmbAJAXRadioGroup< NUM >::selectedOption ( ) const
inline
Returns
the index of the currently selected option. May be > NUM, if no option is selected.

◆ selectOption()

template<size_t NUM>
void EmbAJAXRadioGroup< NUM >::selectOption ( uint8_t  num)
inline

Select / check the option at the given index. All other options in this radio group will become deselected.


The documentation for this class was generated from the following file: