Fix propagation of Source property to children

This commit is contained in:
wandererfan
2018-08-14 22:12:36 -04:00
committed by wmayer
parent 1b1eaa5def
commit 0432ecdb88
2 changed files with 22 additions and 0 deletions

View File

@@ -116,6 +116,9 @@ void DrawProjGroup::onChanged(const App::Property* prop)
if (prop == &Scale) {
updateChildren();
}
if (prop == &Source) {
updateChildrenSource();
}
if (prop == &ScaleType) {
double newScale = getScale();
@@ -723,6 +726,24 @@ void DrawProjGroup::updateChildren(void)
}
}
//void DrawProjGroup::updateChildren(const App::Property* prop)
//{
// view->....setValue(s)(prop->getValue(s));
//}
/*!
* tell children DPGIs that parent DPG has changed Source
*/
void DrawProjGroup::updateChildrenSource(void)
{
for( const auto it : Views.getValues() ) {
auto view( dynamic_cast<DrawProjGroupItem *>(it) );
if( view ) {
view->Source.setValues(Source.getValues());
}
}
}
/*!
* check if ProjectionGroup fits on Page
*/

View File

@@ -165,6 +165,7 @@ protected:
/// Returns pointer to our page, or NULL if it couldn't be located
TechDraw::DrawPage * getPage(void) const;
void updateChildren(void);
void updateChildrenSource(void);
void setPropsFromCube(void);
void setCubeFromProps(void);
int getViewIndex(const char *viewTypeCStr) const;