From: Melchior F. <mf...@fl...> - 2006-04-28 15:55:56
|
Update of /var/cvs/FlightGear-0.9/FlightGear/src/GUI In directory baron:/tmp/cvs-serv10585 Modified Files: dialog.cxx dialog.hxx Log Message: add an optional property node pointer to ObjectProperty. This is currently only used by the <list> widget. It allows to "dialog-update" the list, which rescans the <value> children and redraws the list widget with new contents. The old contents are only freed at dialog close, which should eventually get changed. Index: dialog.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/GUI/dialog.cxx,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -r1.78 -r1.79 *** dialog.cxx 28 Apr 2006 12:56:11 -0000 1.78 --- dialog.cxx 28 Apr 2006 15:55:41 -0000 1.79 *************** *** 392,396 **** puObject *obj = _propertyObjects[i]->object; ! copy_to_pui(_propertyObjects[i]->node, obj); } } --- 392,400 ---- puObject *obj = _propertyObjects[i]->object; ! SGPropertyNode *values = _propertyObjects[i]->values; ! if (obj->getType() & PUCLASS_LIST && values) ! ((puList *)obj)->newList(value_list(values)); ! else ! copy_to_pui(_propertyObjects[i]->node, obj); } } *************** *** 722,726 **** SGPropertyNode_ptr node = fgGetNode(propname, true); copy_to_pui(node, object); ! PropertyObject* po = new PropertyObject(name, object, node); _propertyObjects.push_back(po); if(props->getBoolValue("live")) --- 726,732 ---- SGPropertyNode_ptr node = fgGetNode(propname, true); copy_to_pui(node, object); ! ! SGPropertyNode * values = type == "list" ? props : 0; ! PropertyObject* po = new PropertyObject(name, object, node, values); _propertyObjects.push_back(po); if(props->getBoolValue("live")) *************** *** 963,970 **** FGDialog::PropertyObject::PropertyObject (const char * n, puObject * o, ! SGPropertyNode_ptr p) : name(n), object(o), ! node(p) { } --- 969,978 ---- FGDialog::PropertyObject::PropertyObject (const char * n, puObject * o, ! SGPropertyNode_ptr p, ! SGPropertyNode_ptr v) : name(n), object(o), ! node(p), ! values(v) { } Index: dialog.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/GUI/dialog.hxx,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** dialog.hxx 28 Apr 2006 11:49:11 -0000 1.24 --- dialog.hxx 28 Apr 2006 15:55:41 -0000 1.25 *************** *** 142,154 **** // 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 ! // closes. vector<void *> _info; struct PropertyObject { PropertyObject (const char * name, puObject * object, ! SGPropertyNode_ptr node); string name; puObject * object; SGPropertyNode_ptr node; }; vector<PropertyObject *> _propertyObjects; --- 142,157 ---- // 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 ! // closes. "values" is a node with "value" children and only used ! // by the <list> widget. vector<void *> _info; struct PropertyObject { PropertyObject (const char * name, puObject * object, ! SGPropertyNode_ptr node, ! SGPropertyNode_ptr values = 0); string name; puObject * object; SGPropertyNode_ptr node; + SGPropertyNode_ptr values; }; vector<PropertyObject *> _propertyObjects; |