3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // (C) 2010 Underground Software
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 05/10/2010 Created this file. :-)
15 #include "cadtoolbardim.h"
17 #include "cadtoolbar.h"
18 #include "qg_actionhandler.h"
21 CadToolBarDim::CadToolBarDim(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
22 QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL)
27 CadToolBarDim::~CadToolBarDim()
31 void CadToolBarDim::mousePressEvent(QMouseEvent * e)
33 if (e->button() == Qt::RightButton && cadToolBar != NULL)
40 void CadToolBarDim::contextMenuEvent(QContextMenuEvent * e)
45 void CadToolBarDim::setCadToolBar(CadToolBar * tb)
50 actionHandler = tb->getActionHandler();
52 RS_DEBUG->print(RS_Debug::D_ERROR, "CadToolBarDim::setCadToolBar(): No valid toolbar set.");
55 void CadToolBarDim::drawDimAligned()
57 if (cadToolBar != NULL && actionHandler != NULL)
58 actionHandler->slotDimAligned();
61 void CadToolBarDim::drawDimLinear()
63 if (cadToolBar != NULL && actionHandler != NULL)
64 actionHandler->slotDimLinear();
67 void CadToolBarDim::drawDimLinearHor()
69 if (cadToolBar != NULL && actionHandler != NULL)
70 actionHandler->slotDimLinearHor();
73 void CadToolBarDim::drawDimLinearVer()
75 if (cadToolBar != NULL && actionHandler != NULL)
76 actionHandler->slotDimLinearVer();
79 void CadToolBarDim::drawDimRadial()
81 if (cadToolBar != NULL && actionHandler != NULL)
82 actionHandler->slotDimRadial();
85 void CadToolBarDim::drawDimDiametric()
87 if (cadToolBar != NULL && actionHandler != NULL)
88 actionHandler->slotDimDiametric();
91 void CadToolBarDim::drawDimAngular()
93 if (cadToolBar != NULL && actionHandler != NULL)
94 actionHandler->slotDimAngular();
97 void CadToolBarDim::drawDimLeader()
99 if (cadToolBar != NULL && actionHandler != NULL)
100 actionHandler->slotDimLeader();
103 void CadToolBarDim::back()
105 if (cadToolBar != NULL)