}
void
-FGPUIDialog::updateValues (const char *objectName)
+FGPUIDialog::updateValues(const std::string& objectName)
{
- if (objectName && !objectName[0])
- objectName = 0;
-
for (unsigned int i = 0; i < _propertyObjects.size(); i++) {
const string &name = _propertyObjects[i]->name;
- if (objectName && name != objectName) {
+
+ if( !objectName.empty() && name != objectName )
continue;
- }
-
+
puObject *widget = _propertyObjects[i]->object;
int widgetType = widget->getType();
if (widgetType & PUCLASS_LIST) {
}
void
-FGPUIDialog::applyValues (const char *objectName)
+FGPUIDialog::applyValues(const std::string& objectName)
{
- if (objectName && !objectName[0])
- objectName = 0;
-
for (unsigned int i = 0; i < _propertyObjects.size(); i++) {
const string &name = _propertyObjects[i]->name;
- if (objectName && name != objectName)
- continue;
+ if( !objectName.empty() && name != objectName )
+ continue;
copy_from_pui(_propertyObjects[i]->object,
_propertyObjects[i]->node);
/**
* Update the values of all GUI objects with a specific name,
- * or all if name is 0 (default).
+ * or all if an empty name is given (default).
*
* This method copies values from the FlightGear property tree to
* the GUI object(s).
*
* @param objectName The name of the GUI object(s) to update.
- * Use the empty name for all unnamed objects.
+ * Use the empty name for all objects.
*/
- virtual void updateValues (const char * objectName = 0);
+ virtual void updateValues(const std::string& objectName = "");
/**
* Apply the values of all GUI objects with a specific name,
- * or all if name is 0 (default)
+ * or all if an empty name is given (default).
*
* This method copies values from the GUI object(s) to the
* FlightGear property tree.
*
* @param objectName The name of the GUI object(s) to update.
- * Use the empty name for all unnamed objects.
+ * Use the empty name for all objects.
*/
- virtual void applyValues (const char * objectName = 0);
+ virtual void applyValues(const std::string& objectName = "");
/**
#ifndef __DIALOG_HXX
#define __DIALOG_HXX 1
-#ifndef __cplusplus
-# error This library requires C++
-#endif
+#include <string>
// forward decls
class SGPropertyNode;
/**
* Update the values of all GUI objects with a specific name,
- * or all if name is 0 (default).
+ * or all if an empty name is given (default).
*
* This method copies values from the FlightGear property tree to
* the GUI object(s).
*
* @param objectName The name of the GUI object(s) to update.
- * Use the empty name for all unnamed objects.
+ * Use the empty name for all objects.
*/
- virtual void updateValues (const char * objectName = 0) = 0;
+ virtual void updateValues(const std::string& objectName = "") = 0;
/**
* Apply the values of all GUI objects with a specific name,
- * or all if name is 0 (default)
+ * or all if an empty name is given (default)
*
* This method copies values from the GUI object(s) to the
* FlightGear property tree.
*
* @param objectName The name of the GUI object(s) to update.
- * Use the empty name for all unnamed objects.
+ * Use the empty name for all objects.
*/
- virtual void applyValues (const char * objectName = 0) = 0;
+ virtual void applyValues(const std::string& objectName = "") = 0;
/**