X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fobjectwidget.cpp;h=915e103bba199b111901b34054b46d0807102363;hb=6114b754fcd6e7d83c71dc2fa0ef2ec185387e12;hp=b4f2cda442077b293bc04d9e5c1b965b2b83198e;hpb=acd27aa62a4c78b6aeee523e3145a8aa53f4bcde;p=architektonas diff --git a/src/objectwidget.cpp b/src/objectwidget.cpp index b4f2cda..915e103 100644 --- a/src/objectwidget.cpp +++ b/src/objectwidget.cpp @@ -1,7 +1,7 @@ // objectwidget.cpp: Object tweaking widget // // Part of the Architektonas Project -// (C) 2016 Underground Software +// (C) 2020 Underground Software // See the README and GPLv3 files for licensing and warranty information // // JLH = James Hammons @@ -17,22 +17,8 @@ ObjectWidget::ObjectWidget(void): QWidget() { -#if 0 - QListWidget * qlw = new QListWidget; - QListWidgetItem * qli1 = new QListWidgetItem(qlw); - QListWidgetItem * qli2 = new QListWidgetItem(qlw); - QListWidgetItem * qli3 = new QListWidgetItem(qlw); - QListWidgetItem * qli4 = new QListWidgetItem(qlw); - QListWidgetItem * qli5 = new QListWidgetItem(qlw); -#endif label = new QLabel; -#if 0 - QPushButton * pb1 = new QPushButton("+"); - QPushButton * pb2 = new QPushButton("-"); - QPushButton * pb3 = new QPushButton("Edit"); - QPushButton * pb4 = new QPushButton("Import"); -#else QToolButton * pb1 = new QToolButton; QToolButton * pb2 = new QToolButton; QToolButton * pb3 = new QToolButton; @@ -47,7 +33,6 @@ ObjectWidget::ObjectWidget(void): QWidget() pb2->setToolTip(tr("Remove block")); pb3->setToolTip(tr("Edit block")); pb4->setToolTip(tr("Import block")); -#endif QHBoxLayout * hbox1 = new QHBoxLayout; hbox1->addWidget(pb1); @@ -58,6 +43,7 @@ ObjectWidget::ObjectWidget(void): QWidget() QVBoxLayout * mainLayout = new QVBoxLayout; mainLayout->addWidget(label); + mainLayout->addStretch(); mainLayout->addLayout(hbox1); setLayout(mainLayout); @@ -71,19 +57,11 @@ ObjectWidget::~ObjectWidget() void ObjectWidget::ShowInfo(Object * obj) { - const char objName[OTCount][16] = { - "None", "Line", "Circle", "Ellipse", "Arc", "Polygon", "Dimension", "Spline", "Text", "Container" - }; - const char dimName[DTCount][32] = { - "Linear", "Vertical", "Horizontal", "Radial", "Diametric", - "Circumferential", "Angular", "Leader" - }; - // Sanity check if (obj == NULL) return; - QString s = QString("%1

").arg(QString(objName[obj->type])); + QString s = QString("%1

").arg(QString(objName[obj->type])); switch (obj->type) { @@ -104,13 +82,16 @@ void ObjectWidget::ShowInfo(Object * obj) case OTArc: s += QString("Center: <%1, %2>
Radius: %3
Start: %4°
Span: %5°
").arg(obj->p[0].x).arg(obj->p[0].y).arg(obj->radius[0]).arg(obj->angle[0] * RADIANS_TO_DEGREES).arg(obj->angle[1] * RADIANS_TO_DEGREES); break; - break; case OTPolygon: break; case OTDimension: + { + Dimension * d = (Dimension *)obj; + s += QString("Type: %1
").arg(dimName[d->subtype]); break; + } case OTSpline: break;