#include <core/activator.h>
Inheritance diagram for neo::core::Activator:


Example usage:
Activator obj; //Object is now active obj.toggle(); //Object is now inactive, calls notification method obj.activate(); //Object is now active, calls notification method obj.activate(); //Object was already active, does NOT call notification method if( obj.isActive() ) //Returns true obj.deactivate(); //Object is now inactive, calls notification method
Scripting event names (each method is called with the current Activator object as first argument):
Public Member Functions | |
| Activator (bool active=true) | |
| Initialize state. | |
| Activator (const Activator &ref) | |
| Initialize state. | |
| void | activate () |
| Activate object. | |
| void | deactivate () |
| Deactivate object. | |
| bool | toggle () |
| Toggle state. | |
| bool | isActive () const |
| Query state. | |
| Activator & | operator= (const Activator &rhs) |
| Assign state. | |
Protected Member Functions | |
| virtual void | onActiveStateChange () |
| State change notification. | |
| virtual void | getEvents (core::Array< std::string > *p_events) |
| Enumerate events. | |
| neo::core::Activator::Activator | ( | bool | active = true |
) |
Set the initial state of the object, defaulting to activated. The notification method is not called
| active | Initial state, default true (active) |
| neo::core::Activator::Activator | ( | const Activator & | ref | ) |
Set the initial state of the object to match given reference object. The notification method is not called
| ref | Reference object to get initial state from |
| void neo::core::Activator::activate | ( | ) |
Activate the object by setting the active flag to true and calling the state change notification method if the object was previously deactivated
| void neo::core::Activator::deactivate | ( | ) |
Deactivate the object by setting the active flag to false and calling the state change notification method if the object was previously activated
| bool neo::core::Activator::toggle | ( | ) | [inline] |
Toggles the activated/deactivated state by toggling the active flag and calling the state change notification method
| bool neo::core::Activator::isActive | ( | ) | const [inline] |
Query the active state of the object
Assign state from given reference object, calling the state change notification method if the state was changed
| rhs | Reference object |
| virtual void neo::core::Activator::onActiveStateChange | ( | ) | [protected, virtual] |
Notification method called when the object has changed it's activated/deactivated state. This method is not called during the constructor or if the method itself causes the state to change. This method triggers the scripting event "onActiveStateChange".
| virtual void neo::core::Activator::getEvents | ( | core::Array< std::string > * | p_events | ) | [protected, virtual] |
Enumerate events for this object type
| p_events | Event names receiver |
Implements neo::script::Scriptable.
Reimplemented in neo::gui::Area, neo::gui::Button, neo::gui::EditBox, neo::gui::Object, neo::gui::Slider, neo::gui::TextArea, and neo::scene::Object.
1.5.1