diff options
Diffstat (limited to 'kivio/plugins/kiviozoomtool/tool_zoom.cpp')
-rw-r--r-- | kivio/plugins/kiviozoomtool/tool_zoom.cpp | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/kivio/plugins/kiviozoomtool/tool_zoom.cpp b/kivio/plugins/kiviozoomtool/tool_zoom.cpp index aa3e8a2d..f690c9f3 100644 --- a/kivio/plugins/kiviozoomtool/tool_zoom.cpp +++ b/kivio/plugins/kiviozoomtool/tool_zoom.cpp @@ -35,10 +35,10 @@ #include <kstdaction.h> #include <KoZoomAction.h> -#include <qapplication.h> -#include <qcursor.h> +#include <tqapplication.h> +#include <tqcursor.h> -ZoomTool::ZoomTool(KivioView* parent) : Kivio::MouseTool(parent, "Zoom Mouse Tool") +ZoomTool::ZoomTool(KivioView* tqparent) : Kivio::MouseTool(tqparent, "Zoom Mouse Tool") { m_zoomAction = new KRadioAction(i18n("&Zoom"), "viewmag", CTRL + ALT + Key_Z, actionCollection(), "zoom"); m_zoomAction->setWhatsThis(i18n("By pressing this button you can zoom in on a specific area.")); @@ -46,52 +46,52 @@ ZoomTool::ZoomTool(KivioView* parent) : Kivio::MouseTool(parent, "Zoom Mouse Too m_panAction->setWhatsThis(i18n("You can drag the document by using the mouse.")); m_zoomAction->setExclusiveGroup("zoomAction"); m_panAction->setExclusiveGroup("zoomAction"); - connect(m_zoomAction,SIGNAL(activated()),SLOT(zoomActivated())); - connect(m_panAction,SIGNAL(activated()),SLOT(handActivated())); - connect(m_zoomAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); - connect(m_panAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); + connect(m_zoomAction,TQT_SIGNAL(activated()),TQT_SLOT(zoomActivated())); + connect(m_panAction,TQT_SIGNAL(activated()),TQT_SLOT(handActivated())); + connect(m_zoomAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); + connect(m_panAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); KoZoomAction* viewZoom = new KoZoomAction(i18n("Zoom &Level"), "viewmag", 0, actionCollection(), "viewZoom" ); viewZoom->setWhatsThis(i18n("This allows you to zoom in or out of a document. You can either choose one of the predefined zoomfactors or enter a new zoomfactor (in percent).")); - connect(viewZoom, SIGNAL(zoomChanged(const QString&)), parent, SLOT(viewZoom(const QString&))); - connect(parent, SIGNAL(zoomChanged(int)), viewZoom, SLOT(setZoom(int))); + connect(viewZoom, TQT_SIGNAL(zoomChanged(const TQString&)), tqparent, TQT_SLOT(viewZoom(const TQString&))); + connect(tqparent, TQT_SIGNAL(zoomChanged(int)), viewZoom, TQT_SLOT(setZoom(int))); - m_pPlus = KStdAction::zoomIn(this, SLOT(zoomPlus()), actionCollection(), "zoomPlus"); + m_pPlus = KStdAction::zoomIn(this, TQT_SLOT(zoomPlus()), actionCollection(), "zoomPlus"); m_pPlus->setWhatsThis(i18n("You can zoom in on the document by pressing this button.")); - m_pMinus = KStdAction::zoomOut(this, SLOT(zoomMinus()), actionCollection(), "zoomMinus"); + m_pMinus = KStdAction::zoomOut(this, TQT_SLOT(zoomMinus()), actionCollection(), "zoomMinus"); m_pMinus->setWhatsThis(i18n("By pressing this button you can zoom out of the document.")); m_pZoomWidth = new KAction( i18n("Zoom Width"), "kivio_zoom_width", SHIFT+Key_F4, actionCollection(), "zoomWidth" ); m_pZoomWidth->setWhatsThis(i18n("You can zoom the document that it fits into the window width.")); - connect(m_pZoomWidth,SIGNAL(activated()),SLOT(zoomWidth())); + connect(m_pZoomWidth,TQT_SIGNAL(activated()),TQT_SLOT(zoomWidth())); m_pZoomHeight = new KAction( i18n("Zoom Height"), "kivio_zoom_height", SHIFT+Key_F5, actionCollection(), "zoomHeight" ); m_pZoomHeight->setWhatsThis(i18n("You can zoom the document that it fits into the window height.")); - connect(m_pZoomHeight,SIGNAL(activated()),SLOT(zoomHeight())); + connect(m_pZoomHeight,TQT_SIGNAL(activated()),TQT_SLOT(zoomHeight())); m_pZoomPage = new KAction( i18n("Zoom Page"), "kivio_zoom_page", SHIFT+Key_F6, actionCollection(), "zoomPage" ); m_pZoomPage->setWhatsThis(i18n("The Zoom Page button shows the entire page.")); - connect(m_pZoomPage,SIGNAL(activated()),SLOT(zoomPage())); + connect(m_pZoomPage,TQT_SIGNAL(activated()),TQT_SLOT(zoomPage())); m_pZoomSelected = new KAction( i18n("Zoom Selected"), "kivio_zoom_selected", CTRL+Key_Y, actionCollection(), "zoomSelected" ); m_pZoomSelected->setWhatsThis(i18n("By pressing this button you zoom in on the document, so that all <b>selected</b> objects are visible.")); - connect(m_pZoomSelected,SIGNAL(activated()),SLOT(zoomSelected())); + connect(m_pZoomSelected,TQT_SIGNAL(activated()),TQT_SLOT(zoomSelected())); m_pZoomAllObjects = new KAction( i18n("Zoom All Objects"), "kivio_zoom_allobject", 0, actionCollection(), "zoomAllObjects" ); m_pZoomAllObjects->setWhatsThis(i18n("You are able to zoom in on the document, so that all objects are visible by pressing this button.")); - connect(m_pZoomAllObjects,SIGNAL(activated()),SLOT(zoomAllobjects())); + connect(m_pZoomAllObjects,TQT_SIGNAL(activated()),TQT_SLOT(zoomAllobjects())); - QPixmap pix; + TQPixmap pix; pix = BarIcon("kivio_zoom_plus",KivioFactory::global()); - m_pPlusCursor = new QCursor(pix,pix.width()/2,pix.height()/2); + m_pPlusCursor = new TQCursor(pix,pix.width()/2,pix.height()/2); pix = BarIcon("kivio_zoom_minus",KivioFactory::global()); - m_pMinusCursor = new QCursor(pix,pix.width()/2,pix.height()/2); + m_pMinusCursor = new TQCursor(pix,pix.width()/2,pix.height()/2); pix = BarIcon("kivio_zoom_hand",KivioFactory::global()); - m_handCursor = new QCursor(pix,pix.width()/2,pix.height()/2); + m_handCursor = new TQCursor(pix,pix.width()/2,pix.height()/2); m_pMenu = 0; } @@ -103,31 +103,31 @@ ZoomTool::~ZoomTool() delete m_handCursor; } -bool ZoomTool::processEvent(QEvent* e) +bool ZoomTool::processEvent(TQEvent* e) { KivioCanvas* canvas = view()->canvasWidget(); if(!m_bHandMode) { switch(e->type()) { - case QEvent::KeyPress: - if (!m_bLockKeyboard && (static_cast<QKeyEvent*>(e)->key() == Key_Shift)) { + case TQEvent::KeyPress: + if (!m_bLockKeyboard && (TQT_TQKEYEVENT(e)->key() == Key_Shift)) { m_pCurrent = m_pMinus; canvas->setCursor(*m_pMinusCursor); return true; } break; - case QEvent::KeyRelease: - if (!m_bLockKeyboard && (static_cast<QKeyEvent*>(e)->key() == Key_Shift)) { + case TQEvent::KeyRelease: + if (!m_bLockKeyboard && (TQT_TQKEYEVENT(e)->key() == Key_Shift)) { m_pCurrent = m_pPlus; canvas->setCursor(*m_pPlusCursor); return true; } break; - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: { - QMouseEvent* me = static_cast<QMouseEvent*>(e); + TQMouseEvent* me = TQT_TQMOUSEEVENT(e); - if(me->button() == LeftButton) { + if(me->button() == Qt::LeftButton) { if(m_pCurrent == m_pMinus) { m_pCurrent->activate(); } else { @@ -142,7 +142,7 @@ bool ZoomTool::processEvent(QEvent* e) return true; break; } - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: if(m_pCurrent == m_pPlus && m_bDrawRubber) { canvas->endRectDraw(); m_bDrawRubber = false; @@ -151,9 +151,9 @@ bool ZoomTool::processEvent(QEvent* e) return true; } break; - case QEvent::MouseMove: + case TQEvent::MouseMove: if (m_bDrawRubber) { - canvas->continueRectDraw(static_cast<QMouseEvent*>(e)->pos(), KivioCanvas::Rubber); + canvas->continueRectDraw(TQT_TQMOUSEEVENT(e)->pos(), KivioCanvas::Rubber); return true; } break; @@ -162,19 +162,19 @@ bool ZoomTool::processEvent(QEvent* e) } } else { switch(e->type()) { - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: isHandMousePressed = true; - mousePos = static_cast<QMouseEvent*>(e)->pos(); + mousePos = TQT_TQMOUSEEVENT(e)->pos(); return true; break; - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: isHandMousePressed = false; return true; break; - case QEvent::MouseMove: + case TQEvent::MouseMove: if (isHandMousePressed) { canvas->setUpdatesEnabled(false); - QPoint newPos = static_cast<QMouseEvent*>(e)->pos(); + TQPoint newPos = TQT_TQMOUSEEVENT(e)->pos(); mousePos -= newPos; canvas->scrollDx(-mousePos.x()); canvas->scrollDy(-mousePos.y()); @@ -234,7 +234,7 @@ void ZoomTool::handActivated() void ZoomTool::zoomPlus() { KivioCanvas* canvas = view()->canvasWidget(); - canvas->zoomIn(QPoint(canvas->width()/2, canvas->height()/2)); + canvas->zoomIn(TQPoint(canvas->width()/2, canvas->height()/2)); if(view()->zoomHandler()->zoom() >= 2000) { m_pPlus->setEnabled(false); @@ -250,7 +250,7 @@ void ZoomTool::zoomPlus() void ZoomTool::zoomMinus() { KivioCanvas* canvas = view()->canvasWidget(); - canvas->zoomOut(QPoint(canvas->width()/2, canvas->height()/2)); + canvas->zoomOut(TQPoint(canvas->width()/2, canvas->height()/2)); if(view()->zoomHandler()->zoom() <= 25) { m_pMinus->setEnabled(false); @@ -269,13 +269,13 @@ void ZoomTool::zoomWidth() KoZoomHandler zoom; zoom.setZoomAndResolution(100, KoGlobal::dpiX(), KoGlobal::dpiY()); - int cw = QMAX(10,canvas->width()-20); + int cw = TQMAX(10,canvas->width()-20); KoPageLayout pl = canvas->activePage()->paperLayout(); float w = zoom.zoomItX(pl.ptWidth); float z = cw/w; canvas->setUpdatesEnabled(false); - view()->viewZoom(qRound(z * 100)); + view()->viewZoom(tqRound(z * 100)); canvas->setUpdatesEnabled(true); } @@ -285,13 +285,13 @@ void ZoomTool::zoomHeight() KoZoomHandler zoom; zoom.setZoomAndResolution(100, KoGlobal::dpiX(), KoGlobal::dpiY()); - int ch = QMAX(10,canvas->height()-20); + int ch = TQMAX(10,canvas->height()-20); KoPageLayout pl = canvas->activePage()->paperLayout(); float h = zoom.zoomItY(pl.ptHeight); float zh = ch/h; canvas->setUpdatesEnabled(false); - view()->viewZoom(qRound(zh * 100)); + view()->viewZoom(tqRound(zh * 100)); canvas->setUpdatesEnabled(true); } @@ -301,21 +301,21 @@ void ZoomTool::zoomPage() KoZoomHandler zoom; zoom.setZoomAndResolution(100, KoGlobal::dpiX(), KoGlobal::dpiY()); - int cw = QMAX(10,canvas->width()-20); - int ch = QMAX(10,canvas->height()-20); + int cw = TQMAX(10,canvas->width()-20); + int ch = TQMAX(10,canvas->height()-20); KoPageLayout pl = canvas->activePage()->paperLayout(); float w = zoom.zoomItX(pl.ptWidth); float h = zoom.zoomItY(pl.ptHeight); - float z = QMIN(cw/w,ch/h); + float z = TQMIN(cw/w,ch/h); canvas->setUpdatesEnabled(false); - view()->viewZoom(qRound(z * 100)); + view()->viewZoom(tqRound(z * 100)); canvas->setUpdatesEnabled(true); } -void ZoomTool::showPopupMenu(const QPoint& p ) +void ZoomTool::showPopupMenu(const TQPoint& p ) { if(!m_pMenu) { m_pMenu = static_cast<KPopupMenu*>(factory()->container("ZoomPopup", this)); @@ -348,7 +348,7 @@ void ZoomTool::zoomAllobjects() } } -void ZoomTool::zoomRect(QRect r) +void ZoomTool::zoomRect(TQRect r) { KivioCanvas* canvas = view()->canvasWidget(); |