| 84 | } |
| 85 | |
| 86 | void RadioButton::dispatchSelectChangedEvent(bool selected) |
| 87 | { |
| 88 | EventType eventType = (selected ? EventType::SELECTED : EventType::UNSELECTED); |
| 89 | this->retain(); |
| 90 | if (_radioButtonEventCallback) |
| 91 | { |
| 92 | _radioButtonEventCallback(this, eventType); |
| 93 | } |
| 94 | if (_ccEventCallback) |
| 95 | { |
| 96 | _ccEventCallback(this, static_cast<int>(eventType)); |
| 97 | } |
| 98 | |
| 99 | if (selected && _group != nullptr) |
| 100 | { |
| 101 | _group->onChangedRadioButtonSelect(this); |
| 102 | } |
| 103 | this->release(); |
| 104 | } |
| 105 | |
| 106 | void RadioButton::addEventListener(const ccRadioButtonCallback& callback) |
| 107 | { |
no test coverage detected