24#ifndef HTML_SIZE_UNIT_HPP
25#define HTML_SIZE_UNIT_HPP
35#include <dar/libdar.hpp>
38#include "html_form_select.hpp"
39#include "html_div.hpp"
46 static const std::string changed;
89 virtual void on_event(
const std::string & event_name)
override;
93 static constexpr const char* mode_changed =
"SI_mode changed";
class of object that are pointed/triggered to by others
Definition: actor.hpp:55
class events
Definition: events.hpp:52
class html_div is the implementation of
Definition: html_div.hpp:46
html component in a form a couple of dropdown list for user to define a size in byte or larger units
Definition: html_size_unit.hpp:44
libdar::infinint get_value() const
return the unit factor as integer
Definition: html_size_unit.cpp:67
unsigned int get_max_base_unit_index() const
get the max base unit index (index starts at zero)
Definition: html_size_unit.hpp:62
unsigned int get_current_base_index() const
get current base index
Definition: html_size_unit.hpp:65
void set_unit_and_ratio_indexes(unsigned int base_index, unsigned int power_index)
change the selected base unit and factor programmatically
Definition: html_size_unit.cpp:117
std::string get_string() const
return the unit label
Definition: html_size_unit.hpp:59
virtual void on_event(const std::string &event_name) override
actor inheritance
Definition: html_size_unit.cpp:162
libdar::infinint get_base_unit_value(unsigned int index) const
get value of the base unit of given index
Definition: html_size_unit.cpp:84
unsigned int get_max_power_for_base_unit(unsigned int index) const
get the max power available for the base unit of given index
Definition: html_size_unit.cpp:103
void set_enabled(bool val)
whether the HTML control is enable or disabled
Definition: html_size_unit.hpp:85
unsigned int get_current_power_for_base_unit() const
get the current power selected
Definition: html_size_unit.hpp:78