|
| DynamicGUI (const std::string &cfgFileName="", QWidget *parent=0) |
| creates a new DynamicGUI instance from a given XML-description filename More...
|
|
| ~DynamicGUI () |
| Destructor. More...
|
|
void | initialize (const std::string &cfgXMLString) |
| intialize DynamicGUI instance from given XML-string More...
|
|
void | load (const std::string &cfgFileName) |
| intialize DynamicGUI instance from given XML-file More...
|
|
void | release () |
| internally releases everything More...
|
|
ParseTreePtr | getParseTree () |
| returns the internal parse-tree representation More...
|
|
| GUI (QWidget *parent=0) |
| Default constructor, creates a vbox GUI Component. More...
|
|
| GUI (const GUIComponent &component, QWidget *parent=0) |
| creates a GUI from a givne GUIComponent More...
|
|
| GUI (const GUI &gui, QWidget *parent=0) |
| copy constructor More...
|
|
GUI & | operator= (const GUI &other) |
| gui-copy operator More...
|
|
virtual | ~GUI () |
| Destructor. More...
|
|
virtual GUI & | operator<< (const GUIComponent &component) |
| adds a new GUI component More...
|
|
virtual GUI & | operator<< (const GUI &g) |
| stream operator to add new other GUIs More...
|
|
template<class T > |
T & | allocValue (const std::string &id, const T &val=T()) |
| wraps the data-stores allocValue function More...
|
|
template<class T > |
void | release (const std::string &id) |
| wraps the datastores release function More...
|
|
template<class T > |
T & | get (const std::string &id, bool typeCheck=true) |
|
DataStore::Data | operator[] (const std::string &key) |
| returns a Data instance from the datastore More...
|
|
template<class T > |
std::vector< T > | collect (const std::vector< std::string > &keys) |
| collects data from different components at once More...
|
|
virtual bool | isVisible () const |
| returns whether this gui is actually visible More...
|
|
virtual void | create () |
| internally creates everything More...
|
|
virtual void | show () |
| internally creates everything (and makes the gui visible) More...
|
|
virtual void | hide () |
| make this gui invisible (nothing more) More...
|
|
virtual void | switchVisibility () |
| if widget is visible, this hides the widget, otherwise the widget is shown More...
|
|
GUIWidget * | getRootWidget () |
| returns the root widget of the gui (only avialable after create() or show()) More...
|
|
void | lockData () |
| internally locks the datastore More...
|
|
void | unlockData () |
| internally unlocks the data store More...
|
|
void | waitForCreation () |
| waits for the gui to be created completely More...
|
|
const DataStore & | getDataStore () const |
| returns the GUI internal dataStore More...
|
|
void | registerCallback (const Callback &cb, const std::string &handleNamesList, char listDelim=',') |
| registers a callback function on each component More...
|
|
void | registerCallback (const ComplexCallback &cb, const std::string &handleNamesList, char listDelim=',') |
| registeres a complex callback at a given GUI component More...
|
|
void | removeCallbacks (const std::string &handleNamesList, char listDelim=',') |
| removes all callbacks from components More...
|
|
bool | isDummy () const |
| returns whether this GUI is a dummy GUI More...
|
|
bool | hasBeenCreated () const |
| returns whether this GUI has been created or not More...
|
|
std::string | createXMLDescription () const |
| creates a hierarchical xml-description of the GUI Layout More...
|
|
Special GUI implementation that allows for defining the GUI layout in an XML-file.
In some cases, it might be useful to not embed the design of the GUI layout into the c++-source code. To this end, ICL provides the DynamicGUI class, which is defined from XML that is dynamically loaded and parsed at runtime. By this, it is possible to add or re-arrange GUI components or to adapt features of these such as sizes or labels dynamically, i.e. without having to recompile the C++ application. The abstraction mechanism can also be used to implement different GUI layouts e.g. optimized for different screen resolutions.
Here is an examplary xml-definition file
<?xml version="1.0"?>
<hbox>
<vbox minsize="16x12" label="a box">
<button args="Push" minsize="10x2" handle="the button">
<togglebutton args="Toggle,Me" minsize="10x2" handle="the t-button">
<string args="test,20" handle="string">
<int args="0,1000,500" handle="int">
<checkbox args="my checkbox,toggled" handle="checkbox">
<float args="-0.2,0.8,0.6" handle="float" label="float">
</vbox>
<include href="other.xml"/>
<vsplit>
<image minsize="16x12" label="an image" handle="image">
<slider args="0,255,0" label="the slider" handle="s">
<hbox>
<image minsize="16x12" label="another image" handle="what">
<slider args="0,255,0" label="yet another slider">
</hbox>
</vsplit>
<hbox margin="20" label="box with margin">
<image minsize="16x12" label="last image then" handle="otherimage">
<slider args="0,255,0" label="slider slider slider">
</hbox>
</hbox>
As one can see, the hierarchical GUI definition syntax is generically translated to the XML-structure.
the include tag
With the include tag, (e.g. <include href="other.xml"/>) GUI files can even be included in a hierarchical fashion, but here, the user has to take care to not create infinite inclusion loops.