diff options
Diffstat (limited to 'src/FbTk/MacroCommand.cc')
-rw-r--r-- | src/FbTk/MacroCommand.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/FbTk/MacroCommand.cc b/src/FbTk/MacroCommand.cc index adee9cb..491b01e 100644 --- a/src/FbTk/MacroCommand.cc +++ b/src/FbTk/MacroCommand.cc | |||
@@ -38,6 +38,24 @@ void MacroCommand::execute() { | |||
38 | m_commandlist[i]->execute(); | 38 | m_commandlist[i]->execute(); |
39 | } | 39 | } |
40 | 40 | ||
41 | ToggleCommand::ToggleCommand() { | ||
42 | m_state = 0; | ||
43 | } | ||
44 | |||
45 | void ToggleCommand::add(RefCount<Command> &com) { | ||
46 | m_commandlist.push_back(com); | ||
47 | } | ||
48 | |||
49 | size_t ToggleCommand::size() const { | ||
50 | return m_commandlist.size(); | ||
51 | } | ||
52 | |||
53 | void ToggleCommand::execute() { | ||
54 | m_commandlist[m_state]->execute(); | ||
55 | if (++m_state >= m_commandlist.size()) | ||
56 | m_state = 0; | ||
57 | } | ||
58 | |||
41 | }; // end namespace FbTk | 59 | }; // end namespace FbTk |
42 | 60 | ||
43 | 61 | ||