Boris Koenig:
I'm attaching a small change to Andy's dialog.cxx that I needed to make so that it enables XML/Nasal-dialogs to also contain puLargeInput boxes. The text will be retrieved/buffered from/within a specified property tree, like: <textbox> <x>100</x> <y>100</y> <width>200</width> <height>100</height> <property>/gui/path-to-text-node/contents</property> <slider>15</slider> <editable>true</editable> </textbox>
This commit is contained in:
parent
9f8fc0f1cc
commit
6f8cae6b87
1 changed files with 14 additions and 0 deletions
|
@ -385,6 +385,20 @@ FGDialog::makeObject (SGPropertyNode * props, int parentWidth, int parentHeight)
|
||||||
dial->setWrap(props->getBoolValue("wrap", true));
|
dial->setWrap(props->getBoolValue("wrap", true));
|
||||||
setupObject(dial, props);
|
setupObject(dial, props);
|
||||||
return dial;
|
return dial;
|
||||||
|
} else if (type == "textbox") {
|
||||||
|
int slider_width = props->getIntValue("slider", parentHeight);
|
||||||
|
if (slider_width==0) slider_width=20;
|
||||||
|
puLargeInput * puTextBox =
|
||||||
|
new puLargeInput(x, y, x+width, x+height, 2, slider_width);
|
||||||
|
if (props->hasValue("editable"))
|
||||||
|
{
|
||||||
|
if (props->getBoolValue("editable")==false)
|
||||||
|
puTextBox->disableInput();
|
||||||
|
else
|
||||||
|
puTextBox->enableInput();
|
||||||
|
}
|
||||||
|
setupObject(puTextBox,props);
|
||||||
|
return puTextBox;
|
||||||
} else if (type == "select") {
|
} else if (type == "select") {
|
||||||
vector<SGPropertyNode_ptr> value_nodes;
|
vector<SGPropertyNode_ptr> value_nodes;
|
||||||
SGPropertyNode * selection_node =
|
SGPropertyNode * selection_node =
|
||||||
|
|
Loading…
Reference in a new issue