forked from Karimgebril09/Paint-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeletefigureaction.cpp
More file actions
43 lines (37 loc) · 932 Bytes
/
deletefigureaction.cpp
File metadata and controls
43 lines (37 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include"deletefigureaction.h"
#include"ApplicationManager.h"
#include "GUI/Input.h"
#include "GUI/Output.h"
deletefigureaction::deletefigureaction(ApplicationManager* pApp) :Action(pApp)
{}
void deletefigureaction::ReadActionParameters()
{
}
bool deletefigureaction::Execute(bool readparams)
{
Output* pOut = pManager->GetOutput();
CFigure* selected = pManager->getselectpointer();
if (selected)//if there is a figure selected it execute it
{
pManager->deletefigure(selected);
pOut->PrintMessage("Figure deleted");
pManager->AddAct(this);
}
else
{
pOut->PrintMessage("select a figure first to delete");
}
return false;
}
void deletefigureaction::Undo()
{
// pManager->AddFigure(pManager->TrnsLFig());
}
void deletefigureaction::Redo()
{
// pManager->deletefigure(pManager->GetLastFigure());
}
bool deletefigureaction::record_me() const
{
return 1;
}