Hi,
attached the patch to apply only the changed values in a dialog box
using dialog-apply fgcommand. Now only the listener(s) associated with
the changed value are fired. It works fine here, and I think it could be
useful to apply it.
Thanks a lot
regards
seb
Sébastien MARQUE a écrit :
Hi Csaba,
actually I already use a listener that only fires then the value really
change. I've looked in Nasal scripting wiki page and globals.nas to be
sure, and tried the other possible values for the fourth argument of
setlistener, with no more succes, that's why I looked in FG sources. If
changes in sources can't be applied or don't have the expected effects
I've got an other workaround, but it is quite an ugly one.
regards
seb
Csaba Halász wrote :
On Fri, Feb 20, 2009 at 1:23 AM, Sébastien MARQUE <seb.mar...@free.fr> wrote:
Indeed, it seems like the dialog-apply command changes every single
property linked to a checkbox causing the listeners set on these
properties to be triggered even if the property hadn't be changed by the
user. The result is that all instruments or systems which have a
listener are triggered, and obviously fail all instruments and systems
in my case.
You can use a listener that only fires when the value really changes.
See the docs for the setlistener function.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Index: src/GUI/dialog.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/GUI/dialog.cxx,v
retrieving revision 1.115
diff -u -r1.115 dialog.cxx
--- src/GUI/dialog.cxx 10 Feb 2009 22:14:13 -0000 1.115
+++ src/GUI/dialog.cxx 20 Feb 2009 21:14:16 -0000
@@ -437,11 +437,13 @@
case SGPropertyNode::BOOL:
case SGPropertyNode::INT:
case SGPropertyNode::LONG:
- node->setIntValue(object->getIntegerValue());
+ if (object->getIntegerValue() != node->getIntValue())
+ node->setIntValue(object->getIntegerValue());
break;
case SGPropertyNode::FLOAT:
case SGPropertyNode::DOUBLE:
- node->setFloatValue(object->getFloatValue());
+ if (object->getFloatValue() != node->getFloatValue())
+ node->setFloatValue(object->getFloatValue());
break;
default:
const char *s = object->getStringValue();
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel