#include <libsswf.h>
Inheritance diagram for sswf::TagButton:
Public Member Functions | |
Vectors & | Actions (void) |
Returns a reference to the actions array. | |
bool | AddEvent (Event *event) |
Add the specified event to the button tag. | |
virtual ErrorManager::error_code_t | Save (Data &data) |
Saves a button in the Data buffer. | |
void | SetAction (const Action &action) |
Append an action to the button. | |
void | SetMenu (bool menu=true) |
Set the menu flag. | |
bool | SetState (const State &state) |
Add a state to a button object. | |
TagButton (TagBase *parent) | |
Initializes a button tag object. | |
virtual swf_type_t | TypeFlags (void) const |
The flags representing the button tag type. | |
Private Member Functions | |
virtual ErrorManager::error_code_t | PreSave (void) |
Check that a button can be saved. | |
Private Attributes | |
Vectors | f_actions |
Vectors | f_events |
bool | f_menu |
bool | f_save_button2 |
Vectors | f_states |
To fully create a button, one can add actions (what happens when the user clicks on the button), events (what happens, in more details, when the user clicks) and different states (what happens when the mouse moves over and clicks on the button or not.)
TagButton::TagButton | ( | TagBase * | parent | ) |
This function initializes the button tag with an empty list of actions and states.
[in] | parent | The TagHeader where the button is added |
Vectors & TagButton::Actions | ( | void | ) |
This function returns a Vector reference to the internal array of actions.
This can be used to save the actions in any order as you need.
bool TagButton::AddEvent | ( | Event * | event | ) |
This function adds the specified event to the TagButton object.
An event is a set of flags which determine when the event is triggered and a set of actions to execute then.
As many events as you need can be added. However, the first event matching has its ActionScript executed and then the process stops (to be confirmed!)
[in] | event | The event to add to this TagPlace object |
ErrorManager::error_code_t TagButton::PreSave | ( | void | ) | [private, virtual] |
This function traverse the list of events and actions to determine the minimum version and make sure that the events are valid.
Reimplemented from sswf::TagBase.
ErrorManager::error_code_t TagButton::Save | ( | Data & | data | ) | [virtual] |
This function saves the button in the specified data buffer.
It can save button version 1 and 2.
The function will generate an error if it detects an invalid event (i.e. an event with all flags set at zero or invalid flags set.) If no event has the hit test bit set, an error is generated, but the save goes on.
[in] | data | The data buffer where the button is saved |
Implements sswf::TagBase.
void TagButton::SetAction | ( | const Action & | action | ) |
This function adds one action at the end of the list of actions of the button. If you want to manage the list better, use the Actions() function to get access to the array of actions.
The input action is copied and thus it can be modified on return.
[in] | action | The action to append; it is copied in the array |
void TagButton::SetMenu | ( | bool | menu = true |
) |
This function is used to set the menu flag of the button.
A button with the menu flag turned on can be used to select an entry as if it were a menu.
[in] | menu | The new state of the menu flag (true or false) |
bool TagButton::SetState | ( | const State & | state | ) |
This function adds a state to a button object.
Multiple states with the same flags can be added to the same button. In that case, they all become active at the time the states are satisfied.
[in] | state | The state to add to this button object |
TagBase::swf_type_t TagButton::TypeFlags | ( | void | ) | const [virtual] |
A button is of type:
SWF_TYPE_DEFINE SWF_TYPE_REFERENCE SWF_TYPE_SCRIPT SWF_TYPE_HAS_ID
Implements sswf::TagBase.
Vectors sswf::TagButton::f_actions [private] |
Vectors sswf::TagButton::f_events [private] |
bool sswf::TagButton::f_menu [private] |
bool sswf::TagButton::f_save_button2 [private] |
Vectors sswf::TagButton::f_states [private] |