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"
19 CadToolBarInfo::CadToolBarInfo(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
20 QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL)
25 CadToolBarInfo::~CadToolBarInfo()
29 void CadToolBarInfo::mousePressEvent(QMouseEvent * e)
31 if (e->button() == Qt::RightButton && cadToolBar != NULL)
38 void CadToolBarInfo::contextMenuEvent(QContextMenuEvent *e) {
42 void CadToolBarInfo::setCadToolBar(CadToolBar * tb)
47 actionHandler = tb->getActionHandler();
49 RS_DEBUG->print(RS_Debug::D_ERROR,
50 "CadToolBarInfo::setCadToolBar(): No valid toolbar set.");
53 void CadToolBarInfo::infoDist()
55 if (cadToolBar != NULL && actionHandler != NULL)
56 actionHandler->slotInfoDist();
59 void CadToolBarInfo::infoDist2()
61 if (cadToolBar != NULL && actionHandler != NULL)
62 actionHandler->slotInfoDist2();
65 void CadToolBarInfo::infoAngle()
67 if (cadToolBar != NULL && actionHandler != NULL)
68 actionHandler->slotInfoAngle();
71 void CadToolBarInfo::infoTotalLength()
73 if (cadToolBar != NULL && actionHandler != NULL)
74 actionHandler->slotInfoTotalLength();
77 void CadToolBarInfo::infoArea()
79 if (cadToolBar != NULL && actionHandler != NULL)
80 actionHandler->slotInfoArea();
83 void CadToolBarInfo::back()
85 if (cadToolBar != NULL)