예제 #1
0
void RadioButtonGroup::updateCheckedState(HTMLInputElement* button)
{
    ASSERT(button->isRadioButton());
    ASSERT(m_members.contains(button));
    bool wasValid = isValid();
    if (button->checked())
        setCheckedButton(button);
    else {
        if (m_checkedButton == button)
            setCheckedButton(nullptr);
    }
    if (wasValid != isValid())
        updateValidityForAllButtons();
}
예제 #2
0
void RadioButtonGroup::updateCheckedState(HTMLInputElement* button) {
  DCHECK_EQ(button->type(), InputTypeNames::radio);
  DCHECK(m_members.contains(button));
  bool wasValid = isValid();
  if (button->checked()) {
    setCheckedButton(button);
  } else {
    if (m_checkedButton == button)
      m_checkedButton = nullptr;
  }
  if (wasValid != isValid())
    setNeedsValidityCheckForAllButtons();
  for (auto& member : m_members) {
    HTMLInputElement* const inputElement = member.key;
    inputElement->pseudoStateChanged(CSSSelector::PseudoIndeterminate);
  }
}
예제 #3
0
void RadioButtonGroup::add(HTMLInputElement* button) {
  DCHECK_EQ(button->type(), InputTypeNames::radio);
  auto addResult = m_members.add(button, false);
  if (!addResult.isNewEntry)
    return;
  bool groupWasValid = isValid();
  updateRequiredButton(*addResult.storedValue, button->isRequired());
  if (button->checked())
    setCheckedButton(button);

  bool groupIsValid = isValid();
  if (groupWasValid != groupIsValid) {
    setNeedsValidityCheckForAllButtons();
  } else if (!groupIsValid) {
    // A radio button not in a group is always valid. We need to make it
    // invalid only if the group is invalid.
    button->setNeedsValidityCheck();
  }
}
예제 #4
0
void RadioButtonGroup::add(HTMLInputElement* button)
{
    ASSERT(button->isRadioButton());
    if (!m_members.add(button).isNewEntry)
        return;
    bool groupWasValid = isValid();
    if (button->isRequired())
        ++m_requiredCount;
    if (button->checked())
        setCheckedButton(button);

    bool groupIsValid = isValid();
    if (groupWasValid != groupIsValid)
        updateValidityForAllButtons();
    else if (!groupIsValid) {
        // A radio button not in a group is always valid. We need to make it
        // invalid only if the group is invalid.
        button->updateValidity();
    }
}
void JulyButtonMenu::aboutToHideWindow()
{
    emit setCheckedButton(false);
}
예제 #6
0
파일: WButtonGroup.C 프로젝트: LifeGo/wt
void WButtonGroup::setSelectedButtonIndex(int idx)
{
  setCheckedButton(idx != -1 ? buttons_[idx].button : 0);
}