1 // drawtextaction.cpp: Draw text object
3 // Part of the Architektonas Project
4 // (C) 2011 Underground Software
5 // See the README and GPLv3 files for licensing and warranty information
7 // JLH = James Hammons <jlhamm@acm.org>
10 // --- ---------- ------------------------------------------------------------
11 // JLH 03/14/2013 Created this file
14 #include "drawtextaction.h"
24 DrawTextAction::DrawTextAction(): state(0), text(NULL)
29 DrawTextAction::~DrawTextAction()
34 /*virtual*/ void DrawTextAction::Draw(Painter * painter)
36 painter->SetPen(QPen(Qt::red, 2.0, Qt::DotLine));
38 // I think stuff like crosshairs should be done in the DrawingView, tho
39 if (state == FIRST_POINT)
41 painter->DrawHandle(p1);
45 // painter->DrawLine(p1, p2);
46 // painter->DrawHandle(p2);
51 /*virtual*/ void DrawTextAction::MouseDown(Vector point)
53 if (state == FIRST_POINT)
60 /*virtual*/ void DrawTextAction::MouseMoved(Vector point)
62 if (state == FIRST_POINT)
69 /*virtual*/ void DrawTextAction::MouseReleased(void)
71 if (state == FIRST_POINT)
76 else if (state == NEXT_POINT)
78 // We create the new object here, and then pass it off to the
79 // DrawingView which stuffs it into the document.
80 // text = new Text(p1, p2);
81 // We don't need no stinkin' sentinels, when we have signals & slots!
82 emit ObjectReady(text);