libs/flake
KoParameterHandleMoveCommand.cppGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "KoParameterHandleMoveCommand.h"
00023 #include "KoParameterShape.h"
00024 #include <klocale.h>
00025
00026 KoParameterHandleMoveCommand::KoParameterHandleMoveCommand(KoParameterShape *shape, int handleId, const QPointF &startPoint, const QPointF &endPoint, Qt::KeyboardModifiers keyModifiers, QUndoCommand *parent)
00027 : QUndoCommand(parent)
00028 , m_shape(shape)
00029 , m_handleId(handleId)
00030 , m_startPoint(startPoint)
00031 , m_endPoint(endPoint)
00032 , m_keyModifiers(keyModifiers)
00033 {
00034 setText(i18n("Change parameter"));
00035 }
00036
00037 KoParameterHandleMoveCommand::~KoParameterHandleMoveCommand()
00038 {
00039 }
00040
00042 void KoParameterHandleMoveCommand::redo()
00043 {
00044 QUndoCommand::redo();
00045 m_shape->update();
00046 m_shape->moveHandle(m_handleId, m_endPoint, m_keyModifiers);
00047 m_shape->update();
00048 }
00049
00051 void KoParameterHandleMoveCommand::undo()
00052 {
00053 QUndoCommand::undo();
00054 m_shape->update();
00055 m_shape->moveHandle(m_handleId, m_startPoint);
00056 m_shape->update();
00057 }
00058
|