X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fforms%2Fcadtoolbarinfo.cpp;h=b65ad7c685df5935a4d2329aeddd6e56d014ce54;hb=e1d1cacbb43055988d0d9db632fdf05c0bea9543;hp=882b900d6314feecb785f83dc40ce4ec28952a85;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/forms/cadtoolbarinfo.cpp b/src/forms/cadtoolbarinfo.cpp index 882b900..b65ad7c 100644 --- a/src/forms/cadtoolbarinfo.cpp +++ b/src/forms/cadtoolbarinfo.cpp @@ -1,8 +1,11 @@ // cadtoolbarinfo.cpp // +// Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun // Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software +// Portions copyright (C) 2001-2003 RibbonSoft +// Copyright (C) 2010 Underground Software +// See the README and GPLv2 files for licensing and warranty information // // JLH = James L. Hammons // @@ -14,74 +17,24 @@ #include "cadtoolbarinfo.h" #include "cadtoolbar.h" -#include "qg_actionhandler.h" +#include "createqtactions.h" -CadToolBarInfo::CadToolBarInfo(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): - QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) +CadToolBarInfo::CadToolBarInfo(CadToolBar * parent, Qt::WindowFlags flags/*= 0*/): + QWidget((QWidget *)parent, flags) { - ui.setupUi(this); -} - -CadToolBarInfo::~CadToolBarInfo() -{ -} - -void CadToolBarInfo::mousePressEvent(QMouseEvent * e) -{ - if (e->button() == Qt::RightButton && cadToolBar != NULL) - { - cadToolBar->back(); - e->accept(); - } -} - -void CadToolBarInfo::contextMenuEvent(QContextMenuEvent *e) { - e->accept(); -} + QGridLayout * gridLayout = new QGridLayout(this); + gridLayout->setSpacing(0); + gridLayout->setContentsMargins(0, 0, 0, 0); -void CadToolBarInfo::setCadToolBar(CadToolBar * tb) -{ - cadToolBar = tb; + gridLayout->addWidget(parent->CreateBackButton(this), 0, 0, 1, 2); - if (tb != NULL) - actionHandler = tb->getActionHandler(); - else - RS_DEBUG->print(RS_Debug::D_ERROR, - "CadToolBarInfo::setCadToolBar(): No valid toolbar set."); -} - -void CadToolBarInfo::infoDist() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotInfoDist(); + gridLayout->addWidget(parent->CreateToolButton(actionInfoDist), 1, 0, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionInfoDist2), 1, 1, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionInfoAngle), 2, 0, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionInfoTotalLength), 2, 1, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionInfoArea), 3, 0, 1, 1); } -void CadToolBarInfo::infoDist2() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotInfoDist2(); -} - -void CadToolBarInfo::infoAngle() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotInfoAngle(); -} - -void CadToolBarInfo::infoTotalLength() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotInfoTotalLength(); -} - -void CadToolBarInfo::infoArea() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotInfoArea(); -} - -void CadToolBarInfo::back() +CadToolBarInfo::~CadToolBarInfo() { - if (cadToolBar != NULL) - cadToolBar->back(); }