[TD]Preferences: reorganize and add missing

This commit is contained in:
wandererfan
2020-01-24 23:25:29 -05:00
committed by WandererFan
parent 53f4c8581b
commit 79d5d35eb1
25 changed files with 3839 additions and 1257 deletions

View File

@@ -81,8 +81,8 @@ DrawView::DrawView(void):
ADD_PROPERTY_TYPE(Rotation, (0.0), group, App::Prop_None, "Rotation in degrees counterclockwise");
ScaleType.setEnums(ScaleTypeEnums);
ADD_PROPERTY_TYPE(ScaleType, ((long)0), group, App::Prop_None, "Scale Type");
ADD_PROPERTY_TYPE(Scale, (1.0), group, App::Prop_None, "Scale factor of the view");
ADD_PROPERTY_TYPE(ScaleType, (prefScaleType()), group, App::Prop_None, "Scale Type");
ADD_PROPERTY_TYPE(Scale, (prefScale()), group, App::Prop_None, "Scale factor of the view");
Scale.setConstraints(&scaleRange);
ADD_PROPERTY_TYPE(Caption, (""), group, App::Prop_None, "Short text about the view");
@@ -429,6 +429,23 @@ bool DrawView::keepUpdated(void)
return result;
}
int DrawView::prefScaleType(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
int result = hGrp->GetInt("DefaultScaleType", 0);
return result;
}
double DrawView::prefScale(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
double result = hGrp->GetInt("DefaultViewScale", 1.0);
return result;
}
void DrawView::requestPaint(void)
{
// Base::Console().Message("DV::requestPaint() - %s\n", getNameInDocument());