PartDesign/Task{Pad,Pocket}Parameters: massive refactoring
Give a massive refactoring to Task dialogs for pocket and pad. This commit features: * Make Task dialogs for pocket and pad look nice in side-by side diff and cross import features missing in each other. * As a result it fixes several minor bugs. * Gives a rework to the UpdateUI function. * This one also fixes offset option support and migrates it to use unit framework.
This commit is contained in:
parent
143760c8d3
commit
0ca40ed48b
|
@ -69,7 +69,7 @@ Pad::Pad()
|
|||
ADD_PROPERTY_TYPE(Length,(100.0),"Pad",App::Prop_None,"Pad length");
|
||||
ADD_PROPERTY_TYPE(Length2,(100.0),"Pad",App::Prop_None,"P");
|
||||
ADD_PROPERTY_TYPE(UpToFace,(0),"Pad",App::Prop_None,"Face where pad will end");
|
||||
ADD_PROPERTY(Offset,(0.0));
|
||||
ADD_PROPERTY_TYPE(Offset,(0.0),"Pad",App::Prop_None,"Offset from face in which pad will end");
|
||||
}
|
||||
|
||||
short Pad::mustExecute() const
|
||||
|
@ -78,6 +78,7 @@ short Pad::mustExecute() const
|
|||
Type.isTouched() ||
|
||||
Length.isTouched() ||
|
||||
Length2.isTouched() ||
|
||||
Offset.isTouched() ||
|
||||
UpToFace.isTouched())
|
||||
return 1;
|
||||
return SketchBased::mustExecute();
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
App::PropertyEnumeration Type;
|
||||
App::PropertyLength Length;
|
||||
App::PropertyLength Length2;
|
||||
App::PropertyFloat Offset;
|
||||
App::PropertyLength Offset;
|
||||
|
||||
/** @name methods override feature */
|
||||
//@{
|
||||
|
|
|
@ -64,7 +64,7 @@ Pocket::Pocket()
|
|||
Type.setEnums(TypeEnums);
|
||||
ADD_PROPERTY_TYPE(Length,(100.0),"Pocket",App::Prop_None,"Pocket length");
|
||||
ADD_PROPERTY_TYPE(UpToFace,(0),"Pocket",App::Prop_None,"Face where pocket will end");
|
||||
ADD_PROPERTY(Offset,(0.0));
|
||||
ADD_PROPERTY_TYPE(Offset,(0.0),"Pad",App::Prop_None,"Offset from face in which pad will end");
|
||||
}
|
||||
|
||||
short Pocket::mustExecute() const
|
||||
|
@ -72,6 +72,7 @@ short Pocket::mustExecute() const
|
|||
if (Placement.isTouched() ||
|
||||
Type.isTouched() ||
|
||||
Length.isTouched() ||
|
||||
Offset.isTouched() ||
|
||||
UpToFace.isTouched())
|
||||
return 1;
|
||||
return SketchBased::mustExecute();
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
|
||||
App::PropertyEnumeration Type;
|
||||
App::PropertyLength Length;
|
||||
App::PropertyFloat Offset;
|
||||
App::PropertyLength Offset;
|
||||
|
||||
/** @name methods override feature */
|
||||
//@{
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
# include <sstream>
|
||||
# include <QRegExp>
|
||||
# include <QTextStream>
|
||||
# include <QMessageBox>
|
||||
# include <Precision.hxx>
|
||||
#endif
|
||||
|
||||
|
@ -54,7 +53,7 @@ using namespace Gui;
|
|||
|
||||
/* TRANSLATOR PartDesignGui::TaskPadParameters */
|
||||
|
||||
TaskPadParameters::TaskPadParameters(ViewProviderPad *PadView,bool newObj, QWidget *parent)
|
||||
TaskPadParameters::TaskPadParameters(ViewProviderPad *PadView, QWidget *parent, bool newObj)
|
||||
: TaskSketchBasedParameters(PadView, parent, "PartDesign_Pad",tr("Pad parameters"))
|
||||
{
|
||||
// we need a separate container widget to add all controls to
|
||||
|
@ -67,14 +66,15 @@ TaskPadParameters::TaskPadParameters(ViewProviderPad *PadView,bool newObj, QWidg
|
|||
// set the history path
|
||||
ui->lengthEdit->setParamGrpPath(QByteArray("User parameter:BaseApp/History/PadLength"));
|
||||
ui->lengthEdit2->setParamGrpPath(QByteArray("User parameter:BaseApp/History/PadLength2"));
|
||||
ui->offsetEdit->setParamGrpPath(QByteArray("User parameter:BaseApp/History/PadOffset"));
|
||||
|
||||
// Get the feature data
|
||||
PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(vp->getObject());
|
||||
Base::Quantity l = pcPad->Length.getQuantityValue();
|
||||
Base::Quantity l2 = pcPad->Length2.getQuantityValue();
|
||||
Base::Quantity off = pcPad->Offset.getQuantityValue();
|
||||
bool midplane = pcPad->Midplane.getValue();
|
||||
bool reversed = pcPad->Reversed.getValue();
|
||||
Base::Quantity l2 = pcPad->Length2.getQuantityValue();
|
||||
double off = pcPad->Offset.getValue();
|
||||
int index = pcPad->Type.getValue(); // must extract value here, clear() kills it!
|
||||
App::DocumentObject* obj = pcPad->UpToFace.getValue();
|
||||
std::vector<std::string> subStrings = pcPad->UpToFace.getSubValues();
|
||||
|
@ -87,15 +87,9 @@ TaskPadParameters::TaskPadParameters(ViewProviderPad *PadView,bool newObj, QWidg
|
|||
}
|
||||
|
||||
// Fill data into dialog elements
|
||||
ui->lengthEdit->setMinimum(0);
|
||||
ui->lengthEdit->setMaximum(INT_MAX);
|
||||
ui->lengthEdit->setValue(l);
|
||||
ui->lengthEdit2->setMinimum(0);
|
||||
ui->lengthEdit2->setMaximum(INT_MAX);
|
||||
ui->lengthEdit2->setValue(l2);
|
||||
ui->spinOffset->setMaximum(INT_MAX);
|
||||
ui->spinOffset->setMinimum(-INT_MAX);
|
||||
ui->spinOffset->setValue(off);
|
||||
ui->offsetEdit->setValue(off);
|
||||
|
||||
// Bind input fields to properties
|
||||
ui->lengthEdit->bind(pcPad->Length);
|
||||
|
@ -124,14 +118,14 @@ TaskPadParameters::TaskPadParameters(ViewProviderPad *PadView,bool newObj, QWidg
|
|||
|
||||
connect(ui->lengthEdit, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(onLengthChanged(double)));
|
||||
connect(ui->checkBoxMidplane, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onMidplane(bool)));
|
||||
connect(ui->checkBoxReversed, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onReversed(bool)));
|
||||
connect(ui->lengthEdit2, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(onLength2Changed(double)));
|
||||
connect(ui->spinOffset, SIGNAL(valueChanged(double)),
|
||||
connect(ui->offsetEdit, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(onOffsetChanged(double)));
|
||||
connect(ui->checkBoxMidplane, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onMidplaneChanged(bool)));
|
||||
connect(ui->checkBoxReversed, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onReversedChanged(bool)));
|
||||
connect(ui->changeMode, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(onModeChanged(int)));
|
||||
connect(ui->buttonFace, SIGNAL(clicked()),
|
||||
|
@ -141,87 +135,74 @@ TaskPadParameters::TaskPadParameters(ViewProviderPad *PadView,bool newObj, QWidg
|
|||
connect(ui->checkBoxUpdateView, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onUpdateView(bool)));
|
||||
|
||||
// Due to signals attached after changes took took into effect we should update the UI now.
|
||||
updateUI(index);
|
||||
|
||||
// if it is a newly created object use the last value of the history
|
||||
if(newObj){
|
||||
ui->lengthEdit->setToLastUsedValue();
|
||||
ui->lengthEdit->selectNumber();
|
||||
ui->lengthEdit2->setToLastUsedValue();
|
||||
ui->lengthEdit2->selectNumber();
|
||||
ui->offsetEdit->setToLastUsedValue();
|
||||
ui->offsetEdit->selectNumber();
|
||||
}
|
||||
}
|
||||
|
||||
void TaskPadParameters::updateUI(int index)
|
||||
{
|
||||
// disable/hide evrything unless we are sure we don't need it
|
||||
bool isLengthEditVisable = false;
|
||||
bool isLengthEdit2Visable = false;
|
||||
bool isOffsetEditVisable = false;
|
||||
bool isMidplateEnabled = false;
|
||||
bool isReversedEnabled = false;
|
||||
bool isFaceEditEnabled = false;
|
||||
|
||||
if (index == 0) { // dimension
|
||||
ui->lengthEdit->setVisible(true);
|
||||
ui->lengthEdit->setEnabled(true);
|
||||
isLengthEditVisable = true;
|
||||
ui->lengthEdit->selectNumber();
|
||||
ui->labelLength->setVisible(true);
|
||||
ui->spinOffset->setVisible(false);
|
||||
ui->spinOffset->setEnabled(false);
|
||||
ui->labelOffset->setVisible(false);
|
||||
// Make sure that the spin box has the focus to get key events
|
||||
// Calling setFocus() directly doesn't work because the spin box is not
|
||||
// yet visible.
|
||||
QMetaObject::invokeMethod(ui->lengthEdit, "setFocus", Qt::QueuedConnection);
|
||||
ui->checkBoxMidplane->setEnabled(true);
|
||||
isMidplateEnabled = true;
|
||||
// Reverse only makes sense if Midplane is not true
|
||||
ui->checkBoxReversed->setEnabled(!ui->checkBoxMidplane->isChecked());
|
||||
ui->labelLength2->setVisible(false);
|
||||
ui->lengthEdit2->setVisible(false);
|
||||
ui->lengthEdit2->setEnabled(false);
|
||||
ui->buttonFace->setEnabled(false);
|
||||
ui->lineFaceName->setEnabled(false);
|
||||
onButtonFace(false);
|
||||
isReversedEnabled = !ui->checkBoxMidplane->isChecked();
|
||||
} else if (index == 1 || index == 2) { // up to first/last
|
||||
ui->lengthEdit->setVisible(false);
|
||||
ui->lengthEdit->setEnabled(false);
|
||||
ui->labelLength->setVisible(false);
|
||||
ui->spinOffset->setVisible(true);
|
||||
ui->spinOffset->setEnabled(true);
|
||||
ui->labelOffset->setVisible(true);
|
||||
ui->checkBoxMidplane->setEnabled(false);
|
||||
ui->checkBoxReversed->setEnabled(true);
|
||||
ui->labelLength2->setVisible(false);
|
||||
ui->lengthEdit2->setVisible(false);
|
||||
ui->lengthEdit2->setEnabled(false);
|
||||
ui->buttonFace->setEnabled(false);
|
||||
ui->lineFaceName->setEnabled(false);
|
||||
onButtonFace(false);
|
||||
isOffsetEditVisable = true;
|
||||
isReversedEnabled = true;
|
||||
} else if (index == 3) { // up to face
|
||||
ui->lengthEdit->setVisible(false);
|
||||
ui->lengthEdit->setEnabled(false);
|
||||
ui->labelLength->setVisible(false);
|
||||
ui->spinOffset->setVisible(true);
|
||||
ui->spinOffset->setEnabled(true);
|
||||
ui->labelOffset->setVisible(true);
|
||||
ui->checkBoxMidplane->setEnabled(false);
|
||||
ui->checkBoxReversed->setEnabled(false);
|
||||
ui->labelLength2->setVisible(false);
|
||||
ui->lengthEdit2->setVisible(false);
|
||||
ui->lengthEdit2->setEnabled(false);
|
||||
ui->buttonFace->setEnabled(true);
|
||||
ui->lineFaceName->setEnabled(true);
|
||||
isOffsetEditVisable = true;
|
||||
isFaceEditEnabled = true;
|
||||
QMetaObject::invokeMethod(ui->lineFaceName, "setFocus", Qt::QueuedConnection);
|
||||
// Go into reference selection mode if no face has been selected yet
|
||||
if (ui->lineFaceName->text().isEmpty() || (ui->lineFaceName->text() == tr("No face selected")))
|
||||
onButtonFace(true);
|
||||
} else { // two dimensions
|
||||
ui->lengthEdit->setEnabled(true);
|
||||
ui->lengthEdit->setVisible(true);
|
||||
ui->lengthEdit->selectNumber();
|
||||
QMetaObject::invokeMethod(ui->lengthEdit, "setFocus", Qt::QueuedConnection);
|
||||
ui->labelLength->setVisible(true);
|
||||
ui->spinOffset->setVisible(false);
|
||||
ui->spinOffset->setEnabled(false);
|
||||
ui->labelOffset->setVisible(false);
|
||||
ui->checkBoxMidplane->setEnabled(false);
|
||||
ui->checkBoxReversed->setEnabled(false);
|
||||
ui->labelLength2->setVisible(true);
|
||||
ui->lengthEdit2->setVisible(true);
|
||||
ui->lengthEdit2->setEnabled(true);
|
||||
ui->buttonFace->setEnabled(false);
|
||||
ui->lineFaceName->setEnabled(false);
|
||||
isLengthEditVisable = true;
|
||||
isLengthEdit2Visable = true;
|
||||
}
|
||||
|
||||
ui->lengthEdit->setVisible( isLengthEditVisable );
|
||||
ui->lengthEdit->setEnabled( isLengthEditVisable );
|
||||
ui->labelLength->setVisible( isLengthEditVisable );
|
||||
|
||||
ui->offsetEdit->setVisible( isOffsetEditVisable );
|
||||
ui->offsetEdit->setEnabled( isOffsetEditVisable );
|
||||
ui->labelOffset->setVisible( isOffsetEditVisable );
|
||||
|
||||
ui->checkBoxMidplane->setEnabled( isMidplateEnabled );
|
||||
|
||||
ui->checkBoxReversed->setEnabled( isReversedEnabled );
|
||||
|
||||
ui->lengthEdit2->setVisible( isLengthEdit2Visable );
|
||||
ui->lengthEdit2->setEnabled( isLengthEdit2Visable );
|
||||
ui->labelLength2->setVisible( isLengthEdit2Visable );
|
||||
|
||||
ui->buttonFace->setEnabled( isFaceEditEnabled );
|
||||
ui->lineFaceName->setEnabled( isFaceEditEnabled );
|
||||
if (!isFaceEditEnabled) {
|
||||
onButtonFace(false);
|
||||
}
|
||||
}
|
||||
|
@ -230,7 +211,7 @@ void TaskPadParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
|
|||
{
|
||||
if (msg.Type == Gui::SelectionChanges::AddSelection) {
|
||||
QString refText = onAddSelection(msg);
|
||||
if (refText.length() != 0) {
|
||||
if (refText.length() > 0) {
|
||||
ui->lineFaceName->blockSignals(true);
|
||||
ui->lineFaceName->setText(refText);
|
||||
ui->lineFaceName->setProperty("FaceName", QByteArray(msg.pSubName));
|
||||
|
@ -243,11 +224,9 @@ void TaskPadParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
|
|||
ui->lineFaceName->setProperty("FaceName", QByteArray());
|
||||
ui->lineFaceName->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
||||
else if (msg.Type == Gui::SelectionChanges::ClrSelection) {
|
||||
} else if (msg.Type == Gui::SelectionChanges::ClrSelection) {
|
||||
ui->lineFaceName->blockSignals(true);
|
||||
ui->lineFaceName->setText(tr(""));
|
||||
ui->lineFaceName->setText(tr("No face selected"));
|
||||
ui->lineFaceName->setProperty("FaceName", QByteArray());
|
||||
ui->lineFaceName->blockSignals(false);
|
||||
}
|
||||
|
@ -260,21 +239,6 @@ void TaskPadParameters::onLengthChanged(double len)
|
|||
recomputeFeature();
|
||||
}
|
||||
|
||||
void TaskPadParameters::onMidplane(bool on)
|
||||
{
|
||||
PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(vp->getObject());
|
||||
pcPad->Midplane.setValue(on);
|
||||
ui->checkBoxReversed->setEnabled(!on);
|
||||
recomputeFeature();
|
||||
}
|
||||
|
||||
void TaskPadParameters::onReversed(bool on)
|
||||
{
|
||||
PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(vp->getObject());
|
||||
pcPad->Reversed.setValue(on);
|
||||
recomputeFeature();
|
||||
}
|
||||
|
||||
void TaskPadParameters::onLength2Changed(double len)
|
||||
{
|
||||
PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(vp->getObject());
|
||||
|
@ -289,6 +253,21 @@ void TaskPadParameters::onOffsetChanged(double len)
|
|||
recomputeFeature();
|
||||
}
|
||||
|
||||
void TaskPadParameters::onMidplaneChanged(bool on)
|
||||
{
|
||||
PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(vp->getObject());
|
||||
pcPad->Midplane.setValue(on);
|
||||
ui->checkBoxReversed->setEnabled(!on);
|
||||
recomputeFeature();
|
||||
}
|
||||
|
||||
void TaskPadParameters::onReversedChanged(bool on)
|
||||
{
|
||||
PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(vp->getObject());
|
||||
pcPad->Reversed.setValue(on);
|
||||
recomputeFeature();
|
||||
}
|
||||
|
||||
void TaskPadParameters::onModeChanged(int index)
|
||||
{
|
||||
PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(vp->getObject());
|
||||
|
@ -310,8 +289,7 @@ void TaskPadParameters::onModeChanged(int index)
|
|||
recomputeFeature();
|
||||
}
|
||||
|
||||
void TaskPadParameters::onButtonFace(const bool pressed)
|
||||
{
|
||||
void TaskPadParameters::onButtonFace(const bool pressed) {
|
||||
TaskSketchBasedParameters::onSelectReference(pressed, false, true, false);
|
||||
|
||||
// Update button if onButtonFace() is called explicitly
|
||||
|
@ -328,6 +306,16 @@ double TaskPadParameters::getLength(void) const
|
|||
return ui->lengthEdit->value().getValue();
|
||||
}
|
||||
|
||||
double TaskPadParameters::getLength2(void) const
|
||||
{
|
||||
return ui->lengthEdit2->value().getValue();
|
||||
}
|
||||
|
||||
double TaskPadParameters::getOffset(void) const
|
||||
{
|
||||
return ui->offsetEdit->value().getValue();
|
||||
}
|
||||
|
||||
bool TaskPadParameters::getReversed(void) const
|
||||
{
|
||||
return ui->checkBoxReversed->isChecked();
|
||||
|
@ -338,16 +326,6 @@ bool TaskPadParameters::getMidplane(void) const
|
|||
return ui->checkBoxMidplane->isChecked();
|
||||
}
|
||||
|
||||
double TaskPadParameters::getLength2(void) const
|
||||
{
|
||||
return ui->lengthEdit2->value().getValue();
|
||||
}
|
||||
|
||||
double TaskPadParameters::getOffset(void) const
|
||||
{
|
||||
return ui->spinOffset->value();
|
||||
}
|
||||
|
||||
int TaskPadParameters::getMode(void) const
|
||||
{
|
||||
return ui->changeMode->currentIndex();
|
||||
|
@ -375,7 +353,7 @@ void TaskPadParameters::changeEvent(QEvent *e)
|
|||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->lengthEdit->blockSignals(true);
|
||||
ui->lengthEdit2->blockSignals(true);
|
||||
ui->spinOffset->blockSignals(true);
|
||||
ui->offsetEdit->blockSignals(true);
|
||||
ui->lineFaceName->blockSignals(true);
|
||||
ui->changeMode->blockSignals(true);
|
||||
int index = ui->changeMode->currentIndex();
|
||||
|
@ -400,10 +378,10 @@ void TaskPadParameters::changeEvent(QEvent *e)
|
|||
#endif
|
||||
ui->lineFaceName->setText(ok ?
|
||||
parts[0] + QString::fromAscii(":") + tr("Face") + QString::number(faceId) :
|
||||
QString());
|
||||
tr(""));
|
||||
ui->lengthEdit->blockSignals(false);
|
||||
ui->lengthEdit2->blockSignals(false);
|
||||
ui->spinOffset->blockSignals(false);
|
||||
ui->offsetEdit->blockSignals(false);
|
||||
ui->lineFaceName->blockSignals(false);
|
||||
ui->changeMode->blockSignals(false);
|
||||
}
|
||||
|
@ -411,9 +389,10 @@ void TaskPadParameters::changeEvent(QEvent *e)
|
|||
|
||||
void TaskPadParameters::saveHistory(void)
|
||||
{
|
||||
// save the user values to history
|
||||
// save the user values to history
|
||||
ui->lengthEdit->pushToHistory();
|
||||
ui->lengthEdit2->pushToHistory();
|
||||
ui->offsetEdit->pushToHistory();
|
||||
}
|
||||
|
||||
void TaskPadParameters::apply()
|
||||
|
@ -422,13 +401,9 @@ void TaskPadParameters::apply()
|
|||
const char * cname = name.c_str();
|
||||
|
||||
ui->lengthEdit->apply();
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %i",cname,getReversed()?1:0);
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Midplane = %i",cname,getMidplane()?1:0);
|
||||
|
||||
ui->lengthEdit2->apply();
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Type = %u",cname,getMode());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Type = %u", cname, getMode());
|
||||
QString facename = getFaceName();
|
||||
|
||||
if (!facename.isEmpty()) {
|
||||
|
@ -437,6 +412,8 @@ void TaskPadParameters::apply()
|
|||
} else {
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.UpToFace = None", cname);
|
||||
}
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %i", cname, getReversed()?1:0);
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Midplane = %i", cname, getMidplane()?1:0);
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Offset = %f", name.c_str(), getOffset());
|
||||
}
|
||||
|
||||
|
@ -448,8 +425,8 @@ void TaskPadParameters::apply()
|
|||
TaskDlgPadParameters::TaskDlgPadParameters(ViewProviderPad *PadView,bool newObj)
|
||||
: TaskDlgSketchBasedParameters(PadView)
|
||||
{
|
||||
assert(PadView);
|
||||
parameter = new TaskPadParameters(static_cast<ViewProviderPad*>(PadView));
|
||||
assert(vp);
|
||||
parameter = new TaskPadParameters(static_cast<ViewProviderPad*>(vp));
|
||||
|
||||
Content.push_back(parameter);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace Gui {
|
|||
class ViewProvider;
|
||||
}
|
||||
|
||||
namespace PartDesignGui {
|
||||
namespace PartDesignGui {
|
||||
|
||||
|
||||
class TaskPadParameters : public TaskSketchBasedParameters
|
||||
|
@ -49,32 +49,33 @@ class TaskPadParameters : public TaskSketchBasedParameters
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskPadParameters(ViewProviderPad *PadView,bool newObj=false,QWidget *parent = 0);
|
||||
TaskPadParameters(ViewProviderPad *PadView, QWidget *parent = 0, bool newObj=false);
|
||||
~TaskPadParameters();
|
||||
|
||||
double getOffset(void) const;
|
||||
|
||||
void saveHistory(void);
|
||||
void apply();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onLengthChanged(double);
|
||||
void onMidplane(bool);
|
||||
void onReversed(bool);
|
||||
void onLength2Changed(double);
|
||||
void onOffsetChanged(double);
|
||||
void onModeChanged(int);
|
||||
void onMidplaneChanged(bool);
|
||||
void onReversedChanged(bool);
|
||||
void onButtonFace(const bool pressed = true);
|
||||
void onFaceName(const QString& text);
|
||||
void onModeChanged(int);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
int getMode(void) const;
|
||||
double getLength(void) const;
|
||||
double getLength2(void) const;
|
||||
double getOffset(void) const;
|
||||
bool getReversed(void) const;
|
||||
bool getMidplane(void) const;
|
||||
int getMode(void) const;
|
||||
QString getFaceName(void) const;
|
||||
void onSelectionChanged(const Gui::SelectionChanges& msg);
|
||||
void updateUI(int index);
|
||||
|
@ -100,7 +101,6 @@ public:
|
|||
public:
|
||||
/// is called by the framework if the dialog is accepted (Ok)
|
||||
virtual bool accept();
|
||||
/// is called by the framework if the dialog is rejected (Cancel)
|
||||
|
||||
protected:
|
||||
TaskPadParameters *parameter;
|
||||
|
|
|
@ -48,15 +48,6 @@
|
|||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -71,20 +62,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="spinOffset">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Gui::PrefQuantitySpinBox" name="offsetEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
@ -119,15 +97,6 @@
|
|||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "ui_TaskPocketParameters.h"
|
||||
#include "TaskPocketParameters.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <Gui/Application.h>
|
||||
|
@ -54,7 +53,7 @@ using namespace Gui;
|
|||
|
||||
/* TRANSLATOR PartDesignGui::TaskPocketParameters */
|
||||
|
||||
TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidget *parent)
|
||||
TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidget *parent, bool newObj)
|
||||
: TaskSketchBasedParameters(PocketView, parent, "PartDesign_Pocket",tr("Pocket parameters"))
|
||||
{
|
||||
// we need a separate container widget to add all controls to
|
||||
|
@ -64,10 +63,14 @@ TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidge
|
|||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
// set the history path
|
||||
ui->lengthEdit->setParamGrpPath(QByteArray("User parameter:BaseApp/History/PocketLength"));
|
||||
ui->offsetEdit->setParamGrpPath(QByteArray("User parameter:BaseApp/History/PocketOffset"));
|
||||
|
||||
// Get the feature data
|
||||
PartDesign::Pocket* pcPocket = static_cast<PartDesign::Pocket*>(vp->getObject());
|
||||
double l = pcPocket->Length.getValue();
|
||||
double off = pcPocket->Offset.getValue();
|
||||
Base::Quantity l = pcPocket->Length.getQuantityValue();
|
||||
Base::Quantity off = pcPocket->Offset.getQuantityValue();
|
||||
bool midplane = pcPocket->Midplane.getValue();
|
||||
bool reversed = pcPocket->Reversed.getValue();
|
||||
int index = pcPocket->Type.getValue(); // must extract value here, clear() kills it!
|
||||
|
@ -82,12 +85,8 @@ TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidge
|
|||
}
|
||||
|
||||
// Fill data into dialog elements
|
||||
ui->pocketLength->setMinimum(0);
|
||||
ui->pocketLength->setMaximum(INT_MAX);
|
||||
ui->pocketLength->setValue(l);
|
||||
ui->spinOffset->setMinimum(-INT_MAX);
|
||||
ui->spinOffset->setMaximum(INT_MAX);
|
||||
ui->spinOffset->setValue(off);
|
||||
ui->lengthEdit->setValue(l);
|
||||
ui->offsetEdit->setValue(off);
|
||||
ui->checkBoxMidplane->setChecked(midplane);
|
||||
ui->checkBoxReversed->setChecked(reversed);
|
||||
if ((obj != NULL) && PartDesign::Feature::isDatum(obj))
|
||||
|
@ -106,13 +105,13 @@ TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidge
|
|||
ui->changeMode->setCurrentIndex(index);
|
||||
|
||||
// Bind input fields to properties
|
||||
ui->pocketLength->bind(pcPocket->Length);
|
||||
ui->lengthEdit->bind(pcPocket->Length);
|
||||
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
|
||||
connect(ui->pocketLength, SIGNAL(valueChanged(double)),
|
||||
connect(ui->lengthEdit, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(onLengthChanged(double)));
|
||||
connect(ui->spinOffset, SIGNAL(valueChanged(double)),
|
||||
connect(ui->offsetEdit, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(onOffsetChanged(double)));
|
||||
connect(ui->checkBoxMidplane, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onMidplaneChanged(bool)));
|
||||
|
@ -120,86 +119,82 @@ TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidge
|
|||
this, SLOT(onReversedChanged(bool)));
|
||||
connect(ui->changeMode, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(onModeChanged(int)));
|
||||
connect(ui->buttonFace, SIGNAL(pressed()),
|
||||
connect(ui->buttonFace, SIGNAL(clicked()),
|
||||
this, SLOT(onButtonFace()));
|
||||
connect(ui->lineFaceName, SIGNAL(textEdited(QString)),
|
||||
this, SLOT(onFaceName(QString)));
|
||||
connect(ui->checkBoxUpdateView, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onUpdateView(bool)));
|
||||
|
||||
ui->checkBoxReversed->setVisible(true);
|
||||
|
||||
// Due to signals attached after changes took took into effect we should update the UI now.
|
||||
updateUI(index);
|
||||
|
||||
//// check if the sketch has support
|
||||
//Sketcher::SketchObject *pcSketch;
|
||||
//if (pcPocket->Sketch.getValue()) {
|
||||
// pcSketch = static_cast<Sketcher::SketchObject*>(pcPocket->Sketch.getValue());
|
||||
// if (pcSketch->Support.getValue())
|
||||
// // in case of sketch with support, reverse makes no sense (goes into the part)
|
||||
// ui->checkBoxReversed->setEnabled(0);
|
||||
// else
|
||||
// ui->checkBoxReversed->setChecked(reversed);
|
||||
//}
|
||||
// if it is a newly created object use the last value of the history
|
||||
if(newObj){
|
||||
ui->lengthEdit->setToLastUsedValue();
|
||||
ui->lengthEdit->selectNumber();
|
||||
ui->offsetEdit->setToLastUsedValue();
|
||||
ui->offsetEdit->selectNumber();
|
||||
}
|
||||
}
|
||||
|
||||
void TaskPocketParameters::updateUI(int index)
|
||||
{
|
||||
if (index == 0) { // Only this option requires a numeric value // Dimension
|
||||
ui->pocketLength->setVisible(true);
|
||||
ui->pocketLength->setEnabled(true);
|
||||
ui->pocketLength->selectAll();
|
||||
QMetaObject::invokeMethod(ui->pocketLength, "setFocus", Qt::QueuedConnection);
|
||||
ui->spinOffset->setVisible(false);
|
||||
ui->spinOffset->setEnabled(false);
|
||||
ui->spinOffset->setEnabled(false);
|
||||
ui->checkBoxMidplane->setEnabled(true);
|
||||
// disable/hide evrything unless we are sure we don't need it
|
||||
bool isLengthEditVisable = false;
|
||||
bool isOffsetEditVisable = false;
|
||||
bool isOffsetEditEnabled = true;
|
||||
bool isMidplateEnabled = false;
|
||||
bool isReversedEnabled = false;
|
||||
bool isFaceEditEnabled = false;
|
||||
|
||||
if (index == 0) { // dimension
|
||||
isLengthEditVisable = true;
|
||||
ui->lengthEdit->selectNumber();
|
||||
// Make sure that the spin box has the focus to get key events
|
||||
// Calling setFocus() directly doesn't work because the spin box is not
|
||||
// yet visible.
|
||||
QMetaObject::invokeMethod(ui->lengthEdit, "setFocus", Qt::QueuedConnection);
|
||||
isMidplateEnabled = true;
|
||||
// Reverse only makes sense if Midplane is not true
|
||||
ui->checkBoxReversed->setEnabled(!ui->checkBoxMidplane->isChecked()); // Will flip direction of dimension
|
||||
ui->buttonFace->setEnabled(false);
|
||||
ui->lineFaceName->setEnabled(false);
|
||||
onButtonFace(false);
|
||||
} else if (index == 1) { // Through all
|
||||
ui->checkBoxMidplane->setEnabled(true);
|
||||
ui->checkBoxReversed->setEnabled(!ui->checkBoxMidplane->isChecked()); // Will flip direction of through all
|
||||
ui->pocketLength->setVisible(false);
|
||||
ui->pocketLength->setEnabled(false);
|
||||
ui->spinOffset->setVisible(false);
|
||||
ui->spinOffset->setVisible(false);
|
||||
ui->spinOffset->setEnabled(false);
|
||||
ui->buttonFace->setEnabled(false);
|
||||
ui->lineFaceName->setEnabled(false);
|
||||
onButtonFace(false);
|
||||
} else if (index == 2) { // Neither value nor face required // To First
|
||||
ui->pocketLength->setEnabled(false);
|
||||
ui->pocketLength->setVisible(false);
|
||||
ui->checkBoxMidplane->setEnabled(false); // Can't have a midplane to a single face
|
||||
ui->checkBoxReversed->setEnabled(false); // Will change the direction it seeks for its first face?
|
||||
// Doesnt work so is currently disabled. Fix probably lies
|
||||
// somwhere in IF block on line 125 of FeaturePocket.cpp
|
||||
ui->labelLength->setVisible(false);
|
||||
ui->spinOffset->setVisible(true);
|
||||
ui->spinOffset->setEnabled(true);
|
||||
ui->labelOffset->setVisible(true);
|
||||
ui->buttonFace->setEnabled(false);
|
||||
ui->lineFaceName->setEnabled(false);
|
||||
onButtonFace(false);
|
||||
} else if (index == 3) { // Only this option requires to select a face // Up to face
|
||||
ui->pocketLength->setEnabled(false);
|
||||
ui->pocketLength->setVisible(false);
|
||||
ui->labelLength->setVisible(false);
|
||||
ui->spinOffset->setVisible(true);
|
||||
ui->spinOffset->setEnabled(true);
|
||||
ui->labelOffset->setVisible(true);
|
||||
ui->checkBoxMidplane->setEnabled(false);
|
||||
ui->checkBoxReversed->setEnabled(false); // No need for reverse since user-chosen face will dtermine direction
|
||||
ui->buttonFace->setEnabled(true);
|
||||
ui->lineFaceName->setEnabled(true);
|
||||
isReversedEnabled = !ui->checkBoxMidplane->isChecked();
|
||||
} else if (index == 1) { // through all
|
||||
isOffsetEditVisable = true;
|
||||
isOffsetEditEnabled = false; // offset may have some meaning for through all but it doesn't work
|
||||
isMidplateEnabled = true;
|
||||
isReversedEnabled = !ui->checkBoxMidplane->isChecked();
|
||||
} else if (index == 2) { // up to first
|
||||
isOffsetEditVisable = true;
|
||||
isReversedEnabled = true; // Will change the direction it seeks for its first face?
|
||||
// It may work not quite as expected but usefull if sketch oriented upside down.
|
||||
// (may happen in bodies)
|
||||
// Fix probably lies somwhere in IF block on line 125 of FeaturePocket.cpp
|
||||
} else if (index == 3) { // up to face
|
||||
isOffsetEditVisable = true;
|
||||
isFaceEditEnabled = true;
|
||||
QMetaObject::invokeMethod(ui->lineFaceName, "setFocus", Qt::QueuedConnection);
|
||||
// Go into reference selection mode if no face has been selected yet
|
||||
if (ui->lineFaceName->text().isEmpty() || (ui->lineFaceName->text() == tr("No face selected")))
|
||||
onButtonFace(true);
|
||||
}
|
||||
|
||||
ui->lengthEdit->setVisible( isLengthEditVisable );
|
||||
ui->lengthEdit->setEnabled( isLengthEditVisable );
|
||||
ui->labelLength->setVisible( isLengthEditVisable );
|
||||
|
||||
ui->offsetEdit->setVisible( isOffsetEditVisable );
|
||||
ui->offsetEdit->setEnabled( isOffsetEditVisable && isOffsetEditEnabled );
|
||||
ui->labelOffset->setVisible( isOffsetEditVisable );
|
||||
|
||||
ui->checkBoxMidplane->setEnabled( isMidplateEnabled );
|
||||
|
||||
ui->checkBoxReversed->setEnabled( isReversedEnabled );
|
||||
|
||||
ui->buttonFace->setEnabled( isFaceEditEnabled );
|
||||
ui->lineFaceName->setEnabled( isFaceEditEnabled );
|
||||
if (!isFaceEditEnabled) {
|
||||
onButtonFace(false);
|
||||
}
|
||||
}
|
||||
|
||||
void TaskPocketParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
|
@ -219,8 +214,7 @@ void TaskPocketParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
|
|||
ui->lineFaceName->setProperty("FaceName", QByteArray());
|
||||
ui->lineFaceName->blockSignals(false);
|
||||
}
|
||||
}
|
||||
else if (msg.Type == Gui::SelectionChanges::ClrSelection) {
|
||||
} else if (msg.Type == Gui::SelectionChanges::ClrSelection) {
|
||||
ui->lineFaceName->blockSignals(true);
|
||||
ui->lineFaceName->setText(tr("No face selected"));
|
||||
ui->lineFaceName->setProperty("FaceName", QByteArray());
|
||||
|
@ -264,11 +258,10 @@ void TaskPocketParameters::onModeChanged(int index)
|
|||
switch (index) {
|
||||
case 0:
|
||||
// Why? See below for "UpToFace"
|
||||
pcPocket->Type.setValue("Length");
|
||||
if (oldLength < Precision::Confusion())
|
||||
oldLength = 5.0;
|
||||
pcPocket->Length.setValue(oldLength);
|
||||
ui->pocketLength->setValue(oldLength);
|
||||
ui->lengthEdit->setValue(oldLength);
|
||||
break;
|
||||
case 1:
|
||||
oldLength = pcPocket->Length.getValue();
|
||||
|
@ -284,10 +277,9 @@ void TaskPocketParameters::onModeChanged(int index)
|
|||
oldLength = pcPocket->Length.getValue();
|
||||
pcPocket->Type.setValue("UpToFace");
|
||||
pcPocket->Length.setValue(0.0);
|
||||
ui->pocketLength->setValue(0.0);
|
||||
ui->lengthEdit->setValue(0.0);
|
||||
break;
|
||||
default:
|
||||
pcPocket->Type.setValue("Length");
|
||||
default: pcPocket->Type.setValue("Length"); break;
|
||||
}
|
||||
|
||||
updateUI(index);
|
||||
|
@ -308,12 +300,12 @@ void TaskPocketParameters::onFaceName(const QString& text)
|
|||
|
||||
double TaskPocketParameters::getLength(void) const
|
||||
{
|
||||
return ui->pocketLength->value().getValue();
|
||||
return ui->lengthEdit->value().getValue();
|
||||
}
|
||||
|
||||
double TaskPocketParameters::getOffset(void) const
|
||||
{
|
||||
return ui->spinOffset->value();
|
||||
return ui->offsetEdit->value().getValue();
|
||||
}
|
||||
|
||||
bool TaskPocketParameters::getReversed(void) const
|
||||
|
@ -321,6 +313,11 @@ bool TaskPocketParameters::getReversed(void) const
|
|||
return ui->checkBoxReversed->isChecked();
|
||||
}
|
||||
|
||||
bool TaskPocketParameters::getMidplane(void) const
|
||||
{
|
||||
return ui->checkBoxMidplane->isChecked();
|
||||
}
|
||||
|
||||
int TaskPocketParameters::getMode(void) const
|
||||
{
|
||||
return ui->changeMode->currentIndex();
|
||||
|
@ -347,8 +344,8 @@ void TaskPocketParameters::changeEvent(QEvent *e)
|
|||
{
|
||||
TaskBox::changeEvent(e);
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->pocketLength->blockSignals(true);
|
||||
ui->spinOffset->blockSignals(true);
|
||||
ui->lengthEdit->blockSignals(true);
|
||||
ui->offsetEdit->blockSignals(true);
|
||||
ui->lineFaceName->blockSignals(true);
|
||||
ui->changeMode->blockSignals(true);
|
||||
int index = ui->changeMode->currentIndex();
|
||||
|
@ -367,31 +364,44 @@ void TaskPocketParameters::changeEvent(QEvent *e)
|
|||
if (upToFace.indexOf("Face") == 0) {
|
||||
faceId = upToFace.remove(0,4).toInt(&ok);
|
||||
}
|
||||
#if QT_VERSION >= 0x040700
|
||||
ui->lineFaceName->setPlaceholderText(tr("No face selected"));
|
||||
#endif
|
||||
ui->lineFaceName->setText(ok ?
|
||||
parts[0] + QString::fromAscii(":") + tr("Face") + QString::number(faceId) :
|
||||
tr("No face selected"));
|
||||
ui->pocketLength->blockSignals(false);
|
||||
ui->spinOffset->blockSignals(false);
|
||||
tr(""));
|
||||
ui->lengthEdit->blockSignals(false);
|
||||
ui->offsetEdit->blockSignals(false);
|
||||
ui->lineFaceName->blockSignals(false);
|
||||
ui->changeMode->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
||||
void TaskPocketParameters::saveHistory(void)
|
||||
{
|
||||
// save the user values to history
|
||||
ui->lengthEdit->pushToHistory();
|
||||
ui->offsetEdit->pushToHistory();
|
||||
}
|
||||
|
||||
void TaskPocketParameters::apply()
|
||||
{
|
||||
std::string name = vp->getObject()->getNameInDocument();
|
||||
const char * cname = name.c_str();
|
||||
|
||||
//Gui::Command::openCommand("Pocket changed");
|
||||
ui->pocketLength->apply();
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Type = %u",name.c_str(),getMode());
|
||||
ui->lengthEdit->apply();
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Type = %u", cname, getMode());
|
||||
QString facename = getFaceName();
|
||||
|
||||
if (!facename.isEmpty()) {
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.UpToFace = %s",
|
||||
name.c_str(), facename.toLatin1().data() );
|
||||
} else
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.UpToFace = None", name.c_str());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %i", name.c_str(), getReversed()?1:0);
|
||||
cname, facename.toLatin1().data());
|
||||
} else {
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.UpToFace = None", cname);
|
||||
}
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %i", cname, getReversed()?1:0);
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Midplane = %i", cname, getMidplane()?1:0);
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Offset = %f", name.c_str(), getOffset());
|
||||
}
|
||||
|
||||
|
@ -420,6 +430,9 @@ bool TaskDlgPocketParameters::accept()
|
|||
{
|
||||
parameter->apply();
|
||||
|
||||
// save the history
|
||||
parameter->saveHistory();
|
||||
|
||||
return TaskDlgSketchBasedParameters::accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef GUI_TASKVIEW_TaskPocketParameters_H
|
||||
#define GUI_TASKVIEW_TaskPocketParameters_H
|
||||
|
@ -41,8 +41,7 @@ namespace Gui {
|
|||
class ViewProvider;
|
||||
}
|
||||
|
||||
namespace PartDesignGui {
|
||||
|
||||
namespace PartDesignGui {
|
||||
|
||||
|
||||
class TaskPocketParameters : public TaskSketchBasedParameters
|
||||
|
@ -50,29 +49,31 @@ class TaskPocketParameters : public TaskSketchBasedParameters
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskPocketParameters(ViewProviderPocket *PocketView,QWidget *parent = 0);
|
||||
TaskPocketParameters(ViewProviderPocket *PocketView, QWidget *parent = 0, bool newObj=false);
|
||||
~TaskPocketParameters();
|
||||
|
||||
void apply();
|
||||
|
||||
void saveHistory(void);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onLengthChanged(double);
|
||||
void onOffsetChanged(double);
|
||||
void onMidplaneChanged(bool);
|
||||
void onReversedChanged(bool);
|
||||
void onModeChanged(int);
|
||||
void onButtonFace(const bool pressed = true);
|
||||
void onFaceName(const QString& text);
|
||||
void onModeChanged(int);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
double getLength(void) const;
|
||||
bool getMidplane(void) const;
|
||||
int getMode(void) const;
|
||||
double getOffset(void) const;
|
||||
bool getReversed(void) const;
|
||||
int getMode(void) const;
|
||||
bool getMidplane(void) const;
|
||||
bool getReversed(void) const;
|
||||
QString getFaceName(void) const;
|
||||
|
||||
void onSelectionChanged(const Gui::SelectionChanges& msg);
|
||||
|
|
|
@ -10,18 +10,6 @@
|
|||
<height>233</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>233</width>
|
||||
<height>134</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
|
@ -56,10 +44,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::QuantitySpinBox" name="pocketLength">
|
||||
<property name="unit" stdset="0">
|
||||
<string notr="true">mm</string>
|
||||
</property>
|
||||
<widget class="Gui::PrefQuantitySpinBox" name="lengthEdit">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
|
@ -68,7 +53,7 @@
|
|||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelOffset">
|
||||
<property name="text">
|
||||
|
@ -77,11 +62,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="spinOffset">
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Gui::PrefQuantitySpinBox" name="offsetEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
@ -97,9 +78,6 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxReversed">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reversed</string>
|
||||
</property>
|
||||
|
@ -138,13 +116,13 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::QuantitySpinBox</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>Gui/QuantitySpinBox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::PrefQuantitySpinBox</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
Loading…
Reference in New Issue
Block a user