| 33 | } |
| 34 | |
| 35 | void ToggleButton::SetActive( bool active ) { |
| 36 | if( active == m_active ) { |
| 37 | return; |
| 38 | } |
| 39 | |
| 40 | m_active = active; |
| 41 | |
| 42 | if( active ) { |
| 43 | SetState( State::SELECTED ); |
| 44 | } |
| 45 | else { |
| 46 | SetState( State::NORMAL ); |
| 47 | } |
| 48 | |
| 49 | Invalidate(); |
| 50 | GetSignals().Emit( OnToggle ); |
| 51 | } |
| 52 | |
| 53 | bool ToggleButton::IsActive() const { |
| 54 | return m_active; |