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 "cadtoolbarinfo.h"
16 #include "cadtoolbar.h"
17 #include "qg_actionhandler.h"
20 CadToolBarInfo::CadToolBarInfo(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
21 QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL)
26 CadToolBarInfo::~CadToolBarInfo()
30 void CadToolBarInfo::mousePressEvent(QMouseEvent * e)
32 if (e->button() == Qt::RightButton && cadToolBar != NULL)
39 void CadToolBarInfo::contextMenuEvent(QContextMenuEvent *e) {
43 void CadToolBarInfo::setCadToolBar(CadToolBar * tb)
48 actionHandler = tb->getActionHandler();
50 RS_DEBUG->print(RS_Debug::D_ERROR,
51 "CadToolBarInfo::setCadToolBar(): No valid toolbar set.");
54 void CadToolBarInfo::infoDist()
56 if (cadToolBar != NULL && actionHandler != NULL)
57 actionHandler->slotInfoDist();
60 void CadToolBarInfo::infoDist2()
62 if (cadToolBar != NULL && actionHandler != NULL)
63 actionHandler->slotInfoDist2();
66 void CadToolBarInfo::infoAngle()
68 if (cadToolBar != NULL && actionHandler != NULL)
69 actionHandler->slotInfoAngle();
72 void CadToolBarInfo::infoTotalLength()
74 if (cadToolBar != NULL && actionHandler != NULL)
75 actionHandler->slotInfoTotalLength();
78 void CadToolBarInfo::infoArea()
80 if (cadToolBar != NULL && actionHandler != NULL)
81 actionHandler->slotInfoArea();
84 void CadToolBarInfo::back()
86 if (cadToolBar != NULL)