Rename "Document" selection value to "Page"
This commit is contained in:
committed by
Yorik van Havre
parent
68c3f460d7
commit
b3c3d7a950
@@ -113,7 +113,7 @@ void DrawPage::onChanged(const App::Property* prop)
|
||||
const std::vector<App::DocumentObject*> &vals = Views.getValues();
|
||||
for(std::vector<App::DocumentObject *>::const_iterator it = vals.begin(); it < vals.end(); ++it) {
|
||||
TechDraw::DrawView *view = dynamic_cast<TechDraw::DrawView *>(*it);
|
||||
if (view != NULL && view->ScaleType.isValue("Document")) {
|
||||
if (view != NULL && view->ScaleType.isValue("Page")) {
|
||||
view->Scale.touch();
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ void DrawPage::onChanged(const App::Property* prop)
|
||||
const std::vector<App::DocumentObject*> &vals = Views.getValues();
|
||||
for(std::vector<App::DocumentObject *>::const_iterator it = vals.begin(); it < vals.end(); ++it) {
|
||||
TechDraw::DrawProjGroup *view = dynamic_cast<TechDraw::DrawProjGroup *>(*it);
|
||||
if (view != NULL && view->ProjectionType.isValue("Document")) {
|
||||
if (view != NULL && view->ProjectionType.isValue("Default")) {
|
||||
view->ProjectionType.touch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
using namespace TechDraw;
|
||||
|
||||
const char* DrawProjGroup::ProjectionTypeEnums[] = {"Document",
|
||||
const char* DrawProjGroup::ProjectionTypeEnums[] = {"Default",
|
||||
"First Angle",
|
||||
"Third Angle",
|
||||
NULL};
|
||||
@@ -397,7 +397,7 @@ void DrawProjGroup::arrangeViewPointers(DrawProjGroupItem *viewPtrs[10]) const
|
||||
|
||||
// Determine layout - should be either "First Angle" or "Third Angle"
|
||||
const char* projType;
|
||||
if (ProjectionType.isValue("Document")) {
|
||||
if (ProjectionType.isValue("Default")) {
|
||||
projType = findParentPage()->ProjectionType.getValueAsString();
|
||||
} else {
|
||||
projType = ProjectionType.getValueAsString();
|
||||
@@ -604,7 +604,7 @@ App::DocumentObjectExecReturn *DrawProjGroup::execute(void)
|
||||
Scale.setValue(newScale);
|
||||
}
|
||||
}
|
||||
} else if (ScaleType.isValue("Document")) {
|
||||
} else if (ScaleType.isValue("Page")) {
|
||||
newScale = page->Scale.getValue();
|
||||
if(std::abs(Scale.getValue() - newScale) > FLT_EPSILON) {
|
||||
resetPositions();
|
||||
@@ -631,8 +631,8 @@ void DrawProjGroup::updateChildren(double scale)
|
||||
if (ScaleType.isValue("Automatic")) {
|
||||
view->ScaleType.setValue("Custom");
|
||||
view->Scale.setStatus(App::Property::ReadOnly,true);
|
||||
} else if (ScaleType.isValue("Document")) {
|
||||
view->ScaleType.setValue("Document");
|
||||
} else if (ScaleType.isValue("Page")) {
|
||||
view->ScaleType.setValue("Page");
|
||||
view->Scale.setStatus(App::Property::ReadOnly,true);
|
||||
} else if (ScaleType.isValue("Custom")) {
|
||||
view->ScaleType.setValue("Custom");
|
||||
@@ -677,7 +677,7 @@ App::Enumeration DrawProjGroup::usedProjectionType(void)
|
||||
{
|
||||
//TODO: Would've been nice to have an Enumeration(const PropertyEnumeration &) constructor
|
||||
App::Enumeration ret(ProjectionTypeEnums, ProjectionType.getValueAsString());
|
||||
if (ret.isValue("Document")) {
|
||||
if (ret.isValue("Default")) {
|
||||
TechDraw::DrawPage * page = getPage();
|
||||
if ( page != NULL ) {
|
||||
ret.setValue(page->ProjectionType.getValueAsString());
|
||||
|
||||
@@ -53,7 +53,7 @@ using namespace TechDraw;
|
||||
// DrawView
|
||||
//===========================================================================
|
||||
|
||||
const char* DrawView::ScaleTypeEnums[]= {"Document",
|
||||
const char* DrawView::ScaleTypeEnums[]= {"Page",
|
||||
"Automatic",
|
||||
"Custom",
|
||||
NULL};
|
||||
@@ -88,7 +88,7 @@ App::DocumentObjectExecReturn *DrawView::execute(void)
|
||||
{
|
||||
TechDraw::DrawPage *page = findParentPage();
|
||||
if(page) {
|
||||
if (ScaleType.isValue("Document")) {
|
||||
if (ScaleType.isValue("Page")) {
|
||||
if(std::abs(page->Scale.getValue() - Scale.getValue()) > FLT_EPSILON) {
|
||||
Scale.setValue(page->Scale.getValue());
|
||||
}
|
||||
@@ -117,7 +117,7 @@ void DrawView::onChanged(const App::Property* prop)
|
||||
if (!isRestoring()) {
|
||||
//Base::Console().Message("TRACE - DV::onChanged(%s) - %s\n",prop->getName(),Label.getValue());
|
||||
if (prop == &ScaleType) {
|
||||
if (ScaleType.isValue("Document")) {
|
||||
if (ScaleType.isValue("Page")) {
|
||||
Scale.setStatus(App::Property::ReadOnly,true);
|
||||
App::GetApplication().signalChangePropertyEditor(Scale);
|
||||
} else if ( ScaleType.isValue("Custom") ) {
|
||||
|
||||
@@ -168,7 +168,7 @@ void DrawViewCollection::onChanged(const App::Property* prop)
|
||||
|
||||
App::DocumentObjectExecReturn *DrawViewCollection::execute(void)
|
||||
{
|
||||
if (ScaleType.isValue("Document")) {
|
||||
if (ScaleType.isValue("Page")) {
|
||||
const std::vector<App::DocumentObject *> &views = Views.getValues();
|
||||
for(std::vector<App::DocumentObject *>::const_iterator it = views.begin(); it != views.end(); ++it) {
|
||||
App::DocumentObject *docObj = *it;
|
||||
@@ -176,7 +176,7 @@ App::DocumentObjectExecReturn *DrawViewCollection::execute(void)
|
||||
TechDraw::DrawView *view = static_cast<TechDraw::DrawView *>(*it);
|
||||
|
||||
// Set scale factor of each view
|
||||
view->ScaleType.setValue("Document");
|
||||
view->ScaleType.setValue("Page");
|
||||
view->touch();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user