Flair
Framework Libre Air
|
Abstract class for all Framework's widget classes. More...
#include <Widget.h>
Public Member Functions | |
Widget (const Widget *parent, std::string name, std::string type) | |
Constructor. More... | |
virtual | ~Widget () |
Destructor. More... | |
void | setEnabled (bool status) |
Set enabled. More... | |
bool | isEnabled (void) const |
Is enabled? More... | |
Public Member Functions inherited from flair::core::Object | |
Object (const Object *parent=NULL, std::string name="", std::string type="") | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
std::string | ObjectName (void) const |
Name. More... | |
std::string | ObjectType (void) const |
Type. More... | |
const Object * | Parent (void) const |
Parent. More... | |
std::vector< const Object * > * | TypeChilds (void) const |
Childs of the same type. More... | |
std::vector< const Object * > * | Childs (void) const |
Childs. More... | |
void | Information (const char *function, int line, const char *format,...) const |
Formatted information. More... | |
void | Warning (const char *function, const char *format,...) const |
Formatted warning. More... | |
void | Error (const char *function, const char *format,...) const |
Formatted error. More... | |
bool | ErrorOccured (bool recursive=true) const |
Has an errror occured? More... | |
Protected Member Functions | |
template<typename T > | |
void | SetPersistentXmlProp (std::string prop, T value) |
Set a persistent xml property. More... | |
template<typename T > | |
bool | GetPersistentXmlProp (std::string prop, T &value) |
Get a persistent xml property. More... | |
template<typename T > | |
void | SetVolatileXmlProp (std::string prop, T value, xmlNodePtr node=NULL) |
Set a volatile xml property. More... | |
void | SendXml (void) |
Send xml. More... | |
virtual void | XmlEvent (void) |
Xml event. More... | |
void | UnsetPersistentXmlProp (std::string prop) |
Unset a persistent xml property. More... | |
Additional Inherited Members | |
Public Types inherited from flair::core::Object | |
enum | color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 } |
Abstract class for all Framework's widget classes.
A widget is an object to display on the ground station.
Communication with ground station is done through xml files; properties of theses files are modified through appropriate method.
A xml file is used for default values of the Widget, if it has been specified in the constructor of the FrameworkManager.
flair::gui::Widget::Widget | ( | const Widget * | parent, |
std::string | name, | ||
std::string | type | ||
) |
Constructor.
Construct a Widget, the xml file specified to the FrameworkManager's constructor is sued for default values.
Two Widget with same parent must have different names. If a brother Widget already has the same name, the name of the new one will be automatically changed.
Type must agree with predifined (hard coded) types in ground station code.
parent | parent |
name | name |
type | type |
|
virtual |
Destructor.
void flair::gui::Widget::setEnabled | ( | bool | status | ) |
Set enabled.
Enable or disable the Widget on the ground station.
A disabled widget is greyed out on the ground station and in unmodifiable.
status |
bool flair::gui::Widget::isEnabled | ( | void | ) | const |
Is enabled?
|
protected |
Set a persistent xml property.
The property will be saved in the configuration xml and also used to configure the ground station.
prop | property to set and save |
value | value to set and save |
|
protected |
Get a persistent xml property.
Get the property from the xml file. If no corresponding property is found in the xml, value remains unchanged.
Thus value can be initialized with a default value before calling this method.
prop | property to get |
value | value to store the result |
|
protected |
Set a volatile xml property.
This property should be used to configure the ground station (one time init).
The property will be destroyed after calling SendXml() as it should no be used anymore.
prop | property to set |
value | value to set |
node | if sepcified, node to set; otherwise use the node of the Widget |
|
protected |
Send xml.
Send Widget's xml to ground station.
New changes will be taken into account by ground station.
All volatile properties will be erased after calling ths method, as they should not be used anymore.
|
inlineprotectedvirtual |
Xml event.
This method must be reimplemented to handle a xml event.
It is automatically called when something changed from ground station.
|
protected |
Unset a persistent xml property.
Unset an existent property, so it won't be saved.
prop | property to set |