|
Last change
on this file since d2d8f5 was 3e8325, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
|
Added a central registry that allows access to actions by name.
|
-
Property mode
set to
100644
|
|
File size:
663 bytes
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * MakroAction.cpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Dec 17, 2009
|
|---|
| 5 | * Author: crueger
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #include <string>
|
|---|
| 9 |
|
|---|
| 10 | #include "Actions/MakroAction.hpp"
|
|---|
| 11 | #include "Actions/Action.hpp"
|
|---|
| 12 | #include "Actions/ActionSequence.hpp"
|
|---|
| 13 |
|
|---|
| 14 | using namespace std;
|
|---|
| 15 |
|
|---|
| 16 | MakroAction::MakroAction(string _name,ActionSequence* _actions,bool _doRegister) :
|
|---|
| 17 | Action(_name,_doRegister),
|
|---|
| 18 | actions(_actions)
|
|---|
| 19 | {
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | MakroAction::~MakroAction()
|
|---|
| 23 | {
|
|---|
| 24 | Action* action;
|
|---|
| 25 | while(action=actions->removeLastAction()){
|
|---|
| 26 | delete action;
|
|---|
| 27 | }
|
|---|
| 28 | delete actions;
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 | void MakroAction::call(){
|
|---|
| 33 | actions->callAll();
|
|---|
| 34 | }
|
|---|
| 35 |
|
|---|
| 36 | void MakroAction::undo() {
|
|---|
| 37 | actions->undoAll();
|
|---|
| 38 | }
|
|---|
| 39 |
|
|---|
| 40 | bool MakroAction::canUndo() {
|
|---|
| 41 | return actions->canUndo();
|
|---|
| 42 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.