[TD]add support for view menu zoom
This commit is contained in:
@@ -203,6 +203,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;
|
||||
}
|
||||
@@ -236,10 +244,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()) {
|
||||
|
||||
@@ -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&);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -122,6 +122,9 @@ public:
|
||||
|
||||
TechDraw::DrawView* getBalloonParent() { return m_balloonParent; }
|
||||
|
||||
void zoomIn();
|
||||
void zoomOut();
|
||||
|
||||
public Q_SLOTS:
|
||||
void setHighQualityAntialiasing(bool highQualityAntialiasing);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user