当前位置: 首页>>代码示例>>C++>>正文


C++ HTMLInputElement::checked方法代码示例

本文整理汇总了C++中HTMLInputElement::checked方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLInputElement::checked方法的具体用法?C++ HTMLInputElement::checked怎么用?C++ HTMLInputElement::checked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTMLInputElement的用法示例。


在下文中一共展示了HTMLInputElement::checked方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addButton

void CheckedRadioButtons::addButton(HTMLFormControlElement* element)
{
    // We only want to add radio buttons.
    if (!element->isRadioButton())
        return;

    // Without a name, there is no group.
    if (element->name().isEmpty())
        return;

    HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element);

    // We only track checked buttons.
    if (!inputElement->checked())
        return;

    if (!m_nameToCheckedRadioButtonMap)
        m_nameToCheckedRadioButtonMap.set(new NameToInputMap);

    pair<NameToInputMap::iterator, bool> result = m_nameToCheckedRadioButtonMap->add(element->name().impl(), inputElement);
    if (result.second)
        return;
    
    HTMLInputElement* oldCheckedButton = result.first->second;
    if (oldCheckedButton == inputElement)
        return;

    result.first->second = inputElement;
    oldCheckedButton->setChecked(false);
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:30,代码来源:CheckedRadioButtons.cpp

示例2: jsHTMLInputElementChecked

JSValue jsHTMLInputElementChecked(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSHTMLInputElement* castedThis = static_cast<JSHTMLInputElement*>(asObject(slot.slotBase()));
    UNUSED_PARAM(exec);
    HTMLInputElement* imp = static_cast<HTMLInputElement*>(castedThis->impl());
    return jsBoolean(imp->checked());
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:7,代码来源:JSHTMLInputElement.cpp

示例3: getValueProperty

JSValue* JSHTMLInputElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case DefaultValueAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsString(imp->defaultValue());
    }
    case DefaultCheckedAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsBoolean(imp->defaultChecked());
    }
    case FormAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->form()));
    }
    case AcceptAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsString(imp->accept());
    }
    case AccessKeyAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsString(imp->accessKey());
    }
    case AlignAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsString(imp->align());
    }
    case AltAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsString(imp->alt());
    }
    case CheckedAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsBoolean(imp->checked());
    }
    case DisabledAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsBoolean(imp->disabled());
    }
    case MaxLengthAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsNumber(imp->maxLength());
    }
    case NameAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsString(imp->name());
    }
    case ReadOnlyAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsBoolean(imp->readOnly());
    }
    case SizeAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsNumber(imp->size());
    }
    case SrcAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsString(imp->src());
    }
    case TabIndexAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsNumber(imp->tabIndex());
    }
    case TypeAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsString(imp->type());
    }
    case UseMapAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsString(imp->useMap());
    }
    case ValueAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsString(imp->value());
    }
    case IndeterminateAttrNum: {
        HTMLInputElement* imp = static_cast<HTMLInputElement*>(impl());

        return jsBoolean(imp->indeterminate());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
//.........这里部分代码省略.........
开发者ID:FilipBE,项目名称:qtextended,代码行数:101,代码来源:JSHTMLInputElement.cpp


注:本文中的HTMLInputElement::checked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。