#include <fgx.h>
The file: 'some_widgets.xui'
<?xml version="1.0" standalone="yes" ?>
<xui>
<widget id="id1" label="Yet another window" x="400" w="400" h="600" persistent="1" resize="1">
<text label="A text label" x="32" y="32" foreground="000000" background="FFFFFF" />
</widget>
</xui>
int main(int argc, char** argv)
{
FGApp app(2, argc, argv, APP_ALL);
XUIBuilder ui;
if (ui.LoadGUI("some_widgets.xui"))
{
ui.ConnectSignal("CloseApp", __CloseApplication);
ui.Show("MyWindow");
app.Run();
}
return 0;
}
Public Member Functions | |
| XUIBuilder () | |
| bool | LoadGUI (const char *fname, const char *widget=0) |
| bool | SaveGUI (const char *fname) |
| void | Show (const char *widget=0) |
| FGWindow * | GetWidget (const char *id) |
| XUIComponent * | FindObject (const char *widget_id, const char *component_id) |
| void | AddWidget (const XUIWindow &widget) |
| bool | DeleteWidget (const char *id) |
| bool | SetData (const char *widget_id, const char *component_id, const char data[], int size) |
| bool | SetData (const char *widget_id, const char *component_id, const int) |
| bool | SetData (const char *widget_id, const char *component_id, const double) |
Static Protected Member Functions | |
| static void | CloseApplication (CallBack cb, void *) |
| static void | CloseWindow (CallBack cb, void *) |
Protected Attributes | |
| WidgetList | widgets |
|
|
Creates an object with empty list of widgets. You must create this one prior to work with XUI files. There is no reason to build more than one object of this type at the time. This object registers some built-in signal handlers when invoked first time.
|
|
|
Insert a copy of Widget at the end of list of objects.
|
|
|
Removes copy of Widget with this ID from the list of object.
|
|
||||||||||||
|
Find concrete Component (e.g. button) in concrete Widget.
|
|
|
Find Widget with this ID.
|
|
||||||||||||
|
Loads the widget from XUI document (or its part only) into XUIBuilder object. If object already contains some data, the new one are merged at the end. Load & Save XUI document are fully reversible.
|
|
|
Saves the whole object as XUI document. Load & Save XUI document are fully reversible.
|
|
||||||||||||||||
|
Set some data to the concrete Component.
|
|
||||||||||||||||
|
Set some data to the concrete Component (e.g. integer to Slider).
|
|
||||||||||||||||||||
|
Set some data to the concrete Component (e.g. string to EditBox).
|
|
|
Shows one or all widgets.
|
1.4.0