Imperial Sketcher grid in Dialog
This commit is contained in:
@@ -78,14 +78,18 @@ TaskSketcherGeneral::TaskSketcherGeneral(ViewProviderSketch *sketchView)
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Sketcher/General");
|
||||
ui->checkBoxShowGrid->setChecked(hGrp->GetBool("ShowGrid", true));
|
||||
|
||||
fillGridCombo();
|
||||
QString size = ui->comboBoxGridSize->currentText();
|
||||
size = QString::fromAscii(hGrp->GetASCII("GridSize", (const char*)size.toAscii()).c_str());
|
||||
ui->comboBoxGridSize->setCurrentIndex(ui->comboBoxGridSize->findText(size));
|
||||
int it = ui->comboBoxGridSize->findText(size);
|
||||
if(it != -1)
|
||||
ui->comboBoxGridSize->setCurrentIndex(it);
|
||||
|
||||
ui->checkBoxGridSnap->setChecked(hGrp->GetBool("GridSnap", ui->checkBoxGridSnap->isChecked()));
|
||||
ui->checkBoxAutoconstraints->setChecked(hGrp->GetBool("AutoConstraints", ui->checkBoxAutoconstraints->isChecked()));
|
||||
}
|
||||
|
||||
|
||||
TaskSketcherGeneral::~TaskSketcherGeneral()
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
@@ -102,6 +106,43 @@ TaskSketcherGeneral::~TaskSketcherGeneral()
|
||||
Gui::Selection().Detach(this);
|
||||
}
|
||||
|
||||
void TaskSketcherGeneral::fillGridCombo(void)
|
||||
{
|
||||
if(Base::UnitsApi::getSchema() == Base::UnitSystem::Imperial1 ){
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("1/128 \""));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("1/64 \""));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("1/32 \""));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("1/16 \""));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("1/8 \""));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("1/4 \""));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("1/2 \""));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("1 \""));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("2 \""));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("4 \""));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("8 \""));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("16 \""));
|
||||
|
||||
ui->comboBoxGridSize->setCurrentIndex(ui->comboBoxGridSize->findText(QString::fromUtf8("1/4 \"")));
|
||||
}else{
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("0.1 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("0.2 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("0.5 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("1 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("2 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("5 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("10 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("20 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("50 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("100 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("200 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("500 mm"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("1 m"));
|
||||
ui->comboBoxGridSize->addItem(QString::fromUtf8("2 m"));
|
||||
|
||||
ui->comboBoxGridSize->setCurrentIndex(ui->comboBoxGridSize->findText(QString::fromUtf8("10 mm")));
|
||||
}
|
||||
}
|
||||
|
||||
void TaskSketcherGeneral::toggleGridView(bool on)
|
||||
{
|
||||
ui->label->setEnabled(on);
|
||||
|
||||
@@ -61,6 +61,7 @@ protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
ViewProviderSketch *sketchView;
|
||||
void fillGridCombo(void);
|
||||
|
||||
private:
|
||||
QWidget* proxy;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>153</width>
|
||||
<height>112</height>
|
||||
<height>115</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -39,93 +39,8 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>6</number>
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">0.1 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">0.2 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">0.5 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">1 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">2 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">5 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">10 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">20 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">50 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">100 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">200 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">500 mm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">1 m</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">2 m</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">5 m</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">10 m</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">20 m</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user