Gui: [skip ci] bind spin boxes to object in Placement dialog

This commit is contained in:
wmayer
2020-03-27 17:08:08 +01:00
parent f501198832
commit 5c4ddf42ee
3 changed files with 23 additions and 0 deletions

View File

@@ -635,6 +635,21 @@ void Placement::on_resetButton_clicked()
onPlacementChanged(0);
}
void Placement::bindObject()
{
if (!selectionObjects.empty()) {
App::DocumentObject* obj = selectionObjects.front().getObject();
ui->xPos->bind(App::ObjectIdentifier::parse(obj, propertyName + std::string(".Base.x")));
ui->yPos->bind(App::ObjectIdentifier::parse(obj, propertyName + std::string(".Base.y")));
ui->zPos->bind(App::ObjectIdentifier::parse(obj, propertyName + std::string(".Base.z")));
ui->yawAngle ->bind(App::ObjectIdentifier::parse(obj, propertyName + std::string(".Rotation.Yaw")));
ui->pitchAngle->bind(App::ObjectIdentifier::parse(obj, propertyName + std::string(".Rotation.Pitch")));
ui->rollAngle ->bind(App::ObjectIdentifier::parse(obj, propertyName + std::string(".Rotation.Roll")));
}
}
void Placement::directionActivated(int index)
{
if (ui->directionActivated(this, index)) {
@@ -840,6 +855,11 @@ TaskPlacement::~TaskPlacement()
// automatically deleted in the sub-class
}
void TaskPlacement::bindObject()
{
widget->bindObject();
}
void TaskPlacement::open()
{
widget->open();