/** * loads an xml file with the values specified * in the file. If the file doesn't exist, it just * returns. */ void GuiContainer::loadValues(string file) { if(!guiFileExists(ofToDataPath(file))) return; ofxXmlSettings xml; xml.loadFile(file); xml.pushTag("values"); int numVals = xml.getNumTags("value"); for(int i = 0; i < numVals; i++) { string controlId = xml.getAttribute("value", "controlId", "", i); if(controlId!="") { GuiControl *ctrl = getControlById(controlId); if(ctrl!=NULL) { ctrl->valueFromString(xml.getAttribute("value", "value", "", i)); } } } }
string xmlgui::Container::getString(string controlId) { getControlById(controlId); return ""; }
/** * This points a control's value to the parameter */ void GuiContainer::pointToValue(string _controlId, void *ptr) { getControlById(_controlId)->value = ptr; }
void xmlgui::Container::pointToValue(string controlName, void *pointer) { xmlgui::Control *c = getControlById(controlName); if(c!=NULL) { c->pointToValue(pointer); } }