本文整理汇总了C++中GuiControl::loadBaseInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ GuiControl::loadBaseInfo方法的具体用法?C++ GuiControl::loadBaseInfo怎么用?C++ GuiControl::loadBaseInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuiControl
的用法示例。
在下文中一共展示了GuiControl::loadBaseInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadFromXml
void GuiContainer::loadFromXml(string file) {
controls.clear();
ofxXmlSettings xml;
res.init(file);
xml.loadFile(file);
loadBaseInfo("view", xml, 0);
x = 0;
y = 0;
load();
//movable = xml.getAttribute("view", "movable", 0, 0);
xml.pushTag("view");
int numControls = xml.getNumTags("control");
for(int i = 0; i < numControls; i++) {
GuiControl *c = instantiator(
xml.getAttribute("control", "type", "", i),
xml.getAttribute("control", "name", "", i),
xml.getAttribute("control", "id", "", i), &res, this);
string valueStr = xml.getAttribute("control", "value", "", i);
if(valueStr!="") {
c->valueFromString(valueStr);
}
c->loadBaseInfo("control", xml, i);
c->load();
c->listeners = listeners;
c->numListeners = numListeners;
c->load(xml, i);
add(c);
}
}
示例2: duplicateFocusedControl
void GuiContainer::duplicateFocusedControl() {
if(focusedControl!=NULL) {
ofxXmlSettings xml;
xml.addTag("control");
focusedControl->saveBaseInfo("control", xml, 0);
focusedControl->save(xml, 0);
GuiControl *ctrl = instantiator(focusedControl->type, focusedControl->name, focusedControl->controlId+"1", &res, this);
ctrl->loadBaseInfo("control", xml, 0);
ctrl->load();
ctrl->load(xml, 0);
ctrl->x += 20;
ctrl->y += 20;
ctrl->setEditing(editing);
focusedControl->focus = false;
focusedControl = ctrl;
focusedControl->focus = true;
add(focusedControl);
}
}