OpenASIP
2.0
|
#include <ToolbarButton.hh>
Public Member Functions | |
ToolbarButton (int slot, const std::string &action) | |
ToolbarButton (const ObjectState *state) | |
ToolbarButton (const ToolbarButton &old) | |
virtual | ~ToolbarButton () |
std::string | action () const |
int | slot () const |
void | loadState (const ObjectState *state) |
ObjectState * | saveState () const |
Public Member Functions inherited from Serializable | |
virtual | ~Serializable () |
Static Public Attributes | |
static const std::string | OSNAME_TOOLBAR_BUTTON = "tbbutton" |
ObjectState name for ToolbarButton. More... | |
static const std::string | OSKEY_SLOT = "slot" |
ObjectState attribute key for slot position. More... | |
static const std::string | OSKEY_ACTION = "action" |
ObjectState attribute key for action name. More... | |
Private Attributes | |
int | slot_ |
Number of the slot in which this toolbar button is. More... | |
std::string | action_ |
Name of the action performed by this toolbar button. More... | |
This class repsesents a toolbar button. It contains information which action is performed by the button and where the button is placed in the toolbar. This class implements the Serializable interface because toolbar button configurations are serialized in the configuration file.
Definition at line 48 of file ToolbarButton.hh.
ToolbarButton::ToolbarButton | ( | int | slot, |
const std::string & | action | ||
) |
ToolbarButton::ToolbarButton | ( | const ObjectState * | state | ) |
Constructor.
Loads the state from the given ObjectsState object.
Definition at line 62 of file ToolbarButton.cc.
References loadState().
ToolbarButton::ToolbarButton | ( | const ToolbarButton & | old | ) |
Copy constructor.
Definition at line 70 of file ToolbarButton.cc.
|
virtual |
std::string ToolbarButton::action | ( | ) | const |
Returns the name of the action performed by the button.
Definition at line 90 of file ToolbarButton.cc.
References action_.
Referenced by GUIOptions::createToolbar(), OptionsDialog::readOptions(), and MainFrame::updateUI().
|
virtual |
Loads the state of the object from the given ObjectState object.
state | ObjectState from which the state is loaded. |
ObjectStateLoadingException | If the given ObjectState instance is invalid. |
Implements Serializable.
Definition at line 114 of file ToolbarButton.cc.
References action_, ObjectState::intAttribute(), ObjectState::name(), OSKEY_ACTION, OSKEY_SLOT, OSNAME_TOOLBAR_BUTTON, slot_, and ObjectState::stringAttribute().
Referenced by ToolbarButton().
|
virtual |
Creates an ObjectState object and saves the state of the object into it.
Implements Serializable.
Definition at line 135 of file ToolbarButton.cc.
References action_, OSKEY_ACTION, OSKEY_SLOT, OSNAME_TOOLBAR_BUTTON, ObjectState::setAttribute(), and slot_.
Referenced by GUIOptions::saveState().
int ToolbarButton::slot | ( | ) | const |
Returns the position of the slot which contains the button.
Definition at line 101 of file ToolbarButton.cc.
References slot_.
Referenced by GUIOptions::createToolbar(), OptionsDialog::readOptions(), and GUIOptions::validate().
|
private |
Name of the action performed by this toolbar button.
Definition at line 72 of file ToolbarButton.hh.
Referenced by action(), loadState(), saveState(), and ToolbarButton().
|
static |
ObjectState attribute key for action name.
Definition at line 55 of file ToolbarButton.hh.
Referenced by GUIOptionsSerializer::convertToConfigFileFormat(), loadState(), saveState(), and GUIOptionsSerializer::setToolbarProperties().
|
static |
ObjectState attribute key for slot position.
Definition at line 53 of file ToolbarButton.hh.
Referenced by GUIOptionsSerializer::convertToConfigFileFormat(), loadState(), saveState(), and GUIOptionsSerializer::setToolbarProperties().
|
static |
ObjectState name for ToolbarButton.
Definition at line 51 of file ToolbarButton.hh.
Referenced by GUIOptionsSerializer::convertToConfigFileFormat(), loadState(), GUIOptions::loadState(), saveState(), and GUIOptionsSerializer::setToolbarProperties().
|
private |
Number of the slot in which this toolbar button is.
Definition at line 70 of file ToolbarButton.hh.
Referenced by loadState(), saveState(), slot(), and ToolbarButton().