[TD]add support for view menu zoom

This commit is contained in:
wandererfan
2023-11-11 11:45:24 -03:00
committed by Adrián Insaurralde Avalos
parent a2a26839ff
commit 09fb4dba8f
4 changed files with 46 additions and 5 deletions
+27 -1
View File
@@ -201,6 +201,14 @@ bool MDIViewPage::onMsg(const char* pMsg, const char**)
Gui::Command::updateActive();
return true;
}
else if (strcmp("ZoomIn", pMsg) == 0) {
zoomIn();
return true;
}
else if (strcmp("ZoomOut", pMsg) == 0) {
zoomOut();
return true;
}
return false;
}
@@ -234,10 +242,28 @@ bool MDIViewPage::onHasMsg(const char* pMsg) const
else if (strcmp("PrintAll", pMsg) == 0) {
return true;
}
else if (strcmp("ZoomIn", pMsg) == 0) {
return true;
}
else if (strcmp("ZoomOut", pMsg) == 0) {
return true;
}
return false;
}
//called by ViewProvider when Page feature Label changes
// handle a zoomIn message from the menu
void MDIViewPage::zoomIn()
{
m_vpPage->getQGVPage()->zoomIn();
}
// handle a zoomOut message from the menu
void MDIViewPage::zoomOut()
{
m_vpPage->getQGVPage()->zoomOut();
}
// called by ViewProvider when Page feature Label changes
void MDIViewPage::setTabText(std::string tabText)
{
if (!isPassive() && !tabText.empty()) {
+6 -4
View File
@@ -64,7 +64,6 @@ public:
void addChildrenToPage();
/// Observer message from the Tree Selection mechanism
void onSelectionChanged(const Gui::SelectionChanges& msg) override;
void preSelectionChanged(const QPoint &pos);
@@ -99,9 +98,12 @@ public:
TechDraw::DrawPage* dPage,
double& width, double& height);
void saveSVG(std::string file);
void saveDXF(std::string file);
void savePDF(std::string file);
void saveSVG(std::string fileName);
void saveDXF(std::string fileName);
void savePDF(std::string fileName);
void zoomIn();
void zoomOut();
void setDocumentObject(const std::string&);
void setDocumentName(const std::string&);
+10
View File
@@ -561,6 +561,16 @@ void QGVPage::setPanCursor() { activateCursor(panCursor); }
void QGVPage::setZoomCursor() { activateCursor(zoomCursor); }
void QGVPage::zoomIn()
{
m_navStyle->zoomIn();
}
void QGVPage::zoomOut()
{
m_navStyle->zoomOut();
}
void QGVPage::drawForeground(QPainter* painter, const QRectF& rect)
{
Q_UNUSED(rect);
+3
View File
@@ -122,6 +122,9 @@ public:
TechDraw::DrawView* getBalloonParent() { return m_balloonParent; }
void zoomIn();
void zoomOut();
public Q_SLOTS:
void setHighQualityAntialiasing(bool highQualityAntialiasing);