mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-03-05 06:54:58 +01:00
33 lines
645 B
C++
33 lines
645 B
C++
#ifdef WINDOWS
|
|
#include "Tool_Delete.h"
|
|
#include "Simulator.h"
|
|
#include "Shape.h"
|
|
#include "CursorManager.h"
|
|
|
|
|
|
Tool_Delete::Tool_Delete() {
|
|
currentTarget = 0;
|
|
}
|
|
void Tool_Delete::onMouseDown(const Coord &pos, int button) {
|
|
if (currentTarget != 0) {
|
|
sim->markAsModified();
|
|
sim->destroyObject(currentTarget);
|
|
}
|
|
}
|
|
void Tool_Delete::onEnd() {
|
|
sim->getCursorMgr()->setCursor(SDL_SYSTEM_CURSOR_ARROW);
|
|
}
|
|
void Tool_Delete::drawTool() {
|
|
currentTarget = sim->getShapeUnderCursor();
|
|
if (currentTarget) {
|
|
sim->getCursorMgr()->setCursor(SDL_SYSTEM_CURSOR_NO);
|
|
}
|
|
else {
|
|
sim->getCursorMgr()->setCursor(SDL_SYSTEM_CURSOR_ARROW);
|
|
}
|
|
}
|
|
|
|
|
|
#endif
|
|
|