예제 #1
0
ButtonVector* FindButtonVectorNamed(const ParsedMui& muiInfo, const char* name) {
    for (size_t i = 0; i < muiInfo.vecButtons.size(); i++) {
        ButtonVector* c = muiInfo.vecButtons.at(i);
        if (c->IsNamed(name))
            return c;
    }
    return nullptr;
}
예제 #2
0
ButtonVector *FindButtonVectorNamed(const ParsedMui& muiInfo, const char *name)
{
    for (size_t i = 0; i < muiInfo.vecButtons.Count(); i++) {
        ButtonVector *c = muiInfo.vecButtons.At(i);
        if (c->IsNamed(name))
            return c;
    }
    return NULL;
}
예제 #3
0
static ButtonVector* ButtonVectorFromDef(TxtNode* structDef)
{
    CrashIf(!structDef->IsStructWithName("ButtonVector"));
    ButtonVectorDef *def = DeserializeButtonVectorDef(structDef);
    ButtonVector *b = new ButtonVector();
    b->SetName(def->name);
    b->SetNamedEventClick(def->clicked);

    if (def->path ){
        GraphicsPath *gp = svg::GraphicsPathFromPathData(def->path);
        b->SetGraphicsPath(gp);
    }
    if (def->styleDefault) {
        Style *style = StyleByName(def->styleDefault);
        CrashIf(!style);
        b->SetDefaultStyle(style);
    }
    if (def->styleMouseOver) {
        Style *style = StyleByName(def->styleMouseOver);
        CrashIf(!style);
        b->SetMouseOverStyle(style);
    }
    FreeButtonVectorDef(def);
    return b;
}