MCPcopy Create free account
hub / github.com/axmolengine/axmol / dispatchSelectChangedEvent

Method dispatchSelectChangedEvent

core/ui/UIRadioButton.cpp:86–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void 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
106void RadioButton::addEventListener(const ccRadioButtonCallback& callback)
107{

Callers 1

deselectMethod · 0.45

Calls 3

retainMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected