WOGButton* OGSceneConfig::CreateButton(const QDomElement &element) { WOGButton* obj = new WOGButton; obj->id = element.attribute("id"); obj->depth = element.attribute("depth").toDouble(); obj->position = StringToPoint(element.attribute("x") , element.attribute("y")); obj->scale = StringToPoint(element.attribute("scalex") , element.attribute("scaley")); obj->rotation = element.attribute("rotation").toDouble(); obj->alpha = element.attribute("alpha", "1").toDouble(); obj->colorize = StringToColor(element.attribute("colorize" , "255,255,255")); obj->up = element.attribute("up"); obj->over = element.attribute("over"); obj->disabled = element.attribute("disabled"); obj->onclick = element.attribute("onclick"); obj->onmouseenter = element.attribute("onmouseenter"); obj->onmouseexit = element.attribute("onmouseexit"); obj->text = element.attribute("text"); obj->font = element.attribute("font"); return obj; }
WOGLine* OGSceneConfig::CreateLine(const QDomElement &element) { WOGLine* obj = new WOGLine; obj->anchor = StringToPoint(element.attribute("anchor")); obj->normal = StringToPoint(element.attribute("normal")); CreatePObject(obj, element); return obj; }
WOGParticle* OGSceneConfig::CreateParticle(const QDomElement &element) { WOGParticle* obj = new WOGParticle; obj->effect = element.attribute("effect"); obj->depth = element.attribute("depth").toDouble(); obj->position = StringToPoint(element.attribute("pos")); obj->pretick = element.attribute("pretick").toDouble(); return obj; }
WOGPoi* OGLevelConfig::CreatePoi(const QDomElement &element) { WOGPoi* obj = new WOGPoi; obj->position = StringToPoint(element.attribute("pos")); obj->traveltime = element.attribute("traveltime").toDouble(); obj->pause = element.attribute("pause").toDouble(); obj->zoom = element.attribute("zoom").toDouble(); return obj; }
WOGLevelExit* OGLevelConfig::CreateLevelExit(const QDomElement &element) { WOGLevelExit* obj = new WOGLevelExit; obj->id = element.attribute("id"); obj->pos = StringToPoint(element.attribute("pos")); obj->radius = element.attribute("radius").toFloat(); obj->filter = element.attribute("filter"); return obj; }
WOGLinearForceField* OGSceneConfig::CreateLinearForceField(const QDomElement &element) { WOGLinearForceField* obj = new WOGLinearForceField; obj->type = element.attribute("type"); obj->force = StringToPoint(element.attribute("force")); obj->dampeningfactor = element.attribute("dampeningfactor").toDouble(); obj->antigrav = StringToBool(element.attribute("antigrav")); obj->geomonly = StringToBool(element.attribute("geomonly")); return obj; }
WOGCircle* OGSceneConfig::CreateCircle(const QDomElement &element) { WOGCircle* obj = new WOGCircle; obj->position = StringToPoint(element.attribute("x") , element.attribute("y")); obj->radius = element.attribute("radius").toDouble(); CreatePObject(obj, element); return obj; }
WOGButtonGroup* OGSceneConfig::CreateButtonGroup(const QDomElement &element) { WOGButtonGroup* obj = new WOGButtonGroup; obj->id = element.attribute("id"); obj->osx = StringToPoint(element.attribute("osx")); for (QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling()) { obj->button << CreateButton(n.toElement()); } return obj; }
WOGSceneLayer* OGSceneConfig::CreateSceneLayer(const QDomElement &element) { WOGSceneLayer* obj = new WOGSceneLayer; obj->id = element.attribute("id"); obj->name = element.attribute("name"); obj->depth = element.attribute("depth").toDouble(); obj->position = StringToPoint(element.attribute("x") , element.attribute("y")); obj->scale = StringToPoint(element.attribute("scalex") , element.attribute("scaley")); obj->rotation = element.attribute("rotation").toDouble(); obj->alpha = element.attribute("alpha", "1").toDouble(); obj->colorize = StringToColor(element.attribute("colorize" , "255,255,255")); obj->image = element.attribute("image"); obj->anim = element.attribute("anim"); obj->animspeed = element.attribute("animspeed").toDouble(); return obj; }
WOGRectangle* OGSceneConfig::CreateRectanle(const QDomElement &element) { WOGRectangle* obj = new WOGRectangle; obj->position = StringToPoint(element.attribute("x") , element.attribute("y")); obj->size = StringToSize(element.attribute("width") , element.attribute("height")); obj->rotation = element.attribute("rotation").toDouble(); CreatePObject(obj, element); return obj; }
WOGRadialForceField* OGSceneConfig::CreateRadialForceField(const QDomElement &element) { WOGRadialForceField* obj = new WOGRadialForceField; obj->id = element.attribute("id"); obj->type = element.attribute("type"); obj->center = StringToPoint(element.attribute("center")); obj->radius = element.attribute("radius").toDouble(); obj->forceatcenter = element.attribute("forceatcenter").toDouble(); obj->forceatedge = element.attribute("forceatedge").toDouble(); obj->dampeningfactor = element.attribute("dampeningfactor").toDouble(); obj->antigrav = StringToBool(element.attribute("antigrav")); obj->geomonly = StringToBool(element.attribute("geomonly")); obj->enabled = StringToBool(element.attribute("enabled")); return obj; }
WOGLabel* OGSceneConfig::CreateLabel(const QDomElement &element) { WOGLabel* obj = new WOGLabel; obj->id = element.attribute("id"); obj->depth = element.attribute("depth").toDouble(); obj->position = StringToPoint(element.attribute("x") , element.attribute("y")); obj->align = element.attribute("align"); obj->rotation = element.attribute("rotation").toDouble(); obj->scale = element.attribute("scale").toDouble(); obj->overlay = StringToBool(element.attribute("overlay")); obj->screenspace = StringToBool(element.attribute("screenspace")); obj->font = element.attribute("font"); obj->text = element.attribute("text"); return obj; }
WOGCamera* OGLevelConfig::CreateCamera(const QDomElement &element) { WOGCamera* obj = new WOGCamera; obj->aspect = element.attribute("aspect"); obj->endpos = StringToPoint(element.attribute("endpos")); obj->endzoom = element.attribute("endzoom").toDouble(); QDomNode node = element.firstChild(); while (!node.isNull()) { obj->poi << CreatePoi(node.toElement()); node = node.nextSibling(); } return obj; }
void Label::init(xml::node& node) { base_window::init(node); xml::node setting = node("Font"); if(!setting.empty()) { m_font = m_system.getWindowManager().loadFont(setting.first_child().value()); m_shadow_enabled = setting["shadow"].as_bool(); m_shadow_scale = StringToSize(setting["shadow_scale"].value()); m_shadow_offset = StringToPoint(setting["shadow_offset"].value()); } setting = node("Formatting"); if(!setting.empty()) { m_format = StringToFormatType(setting.first_child().value()); } setting = node("Spacing"); if(!setting.empty()) { m_spacing = (float)atof(setting.first_child().value()); if(m_font) m_font->setSpacing(m_spacing); } setting = node("Centred"); if(!setting.empty()) { m_centred = StringToBool(setting.first_child().value()); } setting = node("Text"); if(!setting.empty()) { m_text = setting.first_child().value(); } }
void CXTPPropertyGridItemPoint::SetValue(CString strValue) { SetPoint(StringToPoint(strValue)); }
void base_window::init(xml::node& node) { xml::node setting = node("Visible"); if(!setting.empty()) { m_visible = StringToBool(setting.first_child().value()); } setting = node("Align"); if(!setting.empty()) { m_alignment = StringToAlignment(setting.first_child().value()); } setting = node("Stick"); if(!setting.empty()) { m_stick = StringToAlignment(setting.first_child().value()); } setting = node("StickRect"); if(!setting.empty()) { m_stickRect = StringToRect(setting.first_child().value()); } setting = node("Area"); if(!setting.empty()) { m_area = StringToArea(setting.first_child().value()); } setting = node("Backcolor"); if(!setting.empty()) { m_backColor = StringToColor(setting.first_child().value()); } setting = node("Forecolor"); if(!setting.empty()) { m_foreColor = StringToColor(setting.first_child().value()); } setting = node("TabStop"); if(!setting.empty()) { m_tabstop = StringToBool(setting.first_child().value()); } setting = node("Draggable"); if(!setting.empty()) { m_draggable = StringToBool(setting.first_child().value()); } setting = node("AcceptDrop"); if(!setting.empty()) { m_acceptDrop = StringToBool(setting.first_child().value()); } setting = node("AlwaysOnTop"); if(!setting.empty()) { m_alwaysOnTop = StringToBool(setting.first_child().value()); } setting = node("Tooltip"); if(!setting.empty()) { m_tooltip = StringToBool(setting.first_child().value()); } setting = node("Size"); if(!setting.empty()) { setSize(StringToSize(setting.first_child().value())); } setting = node("Pos"); if(!setting.empty()) { setPosition(StringToPoint(setting.first_child().value())); } setting = node("IgnoreInputEvents"); if(!setting.empty()) { setIgnoreInputEvents(StringToBool(setting.first_child().value())); } setting = node("DisableRise"); if (!setting.empty()) { setDisableRise(StringToBool(setting.first_child().value())); } onMoved(); }