Fix enum values for first/third angle preference
This commit is contained in:
parent
ac0963c561
commit
a01e774405
|
@ -59,30 +59,33 @@ using namespace std;
|
||||||
|
|
||||||
PROPERTY_SOURCE(TechDraw::DrawPage, App::DocumentObject)
|
PROPERTY_SOURCE(TechDraw::DrawPage, App::DocumentObject)
|
||||||
|
|
||||||
const char* DrawPage::ProjectionTypeEnums[]= {"First Angle",
|
const char* DrawPage::ProjectionTypeEnums[] = { "First Angle",
|
||||||
"Third Angle",
|
"Third Angle",
|
||||||
NULL};
|
NULL };
|
||||||
|
|
||||||
DrawPage::DrawPage(void)
|
DrawPage::DrawPage(void)
|
||||||
{
|
{
|
||||||
static const char *group = "Page";
|
static const char *group = "Page";
|
||||||
|
|
||||||
ADD_PROPERTY_TYPE(Template, (0), group, (App::PropertyType)(App::Prop_None), "Attached Template");
|
ADD_PROPERTY_TYPE(Template, (0), group, (App::PropertyType)(App::Prop_None), "Attached Template");
|
||||||
ADD_PROPERTY_TYPE(Views, (0), group, (App::PropertyType)(App::Prop_None),"Attached Views");
|
ADD_PROPERTY_TYPE(Views, (0), group, (App::PropertyType)(App::Prop_None), "Attached Views");
|
||||||
|
|
||||||
// Projection Properties
|
// Projection Properties
|
||||||
ProjectionType.setEnums(ProjectionTypeEnums);
|
ProjectionType.setEnums(ProjectionTypeEnums);
|
||||||
//ADD_PROPERTY(ProjectionType, ((long)0));
|
|
||||||
Base::Reference<ParameterGrp> hGrp =
|
Base::Reference<ParameterGrp> hGrp =
|
||||||
App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw");
|
App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw");
|
||||||
int projType = hGrp->GetInt("ProjectionAngle", 0x01); //in prefs, 1 -> FirstAngle 2 -> ThirdAngle
|
|
||||||
if (projType == 2) {
|
// In preferences, 0 -> First Angle 1 -> Third Angle
|
||||||
ADD_PROPERTY(ProjectionType, ((long)1));
|
int projType = hGrp->GetInt("ProjectionAngle", -1);
|
||||||
|
|
||||||
|
if (projType == -1) {
|
||||||
|
ADD_PROPERTY(ProjectionType, ((long)0)); // Default to first angle
|
||||||
} else {
|
} else {
|
||||||
ADD_PROPERTY(ProjectionType, ((long)0));
|
ADD_PROPERTY(ProjectionType, ((long)projType));
|
||||||
}
|
}
|
||||||
|
|
||||||
ADD_PROPERTY_TYPE(Scale ,(1.0), group, App::Prop_None, "Scale factor for this Page");
|
ADD_PROPERTY_TYPE(Scale, (1.0), group, App::Prop_None, "Scale factor for this Page");
|
||||||
//TODO: Page should create itself with default Template instead of Cmd figuring it out?
|
//TODO: Page should create itself with default Template instead of Cmd figuring it out?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user