I'm confused on loading from file. I know the form builder is/was under major overhaul, but I'm not sure of the current status of what is and is not working.
If I have a text form that looks like:
Window: "Form Window"
{
Button: "Button1"
{
ConfigFile = "widgets/White.conf"
Left = 180
Top = 100
Width = 121
Height = 30
Visible = true
Enabled = true
Transparency = 255
CallbackId = 0
Text = "MegaButton"
TextColor = (0,0,0,255)
TextSize = 17
}
}
If I load into the "main gui container"
tgui::Gui gui;
gui.loadWidgetsFromFile("form.txt");
I get a button in the middle of my main program window. What does "Window: Form Window" refer to in the form? Isnt the gui object already the "window" in this case, with the button being a child in it? The "form.txt" implies the button lives inside a container called "Form Window". The C program implies that the button lives inside the container "gui".
If I do...
tgui::ChildWindow::Ptr aChildWindow(gui);
aChildWindow->setTitle("Hard Coded Child Window");
aChildWindow->loadWidgetsFromFile("form.txt");
Now the button rides along inside the child window, which lives inside the "gui" container. What does the "Window: Form Window" refer to? It seems like a wasted identifier, since the button is living inside "Hard Coded Child Window", but the button doesn't work at all if I strip out the "Window { }" from the text file.
My first try was to hard code containers, and have each one load his widgets from a form file. This *kind of* works, but I am confused over the nested syntax of the form text files. (The Window {} part seems redundant and contradictory).
It appears forms do not yet support containers directly. IE:
ChildWindow:
{
Button: "Yay Im a Button"
{
// button stuff
}
}
If/when they do, I suspect it will help because larger chunks of GUI could be "soft coded" in text files.