TITANIUM_PROPERTY_SETTER(Button, textAlign)
{
    bool result = false;
    if (argument.IsNumber()) {
        set_textAlign(Constants::to_TEXT_ALIGNMENT(static_cast<std::underlying_type<TEXT_ALIGNMENT>::type>(argument)));
        result = true;
    } else if (argument.IsString()) {
        set_textAlign(Constants::to_TEXT_ALIGNMENT(static_cast<std::string>(argument)));
        result = true;
    }

    return result;
}
コード例 #2
0
 void GdiContext2D::restore()
 {
     Check();
     // pop state stack and restore state
     CanvasStateInfo* p = m_stack.back();
     m_stack.pop_back();
     p->m_SaveClipRgn.Restore();
     // push state on state stack
     //The current transformation matrix.
     //The current clipping region.
     //The current values of the following attributes:
     set_strokeStyle(p->strokeStyle);
     set_fillStyle(p->fillStyle);
     //globalAlpha,
     lineWidth = p->lineWidth;
     //lineCap,
     //lineJoin,
     //miterLimit,
     set_shadowOffsetX(p->shadowOffsetX);
     set_shadowOffsetY(p->shadowOffsetY);
     set_shadowBlur(p->shadowBlur);
     set_shadowColor(p->shadowColor);
     //globalCompositeOperation,
     set_font(p->font);
     set_textAlign(p->textAlign);
     set_textBaseline(p->textBaseline);
     delete p;
 }