コード例 #1
0
/**
 * 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));
			}
		}
	}
}
コード例 #2
0
ファイル: Container.cpp プロジェクト: danielmorena/ofxmarek
string xmlgui::Container::getString(string controlId) {
	getControlById(controlId);
	return "";
}
コード例 #3
0
/**
 * This points a control's value to the parameter
 */
void GuiContainer::pointToValue(string _controlId, void *ptr) {
	getControlById(_controlId)->value = ptr;
}
コード例 #4
0
void xmlgui::Container::pointToValue(string controlName, void *pointer) {
	xmlgui::Control *c = getControlById(controlName);
	if(c!=NULL) {
		c->pointToValue(pointer);
	}
}