Skip to content

Commit

Permalink
[TD]fix #4234 initial display of section label
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Dec 29, 2019
1 parent eb4e2d2 commit 4cca918
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Mod/TechDraw/App/DrawViewSection.cpp
Expand Up @@ -116,7 +116,7 @@ DrawViewSection::DrawViewSection()
static const char *sgroup = "Section";
static const char *fgroup = "Cut Surface Format";

ADD_PROPERTY_TYPE(SectionSymbol ,("A"),sgroup,App::Prop_None,"The identifier for this section");
ADD_PROPERTY_TYPE(SectionSymbol ,(""),sgroup,App::Prop_None,"The identifier for this section");
ADD_PROPERTY_TYPE(BaseView ,(0),sgroup,App::Prop_None,"2D View source for this Section");
BaseView.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(SectionNormal ,(0,0,1.0) ,sgroup,App::Prop_None,"Section Plane normal direction"); //direction of extrusion of cutting prism
Expand Down Expand Up @@ -162,6 +162,7 @@ short DrawViewSection::mustExecute() const

void DrawViewSection::onChanged(const App::Property* prop)
{
// Base::Console().Message("DVS::onChanged(%s) - restoring: %d\n", prop->getName(), isRestoring());
if (!isRestoring()) {
if (prop == &SectionSymbol) {
std::string lblText = "Section " +
Expand Down Expand Up @@ -207,7 +208,7 @@ void DrawViewSection::onChanged(const App::Property* prop)

App::DocumentObjectExecReturn *DrawViewSection::execute(void)
{
// Base::Console().Message("DVS::execute() - %s \n", getNameInDocument());
// Base::Console().Message("DVS::execute() - %s/%s \n", getNameInDocument(), Label.getValue());
if (!keepUpdated()) {
return App::DocumentObject::StdReturn;
}
Expand Down
7 changes: 7 additions & 0 deletions src/Mod/TechDraw/Gui/TaskSectionView.cpp
Expand Up @@ -392,6 +392,13 @@ void TaskSectionView::updateSectionView(void)
Command::doCommand(Command::Doc,"App.activeDocument().%s.SectionSymbol = '%s'",
sectionName.c_str(),
temp.c_str());
std::string lblText = "Section " +
temp +
" - " +
temp;
Command::doCommand(Command::Doc,"App.activeDocument().%s.Label = '%s'",
sectionName.c_str(),
lblText.c_str());
Command::doCommand(Command::Doc,"App.activeDocument().%s.Scale = %0.6f",
sectionName.c_str(),
ui->sbScale->value());
Expand Down

0 comments on commit 4cca918

Please sign in to comment.