[TD]add light text on dark page mode
- some visually impaired users need white graphics on dark page. - revise Annotation dialog to respect dark style
This commit is contained in:
@@ -25,14 +25,14 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
# include <QAction>
|
||||
# include <QList>
|
||||
# include <QMenu>
|
||||
# include <QMessageBox>
|
||||
# include <QPointer>
|
||||
# include <QTextStream>
|
||||
# include <boost_signals2.hpp>
|
||||
# include <boost/signals2/connection.hpp>
|
||||
#include <QAction>
|
||||
#include <QList>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QPointer>
|
||||
#include <QTextStream>
|
||||
#include <boost/signals2/connection.hpp>
|
||||
#include <boost_signals2.hpp>
|
||||
#endif
|
||||
|
||||
#include <App/Document.h>
|
||||
@@ -44,14 +44,15 @@
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/ViewProviderDocumentObject.h>
|
||||
|
||||
#include <Mod/TechDraw/App/DrawPage.h>
|
||||
#include <Mod/TechDraw/App/DrawView.h>
|
||||
#include <Mod/TechDraw/App/DrawProjGroupItem.h>
|
||||
#include <Mod/TechDraw/App/DrawViewDimension.h>
|
||||
#include <Mod/TechDraw/App/DrawViewBalloon.h>
|
||||
#include <Mod/TechDraw/App/DrawLeaderLine.h>
|
||||
#include <Mod/TechDraw/App/DrawRichAnno.h>
|
||||
#include <Mod/TechDraw/App/DrawHatch.h>
|
||||
#include <Mod/TechDraw/App/DrawLeaderLine.h>
|
||||
#include <Mod/TechDraw/App/DrawPage.h>
|
||||
#include <Mod/TechDraw/App/DrawProjGroupItem.h>
|
||||
#include <Mod/TechDraw/App/DrawRichAnno.h>
|
||||
#include <Mod/TechDraw/App/DrawTemplate.h>
|
||||
#include <Mod/TechDraw/App/DrawView.h>
|
||||
#include <Mod/TechDraw/App/DrawViewBalloon.h>
|
||||
#include <Mod/TechDraw/App/DrawViewDimension.h>
|
||||
#include <Mod/TechDraw/App/DrawWeldSymbol.h>
|
||||
|
||||
#include "MDIViewPage.h"
|
||||
@@ -59,9 +60,9 @@
|
||||
#include "QGITemplate.h"
|
||||
#include "QGSPage.h"
|
||||
#include "QGVPage.h"
|
||||
#include "ViewProviderTemplate.h"
|
||||
#include "ViewProviderPage.h"
|
||||
#include "ViewProviderPageExtension.h"
|
||||
#include "ViewProviderTemplate.h"
|
||||
|
||||
using namespace TechDrawGui;
|
||||
using namespace TechDraw;
|
||||
@@ -77,38 +78,38 @@ PROPERTY_SOURCE(TechDrawGui::ViewProviderPage, Gui::ViewProviderDocumentObject)
|
||||
// Construction/Destruction
|
||||
|
||||
ViewProviderPage::ViewProviderPage()
|
||||
: m_mdiView(nullptr),
|
||||
m_pageName(""),
|
||||
m_graphicsView(nullptr),
|
||||
m_graphicsScene(nullptr)
|
||||
: m_mdiView(nullptr), m_pageName(""), m_graphicsView(nullptr), m_graphicsScene(nullptr)
|
||||
{
|
||||
initExtension(this);
|
||||
|
||||
sPixmap = "TechDraw_TreePage";
|
||||
static const char *group = "Grid";
|
||||
static const char* group = "Grid";
|
||||
|
||||
ADD_PROPERTY_TYPE(ShowFrames ,(true), group, App::Prop_None, "Show or hide View frames and Labels on this Page");
|
||||
ADD_PROPERTY_TYPE(ShowGrid ,(PreferencesGui::showGrid()), group, App::Prop_None, "Show or hide a grid on this Page");
|
||||
ADD_PROPERTY_TYPE(GridSpacing, (PreferencesGui::gridSpacing()), group, (App::PropertyType::Prop_None),
|
||||
"Grid line spacing in mm");
|
||||
ADD_PROPERTY_TYPE(ShowFrames, (true), group, App::Prop_None,
|
||||
"Show or hide View frames and Labels on this Page");
|
||||
ADD_PROPERTY_TYPE(ShowGrid, (PreferencesGui::showGrid()), group, App::Prop_None,
|
||||
"Show or hide a grid on this Page");
|
||||
ADD_PROPERTY_TYPE(GridSpacing, (PreferencesGui::gridSpacing()), group,
|
||||
(App::PropertyType::Prop_None), "Grid line spacing in mm");
|
||||
|
||||
ShowFrames.setStatus(App::Property::Hidden, true);
|
||||
DisplayMode.setStatus(App::Property::Hidden, true);
|
||||
|
||||
m_graphicsScene = new QGSPage(this);
|
||||
m_graphicsScene->setItemIndexMethod(QGraphicsScene::NoIndex); //this prevents crash when deleting dims.
|
||||
//scene(view?) indices of dirty regions gets
|
||||
//out of sync. missing prepareGeometryChange
|
||||
//somewhere???? QTBUG-18021???
|
||||
m_graphicsScene->setItemIndexMethod(
|
||||
QGraphicsScene::NoIndex);//this prevents crash when deleting dims.
|
||||
//scene(view?) indices of dirty regions gets
|
||||
//out of sync. missing prepareGeometryChange
|
||||
//somewhere???? QTBUG-18021???
|
||||
}
|
||||
|
||||
ViewProviderPage::~ViewProviderPage()
|
||||
{
|
||||
removeMDIView(); //if the MDIViewPage is still in MainWindow, remove it.
|
||||
removeMDIView();//if the MDIViewPage is still in MainWindow, remove it.
|
||||
m_graphicsScene->deleteLater();
|
||||
}
|
||||
|
||||
void ViewProviderPage::attach(App::DocumentObject *pcFeat)
|
||||
void ViewProviderPage::attach(App::DocumentObject* pcFeat)
|
||||
{
|
||||
ViewProviderDocumentObject::attach(pcFeat);
|
||||
|
||||
@@ -118,7 +119,8 @@ void ViewProviderPage::attach(App::DocumentObject *pcFeat)
|
||||
connectGuiRepaint = feature->signalGuiPaint.connect(bnd);
|
||||
m_pageName = feature->getNameInDocument();
|
||||
m_graphicsScene->setObjectName(QString::fromLocal8Bit(m_pageName.c_str()));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Base::Console().Log("VPP::attach has no Feature!\n");
|
||||
}
|
||||
}
|
||||
@@ -136,13 +138,15 @@ std::vector<std::string> ViewProviderPage::getDisplayModes() const
|
||||
return StrList;
|
||||
}
|
||||
|
||||
void ViewProviderPage::onChanged(const App::Property *prop)
|
||||
void ViewProviderPage::onChanged(const App::Property* prop)
|
||||
{
|
||||
if (prop == &(ShowGrid)) {
|
||||
setGrid();
|
||||
} else if (prop == &(GridSpacing)) {
|
||||
}
|
||||
else if (prop == &(GridSpacing)) {
|
||||
setGrid();
|
||||
} else if (prop == &Visibility) {
|
||||
}
|
||||
else if (prop == &Visibility) {
|
||||
//Visibility changes are handled in VPDO::onChanged -> show() or hide()
|
||||
}
|
||||
|
||||
@@ -157,25 +161,28 @@ void ViewProviderPage::updateData(const App::Property* prop)
|
||||
return;
|
||||
}
|
||||
if (prop == &(page->KeepUpdated)) {
|
||||
if (getDrawPage()->KeepUpdated.getValue()) {
|
||||
sPixmap = "TechDraw_TreePage";
|
||||
} else {
|
||||
sPixmap = "TechDraw_TreePageUnsync";
|
||||
}
|
||||
signalChangeIcon();
|
||||
//if the template is changed, rebuild the visual
|
||||
} else if (prop == &(page->Template)) {
|
||||
if (!page->isUnsetting()) {
|
||||
//check if a template has been added to scene first?
|
||||
if (getDrawPage()->KeepUpdated.getValue()) {
|
||||
sPixmap = "TechDraw_TreePage";
|
||||
}
|
||||
else {
|
||||
sPixmap = "TechDraw_TreePageUnsync";
|
||||
}
|
||||
signalChangeIcon();
|
||||
//if the template is changed, rebuild the visual
|
||||
}
|
||||
else if (prop == &(page->Template)) {
|
||||
if (!page->isUnsetting()) {
|
||||
//check if a template has been added to scene first?
|
||||
m_graphicsScene->matchSceneRectToTemplate();
|
||||
m_graphicsScene->updateTemplate();
|
||||
}
|
||||
} else if (prop == &(page->Label)) {
|
||||
if (m_mdiView &&
|
||||
!page->isUnsetting()) {
|
||||
m_mdiView->setTabText(page->Label.getValue());
|
||||
}
|
||||
} else if (prop == &page->Views) {
|
||||
}
|
||||
else if (prop == &(page->Label)) {
|
||||
if (m_mdiView && !page->isUnsetting()) {
|
||||
m_mdiView->setTabText(page->Label.getValue());
|
||||
}
|
||||
}
|
||||
else if (prop == &page->Views) {
|
||||
if (!page->isUnsetting())
|
||||
m_graphicsScene->fixOrphans();
|
||||
}
|
||||
@@ -183,7 +190,7 @@ void ViewProviderPage::updateData(const App::Property* prop)
|
||||
Gui::ViewProviderDocumentObject::updateData(prop);
|
||||
}
|
||||
|
||||
bool ViewProviderPage::onDelete(const std::vector<std::string> &)
|
||||
bool ViewProviderPage::onDelete(const std::vector<std::string>&)
|
||||
{
|
||||
// warn the user if the Page is not empty
|
||||
// but don't do this if there is just the template
|
||||
@@ -202,25 +209,26 @@ bool ViewProviderPage::onDelete(const std::vector<std::string> &)
|
||||
isTemplate = false;
|
||||
}
|
||||
|
||||
if (!objs.empty() && !isTemplate)
|
||||
{
|
||||
if (!objs.empty() && !isTemplate) {
|
||||
// generate dialog
|
||||
QString bodyMessage;
|
||||
QTextStream bodyMessageStream(&bodyMessage);
|
||||
bodyMessageStream << qApp->translate("Std_Delete",
|
||||
bodyMessageStream << qApp->translate(
|
||||
"Std_Delete",
|
||||
"The page is not empty, therefore the\nfollowing referencing objects might be lost:");
|
||||
bodyMessageStream << '\n';
|
||||
for (auto ObjIterator : objs)
|
||||
bodyMessageStream << '\n' << QString::fromUtf8(ObjIterator->Label.getValue());
|
||||
bodyMessageStream << "\n\n" << QObject::tr("Are you sure you want to continue?");
|
||||
// show and evaluate the dialog
|
||||
int DialogResult = QMessageBox::warning(Gui::getMainWindow(),
|
||||
qApp->translate("Std_Delete", "Object dependencies"), bodyMessage,
|
||||
int DialogResult = QMessageBox::warning(
|
||||
Gui::getMainWindow(), qApp->translate("Std_Delete", "Object dependencies"), bodyMessage,
|
||||
QMessageBox::Yes, QMessageBox::No);
|
||||
if (DialogResult == QMessageBox::Yes) {
|
||||
removeMDIView();
|
||||
return true;
|
||||
} else
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
@@ -233,24 +241,26 @@ void ViewProviderPage::setupContextMenu(QMenu* menu, QObject* receiver, const ch
|
||||
{
|
||||
Gui::ViewProviderDocumentObject::setupContextMenu(menu, receiver, member);
|
||||
QAction* act = menu->addAction(QObject::tr("Show drawing"), receiver, member);
|
||||
act->setData(QVariant((int) _SHOWDRAWING));
|
||||
act->setData(QVariant((int)_SHOWDRAWING));
|
||||
QAction* act2 = menu->addAction(QObject::tr("Toggle KeepUpdated"), receiver, member);
|
||||
act2->setData(QVariant((int) _TOGGLEUPDATE));
|
||||
act2->setData(QVariant((int)_TOGGLEUPDATE));
|
||||
}
|
||||
|
||||
bool ViewProviderPage::setEdit(int ModNum)
|
||||
{
|
||||
if (ModNum == _SHOWDRAWING) {
|
||||
showMDIViewPage(); // show the drawing
|
||||
return false; //finished editing
|
||||
} else if (ModNum == _TOGGLEUPDATE) {
|
||||
auto page = getDrawPage();
|
||||
if (page) {
|
||||
page->KeepUpdated.setValue(!page->KeepUpdated.getValue());
|
||||
page->recomputeFeature();
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
showMDIViewPage();// show the drawing
|
||||
return false; //finished editing
|
||||
}
|
||||
else if (ModNum == _TOGGLEUPDATE) {
|
||||
auto page = getDrawPage();
|
||||
if (page) {
|
||||
page->KeepUpdated.setValue(!page->KeepUpdated.getValue());
|
||||
page->recomputeFeature();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return Gui::ViewProviderDocumentObject::setEdit(ModNum);
|
||||
}
|
||||
}
|
||||
@@ -279,7 +289,7 @@ void ViewProviderPage::show(void)
|
||||
void ViewProviderPage::hide(void)
|
||||
{
|
||||
if (getMDIView()) {
|
||||
getMDIView()->hide(); //this doesn't remove the mdiViewPage from the mainWindow
|
||||
getMDIView()->hide();//this doesn't remove the mdiViewPage from the mainWindow
|
||||
removeMDIView();
|
||||
}
|
||||
ViewProviderDocumentObject::hide();
|
||||
@@ -287,15 +297,17 @@ void ViewProviderPage::hide(void)
|
||||
|
||||
bool ViewProviderPage::showMDIViewPage()
|
||||
{
|
||||
if (m_mdiView.isNull()){
|
||||
if (m_mdiView.isNull()) {
|
||||
createMDIViewPage();
|
||||
m_graphicsScene->addChildrenToPage();
|
||||
m_graphicsScene->updateTemplate(true);
|
||||
m_graphicsScene->redrawAllViews();
|
||||
m_graphicsScene->fixOrphans(true);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
m_graphicsScene->redrawAllViews();
|
||||
m_graphicsScene->fixOrphans(true);
|
||||
m_graphicsView->update();
|
||||
}
|
||||
m_graphicsView->centerOnPage();
|
||||
|
||||
@@ -311,8 +323,7 @@ bool ViewProviderPage::showMDIViewPage()
|
||||
|
||||
void ViewProviderPage::createMDIViewPage()
|
||||
{
|
||||
Gui::Document* doc = Gui::Application::Instance->getDocument
|
||||
(pcObject->getDocument());
|
||||
Gui::Document* doc = Gui::Application::Instance->getDocument(pcObject->getDocument());
|
||||
m_mdiView = new MDIViewPage(this, doc, Gui::getMainWindow());
|
||||
if (!m_graphicsView) {
|
||||
m_graphicsView = new QGVPage(this, m_graphicsScene, m_mdiView);
|
||||
@@ -334,13 +345,15 @@ void ViewProviderPage::createMDIViewPage()
|
||||
//NOTE: removing MDIViewPage (parent) destroys QGVPage (eventually)
|
||||
void ViewProviderPage::removeMDIView(void)
|
||||
{
|
||||
if (!m_mdiView.isNull()) { //m_mdiView is a QPointer
|
||||
QList<QWidget*> wList= Gui::getMainWindow()->windows();
|
||||
if (!m_mdiView.isNull()) {//m_mdiView is a QPointer
|
||||
QList<QWidget*> wList = Gui::getMainWindow()->windows();
|
||||
if (wList.contains(m_mdiView)) {
|
||||
Gui::getMainWindow()->removeWindow(m_mdiView);
|
||||
m_mdiView = nullptr; //m_mdiView will eventually be deleted and
|
||||
m_graphicsView = nullptr; //will take m_graphicsView with it
|
||||
Gui::MDIView* aw = Gui::getMainWindow()->activeWindow(); //WF: this bit should be in the remove window logic, not here.
|
||||
m_mdiView = nullptr; //m_mdiView will eventually be deleted and
|
||||
m_graphicsView = nullptr;//will take m_graphicsView with it
|
||||
Gui::MDIView* aw =
|
||||
Gui::getMainWindow()
|
||||
->activeWindow();//WF: this bit should be in the remove window logic, not here.
|
||||
if (aw)
|
||||
aw->showMaximized();
|
||||
}
|
||||
@@ -355,11 +368,30 @@ MDIViewPage* ViewProviderPage::getMDIViewPage() const
|
||||
return m_mdiView;
|
||||
}
|
||||
|
||||
DrawTemplate* ViewProviderPage::getTemplate() const
|
||||
{
|
||||
return dynamic_cast<DrawTemplate*>(getDrawPage()->Template.getValue());
|
||||
}
|
||||
|
||||
|
||||
QGITemplate* ViewProviderPage::getQTemplate() const
|
||||
{
|
||||
Gui::Document* guiDoc = Gui::Application::Instance->getDocument(getDrawPage()->getDocument());
|
||||
if (guiDoc) {
|
||||
Gui::ViewProvider* vp = guiDoc->getViewProvider(getTemplate());
|
||||
auto vpTemplate = dynamic_cast<ViewProviderTemplate*>(vp);
|
||||
if (vpTemplate) {
|
||||
return vpTemplate->getQTemplate();
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<App::DocumentObject*> ViewProviderPage::claimChildren(void) const
|
||||
{
|
||||
std::vector<App::DocumentObject*> temp;
|
||||
|
||||
App::DocumentObject *templateFeat = nullptr;
|
||||
App::DocumentObject* templateFeat = nullptr;
|
||||
templateFeat = getDrawPage()->Template.getValue();
|
||||
|
||||
if (templateFeat) {
|
||||
@@ -376,58 +408,51 @@ std::vector<App::DocumentObject*> ViewProviderPage::claimChildren(void) const
|
||||
// DrawHatch
|
||||
// DrawWeldSymbol
|
||||
|
||||
const std::vector<App::DocumentObject *> &views = getDrawPage()->Views.getValues();
|
||||
const std::vector<App::DocumentObject*>& views = getDrawPage()->Views.getValues();
|
||||
|
||||
try {
|
||||
for (std::vector<App::DocumentObject *>::const_iterator it = views.begin(); it != views.end(); ++it) {
|
||||
TechDraw::DrawView* featView = dynamic_cast<TechDraw::DrawView*> (*it);
|
||||
App::DocumentObject *docObj = *it;
|
||||
for (std::vector<App::DocumentObject*>::const_iterator it = views.begin();
|
||||
it != views.end(); ++it) {
|
||||
TechDraw::DrawView* featView = dynamic_cast<TechDraw::DrawView*>(*it);
|
||||
App::DocumentObject* docObj = *it;
|
||||
//DrawRichAnno with no parent is child of Page
|
||||
TechDraw::DrawRichAnno* dra = dynamic_cast<TechDraw::DrawRichAnno*> (*it);
|
||||
TechDraw::DrawRichAnno* dra = dynamic_cast<TechDraw::DrawRichAnno*>(*it);
|
||||
if (dra) {
|
||||
if (!dra->AnnoParent.getValue()) {
|
||||
temp.push_back(*it); //no parent, belongs to page
|
||||
temp.push_back(*it);//no parent, belongs to page
|
||||
}
|
||||
continue; //has a parent somewhere else
|
||||
continue;//has a parent somewhere else
|
||||
}
|
||||
|
||||
// Don't collect if dimension, projection group item, hatch or member of ClipGroup as these should be grouped elsewhere
|
||||
if (docObj->isDerivedFrom(TechDraw::DrawProjGroupItem::getClassTypeId()) ||
|
||||
docObj->isDerivedFrom(TechDraw::DrawViewDimension::getClassTypeId()) ||
|
||||
docObj->isDerivedFrom(TechDraw::DrawHatch::getClassTypeId()) ||
|
||||
docObj->isDerivedFrom(TechDraw::DrawViewBalloon::getClassTypeId()) ||
|
||||
docObj->isDerivedFrom(TechDraw::DrawRichAnno::getClassTypeId()) ||
|
||||
docObj->isDerivedFrom(TechDraw::DrawLeaderLine::getClassTypeId()) ||
|
||||
docObj->isDerivedFrom(TechDraw::DrawWeldSymbol::getClassTypeId()) ||
|
||||
(featView && featView->isInClip()) )
|
||||
if (docObj->isDerivedFrom(TechDraw::DrawProjGroupItem::getClassTypeId())
|
||||
|| docObj->isDerivedFrom(TechDraw::DrawViewDimension::getClassTypeId())
|
||||
|| docObj->isDerivedFrom(TechDraw::DrawHatch::getClassTypeId())
|
||||
|| docObj->isDerivedFrom(TechDraw::DrawViewBalloon::getClassTypeId())
|
||||
|| docObj->isDerivedFrom(TechDraw::DrawRichAnno::getClassTypeId())
|
||||
|| docObj->isDerivedFrom(TechDraw::DrawLeaderLine::getClassTypeId())
|
||||
|| docObj->isDerivedFrom(TechDraw::DrawWeldSymbol::getClassTypeId())
|
||||
|| (featView && featView->isInClip()))
|
||||
continue;
|
||||
else
|
||||
temp.push_back(*it);
|
||||
}
|
||||
return temp;
|
||||
} catch (...) {
|
||||
}
|
||||
catch (...) {
|
||||
return std::vector<App::DocumentObject*>();
|
||||
}
|
||||
}
|
||||
|
||||
bool ViewProviderPage::isShow(void) const
|
||||
{
|
||||
return Visibility.getValue();
|
||||
}
|
||||
bool ViewProviderPage::isShow(void) const { return Visibility.getValue(); }
|
||||
|
||||
bool ViewProviderPage::getFrameState()
|
||||
{
|
||||
return ShowFrames.getValue();
|
||||
}
|
||||
bool ViewProviderPage::getFrameState() { return ShowFrames.getValue(); }
|
||||
|
||||
void ViewProviderPage::setFrameState(bool state)
|
||||
{
|
||||
ShowFrames.setValue(state);
|
||||
}
|
||||
void ViewProviderPage::setFrameState(bool state) { ShowFrames.setValue(state); }
|
||||
|
||||
void ViewProviderPage::toggleFrameState()
|
||||
{
|
||||
// Base::Console().Message("VPP::toggleFrameState()\n");
|
||||
// Base::Console().Message("VPP::toggleFrameState()\n");
|
||||
if (m_graphicsScene) {
|
||||
setFrameState(!getFrameState());
|
||||
m_graphicsScene->refreshViews();
|
||||
@@ -437,8 +462,8 @@ void ViewProviderPage::toggleFrameState()
|
||||
|
||||
void ViewProviderPage::setTemplateMarkers(bool state)
|
||||
{
|
||||
// Base::Console().Message("VPP::setTemplateMarkers(%d)\n", state);
|
||||
App::DocumentObject *templateFeat = nullptr;
|
||||
// Base::Console().Message("VPP::setTemplateMarkers(%d)\n", state);
|
||||
App::DocumentObject* templateFeat = nullptr;
|
||||
templateFeat = getDrawPage()->Template.getValue();
|
||||
Gui::Document* guiDoc = Gui::Application::Instance->getDocument(templateFeat->getDocument());
|
||||
Gui::ViewProvider* vp = guiDoc->getViewProvider(templateFeat);
|
||||
@@ -452,7 +477,7 @@ void ViewProviderPage::setTemplateMarkers(bool state)
|
||||
}
|
||||
}
|
||||
|
||||
bool ViewProviderPage::canDelete(App::DocumentObject *obj) const
|
||||
bool ViewProviderPage::canDelete(App::DocumentObject* obj) const
|
||||
{
|
||||
// deletions from a page don't necessarily destroy anything
|
||||
// thus we can pass this action
|
||||
@@ -472,11 +497,11 @@ bool ViewProviderPage::canDragObject(App::DocumentObject* docObj) const
|
||||
return getVPPExtension()->extensionCanDragObject(docObj);
|
||||
}
|
||||
|
||||
bool ViewProviderPage::canDropObjectEx(App::DocumentObject* obj, App::DocumentObject *owner,
|
||||
const char *subname, const std::vector<std::string> &elements) const
|
||||
bool ViewProviderPage::canDropObjectEx(App::DocumentObject* obj, App::DocumentObject* owner,
|
||||
const char* subname,
|
||||
const std::vector<std::string>& elements) const
|
||||
{
|
||||
return getVPPExtension()->extensionCanDropObjectEx(obj, owner, subname, elements);
|
||||
|
||||
}
|
||||
|
||||
bool ViewProviderPage::canDropObject(App::DocumentObject* docObj) const
|
||||
@@ -510,12 +535,9 @@ TechDraw::DrawPage* ViewProviderPage::getDrawPage() const
|
||||
return dynamic_cast<TechDraw::DrawPage*>(pcObject);
|
||||
}
|
||||
|
||||
Gui::MDIView *ViewProviderPage::getMDIView() const
|
||||
{
|
||||
return m_mdiView.data();
|
||||
}
|
||||
Gui::MDIView* ViewProviderPage::getMDIView() const { return m_mdiView.data(); }
|
||||
|
||||
void ViewProviderPage::setGrid()
|
||||
void ViewProviderPage::setGrid()
|
||||
{
|
||||
TechDraw::DrawPage* dp = getDrawPage();
|
||||
if (!dp) {
|
||||
@@ -533,7 +555,8 @@ void ViewProviderPage::setGrid()
|
||||
if (ShowGrid.getValue()) {
|
||||
widget->showGrid(true);
|
||||
widget->makeGrid(pageWidth, pageHeight, gridStep);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
widget->showGrid(false);
|
||||
}
|
||||
widget->updateViewport();
|
||||
@@ -547,7 +570,4 @@ ViewProviderPageExtension* ViewProviderPage::getVPPExtension() const
|
||||
return vppe;
|
||||
}
|
||||
|
||||
const char* ViewProviderPage::whoAmI() const
|
||||
{
|
||||
return m_pageName.c_str();
|
||||
}
|
||||
const char* ViewProviderPage::whoAmI() const { return m_pageName.c_str(); }
|
||||
|
||||
Reference in New Issue
Block a user