[TD] add dialog to modify some dimension settings
also fix issue that tolerance could be set despite theoretically exact is true under some circumstances also some wording improvements also a minor fix to use 0.0 instead of DBL_MIN
This commit is contained in:
@@ -38,12 +38,13 @@
|
||||
#include <App/Document.h>
|
||||
#include <App/DocumentObject.h>
|
||||
#include <App/Material.h>
|
||||
#include <Gui/Control.h>
|
||||
|
||||
#include <Mod/TechDraw/App/LineGroup.h>
|
||||
#include <Mod/TechDraw/App/LandmarkDimension.h>
|
||||
//#include <Mod/TechDraw/App/Preferences.h>
|
||||
|
||||
#include "PreferencesGui.h"
|
||||
#include "TaskDimension.h"
|
||||
#include "QGIViewDimension.h"
|
||||
#include "ViewProviderDimension.h"
|
||||
|
||||
@@ -74,16 +75,16 @@ ViewProviderDimension::ViewProviderDimension()
|
||||
"Dimension text size in units");
|
||||
ADD_PROPERTY_TYPE(LineWidth, (prefWeight()), group, (App::PropertyType)(App::Prop_None),
|
||||
"Dimension line width");
|
||||
ADD_PROPERTY_TYPE(Color,(prefColor()),group,App::Prop_None,"The color of the Dimension");
|
||||
ADD_PROPERTY_TYPE(Color, (prefColor()), group, App::Prop_None, "Color of the dimension");
|
||||
ADD_PROPERTY_TYPE(StandardAndStyle, (prefStandardAndStyle()), group, App::Prop_None,
|
||||
"Specifies the standard according to which this dimension is drawn");
|
||||
"Standard and style according to which dimension is drawn");
|
||||
StandardAndStyle.setEnums(StandardAndStyleEnums);
|
||||
|
||||
ADD_PROPERTY_TYPE(RenderingExtent, (REND_EXTENT_NORMAL), group, App::Prop_None,
|
||||
ADD_PROPERTY_TYPE(RenderingExtent, (REND_EXTENT_NORMAL), group, App::Prop_None,
|
||||
"Select the rendering mode by space requirements");
|
||||
RenderingExtent.setEnums(RenderingExtentEnums);
|
||||
ADD_PROPERTY_TYPE(FlipArrowheads, (false), group, App::Prop_None,
|
||||
"Reverses the usual direction of dimension line terminators");
|
||||
"Reverses usual direction of dimension line terminators");
|
||||
}
|
||||
|
||||
ViewProviderDimension::~ViewProviderDimension()
|
||||
@@ -114,6 +115,42 @@ std::vector<std::string> ViewProviderDimension::getDisplayModes(void) const
|
||||
return StrList;
|
||||
}
|
||||
|
||||
bool ViewProviderDimension::setEdit(int ModNum)
|
||||
{
|
||||
if (ModNum == ViewProvider::Default) {
|
||||
if (Gui::Control().activeDialog()) { // if TaskPanel already open
|
||||
return false;
|
||||
}
|
||||
// clear the selection (convenience)
|
||||
Gui::Selection().clearSelection();
|
||||
auto qgivDimension(dynamic_cast<QGIViewDimension*>(getQView()));
|
||||
if (qgivDimension) {
|
||||
Gui::Control().showDialog(new TaskDlgDimension(qgivDimension, this));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return ViewProviderDrawingView::setEdit(ModNum);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ViewProviderDimension::unsetEdit(int ModNum)
|
||||
{
|
||||
if (ModNum == ViewProvider::Default) {
|
||||
Gui::Control().closeDialog();
|
||||
}
|
||||
else {
|
||||
ViewProviderDrawingView::unsetEdit(ModNum);
|
||||
}
|
||||
}
|
||||
|
||||
bool ViewProviderDimension::doubleClicked(void)
|
||||
{
|
||||
setEdit(ViewProvider::Default);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ViewProviderDimension::updateData(const App::Property* p)
|
||||
{
|
||||
if (p == &(getViewObject()->Type)) {
|
||||
|
||||
Reference in New Issue
Block a user