3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 05/10/2010 Created this file. :-)
15 // JLH 06/18/2010 Changed this class to use predefined actions instead of
16 // reinventing the wheel. Also changed construction to use
17 // type CadToolBar instead of QWidget.
20 #include "cadtoolbarlines.h"
22 #include "cadtoolbar.h"
23 #include "createqtactions.h"
25 CadToolBarLines::CadToolBarLines(CadToolBar * parent, Qt::WindowFlags flags/*= 0*/):
26 QWidget((QWidget *)parent, flags)
28 QGridLayout * gridLayout = new QGridLayout(this);
29 gridLayout->setSpacing(0);
30 gridLayout->setContentsMargins(0, 0, 0, 0);
32 gridLayout->addWidget(parent->CreateBackButton(this), 0, 0, 1, 2);
34 gridLayout->addWidget(parent->CreateToolButton(actionDrawLine), 1, 0, 1, 1);
35 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineAngle), 1, 1, 1, 1);
36 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineHorizontal), 2, 0, 1, 1);
37 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineVertical), 2, 1, 1, 1);
38 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineRectangle), 3, 0, 1, 1);
39 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineBisector), 3, 1, 1, 1);
40 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineParallel), 4, 0, 1, 1);
41 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineParallelThrough), 4, 1, 1, 1);
42 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineTangent1), 5, 0, 1, 1);
43 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineTangent2), 5, 1, 1, 1);
44 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineOrthogonal), 6, 0, 1, 1);
45 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineRelAngle), 6, 1, 1, 1);
46 gridLayout->addWidget(parent->CreateToolButton(actionDrawLinePolygon), 7, 0, 1, 1);
47 gridLayout->addWidget(parent->CreateToolButton(actionDrawLinePolygon2), 7, 1, 1, 1);
48 gridLayout->addWidget(parent->CreateToolButton(actionDrawLineFree), 8, 0, 1, 1);
51 CadToolBarLines::~CadToolBarLines()