Added fgAddChangeListener convenience functions.
This commit is contained in:
parent
ee98995d30
commit
dc132d80b1
2 changed files with 37 additions and 0 deletions
|
@ -702,6 +702,19 @@ fgHasNode (const char * path)
|
||||||
return (fgGetNode(path, false) != 0);
|
return (fgGetNode(path, false) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fgAddChangeListener (SGPropertyChangeListener * listener, const char * path)
|
||||||
|
{
|
||||||
|
fgGetNode(path, true)->addChangeListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fgAddChangeListener (SGPropertyChangeListener * listener,
|
||||||
|
const char * path, int index)
|
||||||
|
{
|
||||||
|
fgGetNode(path, index, true)->addChangeListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
fgGetBool (const char * name, bool defaultValue)
|
fgGetBool (const char * name, bool defaultValue)
|
||||||
{
|
{
|
||||||
|
|
|
@ -106,6 +106,30 @@ extern SGPropertyNode * fgGetNode (const char * path,
|
||||||
extern bool fgHasNode (const char * path);
|
extern bool fgHasNode (const char * path);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a listener to a node.
|
||||||
|
*
|
||||||
|
* @param listener The listener to add to the node.
|
||||||
|
* @param path The path of the node, relative to root.
|
||||||
|
* @param index The index for the last member of the path (overrides
|
||||||
|
* any given in the string).
|
||||||
|
*/
|
||||||
|
extern void fgAddChangeListener (SGPropertyChangeListener * listener,
|
||||||
|
const char * path);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a listener to a node.
|
||||||
|
*
|
||||||
|
* @param listener The listener to add to the node.
|
||||||
|
* @param path The path of the node, relative to root.
|
||||||
|
* @param index The index for the last member of the path (overrides
|
||||||
|
* any given in the string).
|
||||||
|
*/
|
||||||
|
extern void fgAddChangeListener (SGPropertyChangeListener * listener,
|
||||||
|
const char * path, int index);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a bool value for a property.
|
* Get a bool value for a property.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue