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