Skip to content

Commit

Permalink
+ use quantity boxes in box & cylinder creation dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Feb 27, 2016
1 parent d56357f commit 236f166
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/Mod/Part/Gui/CommandSimple.cpp
Expand Up @@ -74,11 +74,11 @@ void CmdPartSimpleCylinder::activated(int iMsg)
".Shape=Part.makeCylinder(%f,%f,"
"Base.Vector(%f,%f,%f),"
"Base.Vector(%f,%f,%f))"
,dlg.radius->value()
,dlg.length->value()
,dlg.xPos->value()
,dlg.yPos->value()
,dlg.zPos->value()
,dlg.radius->value().getValue()
,dlg.length->value().getValue()
,dlg.xPos->value().getValue()
,dlg.yPos->value().getValue()
,dlg.zPos->value().getValue()
,dir.x,dir.y,dir.z);
commitCommand();
updateActive();
Expand Down
37 changes: 31 additions & 6 deletions src/Mod/Part/Gui/DlgPartBox.ui
Expand Up @@ -27,7 +27,10 @@
<number>6</number>
</property>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="xPos">
<widget class="Gui::QuantitySpinBox" name="xPos">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<double>-2147480000.000000000000000</double>
</property>
Expand All @@ -44,7 +47,10 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="yPos">
<widget class="Gui::QuantitySpinBox" name="yPos">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<double>-2147480000.000000000000000</double>
</property>
Expand All @@ -54,7 +60,10 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="zPos">
<widget class="Gui::QuantitySpinBox" name="zPos">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<double>-2147480000.000000000000000</double>
</property>
Expand Down Expand Up @@ -107,7 +116,10 @@
<number>6</number>
</property>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="wLength">
<widget class="Gui::QuantitySpinBox" name="wLength">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="maximum">
<double>2147480000.000000000000000</double>
</property>
Expand All @@ -117,7 +129,10 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="vLength">
<widget class="Gui::QuantitySpinBox" name="vLength">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="maximum">
<double>2147480000.000000000000000</double>
</property>
Expand All @@ -127,7 +142,10 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="uLength">
<widget class="Gui::QuantitySpinBox" name="uLength">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="maximum">
<double>2147480000.000000000000000</double>
</property>
Expand Down Expand Up @@ -170,6 +188,13 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>Gui::QuantitySpinBox</class>
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>xPos</tabstop>
<tabstop>yPos</tabstop>
Expand Down
32 changes: 27 additions & 5 deletions src/Mod/Part/Gui/DlgPartCylinder.ui
Expand Up @@ -62,7 +62,10 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="zPos">
<widget class="Gui::QuantitySpinBox" name="zPos">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<double>-2147480000.000000000000000</double>
</property>
Expand All @@ -72,7 +75,10 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="yPos">
<widget class="Gui::QuantitySpinBox" name="yPos">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<double>-2147480000.000000000000000</double>
</property>
Expand All @@ -82,7 +88,10 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="xPos">
<widget class="Gui::QuantitySpinBox" name="xPos">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<double>-2147480000.000000000000000</double>
</property>
Expand Down Expand Up @@ -121,7 +130,10 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="length">
<widget class="Gui::QuantitySpinBox" name="length">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="maximum">
<double>2147480000.000000000000000</double>
</property>
Expand All @@ -131,7 +143,10 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="radius">
<widget class="Gui::QuantitySpinBox" name="radius">
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="maximum">
<double>2147480000.000000000000000</double>
</property>
Expand All @@ -153,6 +168,13 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>Gui::QuantitySpinBox</class>
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>xPos</tabstop>
<tabstop>yPos</tabstop>
Expand Down
3 changes: 0 additions & 3 deletions src/Mod/Part/Gui/DlgPartCylinderImp.cpp
Expand Up @@ -39,9 +39,6 @@ using namespace PartGui;
DlgPartCylinderImp::DlgPartCylinderImp(QWidget* parent, Qt::WindowFlags fl)
: Gui::LocationInterface<Ui_DlgPartCylinder>(parent, fl)
{
QList<QDoubleSpinBox*> list = this->findChildren<QDoubleSpinBox*>();
for (QList<QDoubleSpinBox*>::iterator it = list.begin(); it != list.end(); ++it)
(*it)->setDecimals(Base::UnitsApi::getDecimals());
}

/*
Expand Down

0 comments on commit 236f166

Please sign in to comment.