[TD]Fix RichText parent in scene (fix #18283) (#18768)

* [TD]allow DrawViewAnno to be attached to another view

* [TD]allow image and spreadsheet attach to view

* [TD]ensure correct parent in scene

* [TD]refactor command helpers to separate file

- gathering the helpers in one place
- helper redundancy to be address in another change

* [TD]create symbol, spreadsheet, image with parent

* [TD]fix claimChildren for some views

- also includes many lint fixes
This commit is contained in:
WandererFan
2025-01-06 12:11:25 -05:00
committed by GitHub
parent f4b1ccdc54
commit 91d7c875a5
25 changed files with 698 additions and 272 deletions

View File

@@ -24,8 +24,6 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <iomanip>
# include <sstream>
#endif
#include "DrawViewAnnotation.h"
@@ -62,6 +60,9 @@ DrawViewAnnotation::DrawViewAnnotation()
TextStyle.setEnums(TextStyleEnums);
ADD_PROPERTY_TYPE(TextStyle, ((long)0), vgroup, App::Prop_None, "Text style");
ADD_PROPERTY_TYPE(Owner, (nullptr), vgroup, (App::PropertyType)(App::Prop_None),
"Feature to which this annotation is attached, if any");
Scale.setStatus(App::Property::Hidden, true);
ScaleType.setStatus(App::Property::Hidden, true);
}
@@ -82,6 +83,20 @@ void DrawViewAnnotation::onChanged(const App::Property* prop)
TechDraw::DrawView::onChanged(prop);
}
short DrawViewAnnotation::mustExecute() const
{
if (!isRestoring()) {
if (Text.isTouched() ||
Owner.isTouched()) {
return 1;
}
}
return DrawView::mustExecute();
}
void DrawViewAnnotation::handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property *prop)
// transforms properties that had been changed
{