if(_dialog_props.find(name) != _dialog_props.end())
return _dialog_props[name];
- SG_LOG(SG_GENERAL, SG_ALERT, "dialog '" << name << "' missing");
+ SG_LOG(SG_GENERAL, SG_DEBUG, "dialog '" << name << "' missing");
+ return 0;
+}
+
+FGDialog *
+NewGUI::getDialog (const string &name)
+{
+ if(_active_dialogs.find(name) != _active_dialogs.end())
+ return _active_dialogs[name];
+
+ SG_LOG(SG_GENERAL, SG_DEBUG, "dialog '" << name << "' missing");
return 0;
}
*/
virtual FGDialog * getActiveDialog ();
+
+ /**
+ * Get the named dialog if active.
+ *
+ * @return The named dialog, or 0 if it isn't active.
+ */
+ virtual FGDialog * getDialog (const string &name);
+
+
virtual FGColor *getColor (const char * name) const {
_citt_t it = _colors.find(name);
return (it != _colors.end()) ? it->second : NULL;
do_dialog_update (const SGPropertyNode * arg)
{
NewGUI * gui = (NewGUI *)globals->get_subsystem("gui");
- FGDialog * dialog = gui->getActiveDialog();
+ FGDialog * dialog;
+ if (arg->hasValue("dialog-name"))
+ dialog = gui->getDialog(arg->getStringValue("dialog-name"));
+ else
+ dialog = gui->getActiveDialog();
+
if (dialog != 0) {
if (arg->hasValue("object-name")) {
dialog->updateValue(arg->getStringValue("object-name"));
do_dialog_apply (const SGPropertyNode * arg)
{
NewGUI * gui = (NewGUI *)globals->get_subsystem("gui");
- FGDialog * dialog = gui->getActiveDialog();
+ FGDialog * dialog;
+ if (arg->hasValue("dialog-name"))
+ dialog = gui->getDialog(arg->getStringValue("dialog-name"));
+ else
+ dialog = gui->getActiveDialog();
+
if (dialog != 0) {
if (arg->hasValue("object-name")) {
const char * name = arg->getStringValue("object-name");