| 1771 | //----------------------------------------------------------------------------- |
| 1772 | |
| 1773 | void GuiControl::setActive( bool value ) |
| 1774 | { |
| 1775 | if( mActive == value ) |
| 1776 | return; |
| 1777 | |
| 1778 | mActive = value; |
| 1779 | |
| 1780 | if ( !mActive ) |
| 1781 | clearFirstResponder(); |
| 1782 | |
| 1783 | if ( mVisible && mAwake ) |
| 1784 | setUpdate(); |
| 1785 | |
| 1786 | if( getNamespace() ) // May be called during construction. |
| 1787 | onActive_callback( value ); |
| 1788 | |
| 1789 | // Pass activation on to children. |
| 1790 | |
| 1791 | for( iterator iter = begin(); iter != end(); ++ iter ) |
| 1792 | { |
| 1793 | GuiControl* child = dynamic_cast< GuiControl* >( *iter ); |
| 1794 | if( child ) |
| 1795 | child->setActive( value ); |
| 1796 | } |
| 1797 | } |
| 1798 | |
| 1799 | //============================================================================= |
| 1800 | // Persistence. |