#include <stdlib.h> // atof()
#include <Input/input.hxx>
+#include <Scripting/NasalSys.hxx>
#include "dialog.hxx"
#include "new_gui.hxx"
_gui((NewGUI *)globals->get_subsystem("gui")),
_props(props)
{
+ _module = string("__dlg:") + props->getStringValue("name", "[unnamed]");
+ SGPropertyNode *nasal = props->getNode("nasal");
+ if (nasal) {
+ _nasal_close = nasal->getNode("close");
+ SGPropertyNode *open = nasal->getNode("open");
+ if (open) {
+ const char *s = open->getStringValue();
+ FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal");
+ nas->createModule(_module.c_str(), _module.c_str(), s, strlen(s));
+ }
+ }
display(props);
}
_object->getAbsolutePosition(&x, &y);
_props->setIntValue("lastx", x);
_props->setIntValue("lasty", y);
+
+ FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal");
+ if (_nasal_close) {
+ const char *s = _nasal_close->getStringValue();
+ nas->createModule(_module.c_str(), _module.c_str(), s, strlen(s));
+ }
+ nas->deleteModule(_module.c_str());
+
puDeleteObject(_object);
unsigned int i;
while (dest->getChild("binding", j))
j++;
+ const char *cmd = bindings[i]->getStringValue("command");
+ if (!strcmp(cmd, "nasal") && _module[0])
+ bindings[i]->setStringValue("module", _module.c_str());
+
binding = dest->getChild("binding", j, true);
copyProperties(bindings[i], binding);
info->bindings.push_back(new FGBinding(binding));
// last position.
SGPropertyNode_ptr _props;
+ // Nasal module.
+ string _module;
+ SGPropertyNode_ptr _nasal_close;
+
// PUI provides no way for userdata to be deleted automatically
// with a GUI object, so we have to keep track of all the special
// data we allocated and then free it manually when the dialog