X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fforms%2Fcadtoolbarmodify.cpp;h=1c722bacc6b661fc2cfbe6f2f367e2d2270a310a;hb=e1d1cacbb43055988d0d9db632fdf05c0bea9543;hp=faf53ae882753d0bb4e0602fe03a67fe231fc010;hpb=52b41ea9bcb03acb96393b36fe29f27ca0163565;p=architektonas diff --git a/src/forms/cadtoolbarmodify.cpp b/src/forms/cadtoolbarmodify.cpp index faf53ae..1c722ba 100644 --- a/src/forms/cadtoolbarmodify.cpp +++ b/src/forms/cadtoolbarmodify.cpp @@ -1,8 +1,11 @@ // cadtoolbarmodify.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,155 +17,45 @@ #include "cadtoolbarmodify.h" #include "cadtoolbar.h" -#include "qg_actionhandler.h" -#include "rs_debug.h" +#include "createqtactions.h" -CadToolBarModify::CadToolBarModify(QWidget * parent /*= 0*/, Qt::WindowFlags flags /*= 0*/): - QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) +CadToolBarModify::CadToolBarModify(CadToolBar * parent, Qt::WindowFlags flags/*= 0*/): + QWidget((QWidget *)parent, flags) { - ui.setupUi(this); -} - -CadToolBarModify::~CadToolBarModify() -{ -} - -void CadToolBarModify::mousePressEvent(QMouseEvent * e) -{ - if (e->button() == Qt::RightButton && cadToolBar != NULL) - { - cadToolBar->back(); - e->accept(); - } -} - -void CadToolBarModify::contextMenuEvent(QContextMenuEvent *e) -{ - e->accept(); -} - -void CadToolBarModify::setCadToolBar(CadToolBar * tb) -{ - cadToolBar = tb; - - if (tb != NULL) - actionHandler = tb->getActionHandler(); - else - RS_DEBUG->print(RS_Debug::D_ERROR, - "CadToolBarModify::setCadToolBar(): No valid toolbar set."); -} - -void CadToolBarModify::modifyMove() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyMove(); -} + QGridLayout * gridLayout = new QGridLayout(this); + gridLayout->setSpacing(0); + gridLayout->setContentsMargins(0, 0, 0, 0); -void CadToolBarModify::modifyRotate() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyRotate(); -} + gridLayout->addWidget(parent->CreateBackButton(this), 0, 0, 1, 2); -void CadToolBarModify::modifyScale() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyScale(); -} + gridLayout->addWidget(parent->CreateToolButton(actionModifyMove), 1, 0, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyRotate), 1, 1, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyScale), 2, 0, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyMirror), 2, 1, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyMoveRotate), 3, 0, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyRotate2), 3, 1, 1, 1); -void CadToolBarModify::modifyMirror() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyMirror(); -} + gridLayout->addWidget(parent->CreateToolButton(actionModifyTrim), 5, 0, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyTrim2), 5, 1, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyTrimAmount), 6, 0, 1, 1); -void CadToolBarModify::modifyMoveRotate() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyMoveRotate(); -} + gridLayout->addWidget(parent->CreateToolButton(actionModifyBevel), 8, 0, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyRound), 8, 1, 1, 1); -void CadToolBarModify::modifyRotate2() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyRotate2(); -} + gridLayout->addWidget(parent->CreateToolButton(actionModifyCut), 10, 0, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyStretch), 10, 1, 1, 1); -void CadToolBarModify::modifyTrim() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyTrim(); -} + gridLayout->addWidget(parent->CreateToolButton(actionModifyEntity), 12, 0, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyAttributes), 12, 1, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyDelete), 13, 0, 1, 1); + gridLayout->addWidget(parent->CreateToolButton(actionModifyExplode), 13, 1, 1, 1); -void CadToolBarModify::modifyTrim2() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyTrim2(); + gridLayout->addWidget(parent->CreateToolButton(actionModifyExplodeText), 15, 0, 1, 1); +#warning "!!! actionModifyEntityText is missing !!!" +//EntityText +// gridLayout->addWidget(parent->CreateToolButton(actionModifyEntityText), 15, 1, 1, 1); } -void CadToolBarModify::modifyTrimAmount() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyTrimAmount(); -} - -void CadToolBarModify::modifyCut() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyCut(); -} - -void CadToolBarModify::modifyBevel() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyBevel(); -} - -void CadToolBarModify::modifyRound() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyRound(); -} - -void CadToolBarModify::modifyEntity() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyEntity(); -} - -void CadToolBarModify::modifyDelete() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyDelete(); -} - -void CadToolBarModify::modifyAttributes() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyAttributes(); -} - -void CadToolBarModify::modifyStretch() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyStretch(); -} - -void CadToolBarModify::modifyExplode() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotBlocksExplode(); -} - -void CadToolBarModify::modifyExplodeText() -{ - if (cadToolBar != NULL && actionHandler != NULL) - actionHandler->slotModifyExplodeText(); -} - -void CadToolBarModify::back() +CadToolBarModify::~CadToolBarModify() { - if (cadToolBar != NULL) - cadToolBar->back(); } -