7 changed files with 80 additions and 4 deletions
@ -0,0 +1,24 @@ |
|||
#include "SetGuiModeCmd.h" |
|||
|
|||
namespace ofx{ |
|||
namespace piMapper{ |
|||
|
|||
SetGuiModeCmd::SetGuiModeCmd(SurfaceManagerGui * gui, int mode){ |
|||
_gui = gui; |
|||
_prevGuiMode = -1; |
|||
_mode = mode; |
|||
} |
|||
|
|||
void SetGuiModeCmd::exec(){ |
|||
_prevGuiMode = _gui->getMode(); |
|||
_gui->setMode(_mode); |
|||
} |
|||
|
|||
void SetGuiModeCmd::undo(){ |
|||
ofLogNotice("SetGuiModeCmd", "undo"); |
|||
_gui->setMode(_prevGuiMode); |
|||
} |
|||
|
|||
} // namespace piMapper
|
|||
} // namespace ofx
|
|||
|
@ -0,0 +1,28 @@ |
|||
// SetGuiModeCmd
|
|||
// Provides undo operation for setting the GUI mode/state
|
|||
// Created by Krisjanis Rijnieks 2015-05-14
|
|||
|
|||
#pragma once |
|||
|
|||
#include "SurfaceManagerGui.h" |
|||
#include "BaseCmd.h" |
|||
|
|||
namespace ofx{ |
|||
namespace piMapper{ |
|||
|
|||
class SetGuiModeCmd : public BaseUndoCmd{ |
|||
|
|||
public: |
|||
SetGuiModeCmd(SurfaceManagerGui * gui, int mode); |
|||
void exec(); |
|||
void undo(); |
|||
|
|||
private: |
|||
SurfaceManagerGui * _gui; |
|||
int _prevGuiMode; |
|||
int _mode; |
|||
}; |
|||
|
|||
} // namespace piMapper
|
|||
} // namespace ofx
|
|||
|
Loading…
Reference in new issue