X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fforms%2Fprintpreviewoptions.cpp;h=a88bbf253dfb35a5bb9529db35c467f9ce29cfcd;hb=3f46c180da0806c9c263e6d87d0f1404632402da;hp=036a13c0010fea218576661de56fe72efc89724d;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/forms/printpreviewoptions.cpp b/src/forms/printpreviewoptions.cpp index 036a13c..a88bbf2 100644 --- a/src/forms/printpreviewoptions.cpp +++ b/src/forms/printpreviewoptions.cpp @@ -16,36 +16,42 @@ #include "rs.h" #include "rs_actioninterface.h" #include "rs_actionprintpreview.h" +#include "rs_debug.h" +#include "rs_math.h" -PrintPreviewOptions::PrintPreviewOptions(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): +//PrintPreviewOptions::PrintPreviewOptions(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): +PrintPreviewOptions::PrintPreviewOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), updateDisabled(false) { imperialScales - << "1\" = 1\"" - << "1\" = 2\"" - << "1\" = 4\"" - << "1\" = 8\"" - << "1\" = 16\"" - << "1\" = 32\"" - << "1\" = 64\"" - << "1\" = 128\"" - << "1\" = 256\""; + << "1\" = 1\"" + << "1\" = 2\"" + << "1\" = 4\"" + << "1\" = 8\"" + << "1\" = 16\"" + << "1\" = 32\"" + << "1\" = 64\"" + << "1\" = 128\"" + << "1\" = 256\""; metricScales - << "1:1" << "1:2" << "1:5" << "1:10" - << "1:20" << "1:25" << "1:50" << "1:75" << "1:100" - << "1:125" << "1:150" << "1:175" << "1:200" - << "1:250" << "1:500" << "1:750" << "1:1000" - << "1:2500" << "1:5000" << "1:7500" << "1:10000" - << "1:25000" << "1:50000" << "1:75000" << "1:100000" - << "2:1" << "5:1" << "10:1" - << "20:1" << "25:1" << "50:1" << "75:1" << "100:1" - << "125:1" << "150:1" << "175:1" << "200:1" - << "250:1" << "500:1" << "750:1" << "1000:1" - << "2500:1" << "5000:1" << "7500:1" << "10000:1" - << "25000:1" << "50000:1" << "75000:1" << "100000:1"; + << "1:1" << "1:2" << "1:5" << "1:10" + << "1:20" << "1:25" << "1:50" << "1:75" << "1:100" + << "1:125" << "1:150" << "1:175" << "1:200" + << "1:250" << "1:500" << "1:750" << "1:1000" + << "1:2500" << "1:5000" << "1:7500" << "1:10000" + << "1:25000" << "1:50000" << "1:75000" << "1:100000" + << "2:1" << "5:1" << "10:1" + << "20:1" << "25:1" << "50:1" << "75:1" << "100:1" + << "125:1" << "150:1" << "175:1" << "200:1" + << "250:1" << "500:1" << "750:1" << "1000:1" + << "2500:1" << "5000:1" << "7500:1" << "10000:1" + << "25000:1" << "50000:1" << "75000:1" << "100000:1"; ui.setupUi(this); + + if (parent) + parent->addWidget(this); } PrintPreviewOptions::~PrintPreviewOptions() @@ -58,7 +64,7 @@ PrintPreviewOptions::~PrintPreviewOptions() */ } -void PrintPreviewOptions::setAction(RS_ActionInterface* a, bool/*update*/) +void PrintPreviewOptions::setAction(RS_ActionInterface * a, bool/*update*/) { if (a != NULL && a->rtti() == RS2::ActionPrintPreview) { @@ -145,7 +151,6 @@ void PrintPreviewOptions::scale(const QString & s) { bool ok1 = false; bool ok2 = false; -// int i = s.find(':'); int i = s.indexOf(':'); double n = s.left(i).toDouble(&ok1); double d = s.mid(i + 1).toDouble(&ok2); @@ -156,7 +161,6 @@ void PrintPreviewOptions::scale(const QString & s) else if (s.contains('=')) { bool ok = false; -// int i = s.find('='); int i = s.indexOf('='); double d = s.mid(i + 2, s.length() - i - 3).toDouble(&ok);