X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fforms%2Fcadtoolbar.cpp;h=ec5929dec3a5a824c2a7f53c1755b164bc8d599f;hb=52b41ea9bcb03acb96393b36fe29f27ca0163565;hp=07a7aa3084e3653a49f7d2f57d50748a44881617;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/forms/cadtoolbar.cpp b/src/forms/cadtoolbar.cpp index 07a7aa3..ec5929d 100644 --- a/src/forms/cadtoolbar.cpp +++ b/src/forms/cadtoolbar.cpp @@ -1,5 +1,6 @@ // cadtoolbar.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 @@ -35,6 +36,9 @@ CadToolBar::CadToolBar(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): tbSelect(NULL), tbPolylines(NULL) { ui.setupUi(this); +//hm. here maybe? Yesh! +if (parent) + ((QToolBar *)parent)->addWidget(this); } CadToolBar::~CadToolBar() @@ -62,7 +66,7 @@ void CadToolBar::back() */ void CadToolBar::forceNext() { - if (currentTb != NULL && currentTb == tbSelect) + if (currentTb && currentTb == tbSelect) tbSelect->runNextAction(); } @@ -90,6 +94,7 @@ void CadToolBar::createSubToolBars(QG_ActionHandler * ah) actionHandler = ah; tbMain = new CadToolBarMain(this); tbMain->setCadToolBar(this); + currentTb = tbMain; tbPoints = new CadToolBarPoints(this); tbPoints->setCadToolBar(this); @@ -115,11 +120,9 @@ void CadToolBar::createSubToolBars(QG_ActionHandler * ah) tbSplines->setCadToolBar(this); tbSplines->hide(); -//#ifdef RS_PROF tbPolylines = new CadToolBarPolylines(this); tbPolylines->setCadToolBar(this); tbPolylines->hide(); -//#endif tbDim = new CadToolBarDim(this); tbDim->setCadToolBar(this); @@ -140,8 +143,6 @@ void CadToolBar::createSubToolBars(QG_ActionHandler * ah) tbSelect = new CadToolBarSelect(this); tbSelect->setCadToolBar(this); tbSelect->hide(); - - //showToolBarMain(); } void CadToolBar::showToolBar(int id) @@ -169,11 +170,9 @@ void CadToolBar::showToolBar(int id) case RS2::ToolBarSplines: newTb = tbSplines; break; -//#ifdef RS_PROF case RS2::ToolBarPolylines: newTb = tbPolylines; break; -//#endif case RS2::ToolBarCircles: newTb = tbCircles; break; @@ -197,12 +196,12 @@ void CadToolBar::showToolBar(int id) if (currentTb == newTb) return; - if (currentTb != NULL) + if (currentTb) currentTb->hide(); currentTb = newTb; - if (currentTb != NULL) + if (currentTb) currentTb->show(); }