1 // cadtoolbarellipses.cpp
3 // Originally part of QCad Community Edition by Andrew Mustun
4 // Extensively rewritten and refactored by James L. Hammons
5 // (C) 2010 Underground Software
7 // JLH = James L. Hammons <jlhamm@acm.org>
10 // --- ---------- -----------------------------------------------------------
11 // JLH 05/10/2010 Created this file. :-)
14 #include "cadtoolbarellipses.h"
16 #include "cadtoolbar.h"
17 #include "qg_actionhandler.h"
20 CadToolBarEllipses::CadToolBarEllipses(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
21 QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL)
26 CadToolBarEllipses::~CadToolBarEllipses()
30 void CadToolBarEllipses::mousePressEvent(QMouseEvent * e)
32 if (e->button() == Qt::RightButton && cadToolBar != NULL)
39 void CadToolBarEllipses::contextMenuEvent(QContextMenuEvent * e)
44 void CadToolBarEllipses::setCadToolBar(CadToolBar * tb)
49 actionHandler = tb->getActionHandler();
51 RS_DEBUG->print(RS_Debug::D_ERROR, "CadToolBarEllipses::setCadToolBar(): No valid toolbar set.");
54 void CadToolBarEllipses::drawEllipseAxis()
56 if (cadToolBar != NULL && actionHandler != NULL)
57 actionHandler->slotDrawEllipseAxis();
60 void CadToolBarEllipses::drawEllipseArcAxis()
62 if (cadToolBar != NULL && actionHandler != NULL)
63 actionHandler->slotDrawEllipseArcAxis();
66 void CadToolBarEllipses::back()
68 if (cadToolBar != NULL)