diff options
Diffstat (limited to 'kivio/plugins/kivioselecttool/tool_select.cpp')
-rw-r--r-- | kivio/plugins/kivioselecttool/tool_select.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/kivio/plugins/kivioselecttool/tool_select.cpp b/kivio/plugins/kivioselecttool/tool_select.cpp index 333416f9..898a3508 100644 --- a/kivio/plugins/kivioselecttool/tool_select.cpp +++ b/kivio/plugins/kivioselecttool/tool_select.cpp @@ -44,24 +44,24 @@ #include <KoGuides.h> #include "kivio_command.h" -#include <qwmatrix.h> +#include <tqwmatrix.h> #include "kivio_pluginmanager.h" -SelectTool::SelectTool( KivioView* parent ) : Kivio::MouseTool(parent, "Selection Mouse Tool") +SelectTool::SelectTool( KivioView* tqparent ) : Kivio::MouseTool(tqparent, "Selection Mouse Tool") { view()->pluginManager()->setDefaultTool(this); KShortcut selectShortCut(Key_Space); - selectShortCut.setSeq(1, QKeySequence(Key_Escape)); + selectShortCut.setSeq(1, TQKeySequence(Key_Escape)); m_selectAction = new KRadioAction(i18n("&Select"), "select", selectShortCut, actionCollection(), "select"); - connect(m_selectAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); + connect(m_selectAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); m_textEditAction = new KAction(i18n("&Edit Text..."), "text", Key_F2, - this, SLOT(editStencilText()), actionCollection(), "editText"); - (void) new KAction(i18n("Format &Stencils && Connectors..."), 0, 0, view(), SLOT(stencilFormat()), + this, TQT_SLOT(editStencilText()), actionCollection(), "editText"); + (void) new KAction(i18n("Format &Stencils && Connectors..."), 0, 0, TQT_TQOBJECT(view()), TQT_SLOT(stencilFormat()), actionCollection(), "formatStencil"); - m_arrowHeadAction = new KAction(i18n("Format &Arrowheads..."), 0, 0, view(), SLOT(arrowHeadFormat()), + m_arrowHeadAction = new KAction(i18n("Format &Arrowheads..."), 0, 0, TQT_TQOBJECT(view()), TQT_SLOT(arrowHeadFormat()), actionCollection(), "formatConnector"); m_mode = stmNone; @@ -84,17 +84,17 @@ SelectTool::~SelectTool() * @param e The event to be identified and processed * */ -bool SelectTool::processEvent(QEvent* e) +bool SelectTool::processEvent(TQEvent* e) { KivioCanvas* canvas = view()->canvasWidget(); - QMouseEvent *m; + TQMouseEvent *m; switch (e->type()) { - case QEvent::MouseButtonDblClick: - m = (QMouseEvent *)e; + case TQEvent::MouseButtonDblClick: + m = (TQMouseEvent *)e; - if( m->button() == LeftButton ) { + if( m->button() == Qt::LeftButton ) { leftDoubleClick(m->pos()); } @@ -102,12 +102,12 @@ bool SelectTool::processEvent(QEvent* e) return true; break; - case QEvent::MouseButtonPress: - m = (QMouseEvent *)e; + case TQEvent::MouseButtonPress: + m = (TQMouseEvent *)e; - if( m->button() == RightButton ) { + if( m->button() == Qt::RightButton ) { showPopupMenu(m->globalPos()); - } else if( m->button() == LeftButton ) { + } else if( m->button() == Qt::LeftButton ) { if(m->state() & ControlButton) { m_controlKey = true; } else { @@ -121,20 +121,20 @@ bool SelectTool::processEvent(QEvent* e) return true; break; - case QEvent::MouseButtonRelease: - mouseRelease( ((QMouseEvent *)e)->pos() ); + case TQEvent::MouseButtonRelease: + mouseRelease( ((TQMouseEvent *)e)->pos() ); canvas->setFocus(); return true; break; - case QEvent::MouseMove: - mouseMove( static_cast<QMouseEvent*>(e)); + case TQEvent::MouseMove: + mouseMove( TQT_TQMOUSEEVENT(e)); return true; break; - case QEvent::KeyPress: - if((static_cast<QKeyEvent*>(e)->key() >= Key_Left) && (static_cast<QKeyEvent*>(e)->key() <= Key_Down)) { - keyPress(static_cast<QKeyEvent*>(e)); + case TQEvent::KeyPress: + if((TQT_TQKEYEVENT(e)->key() >= Key_Left) && (TQT_TQKEYEVENT(e)->key() <= Key_Down)) { + keyPress(TQT_TQKEYEVENT(e)); return true; } break; @@ -162,11 +162,11 @@ void SelectTool::setActivated(bool a) /** * Selects all stencils inside a given rect */ -void SelectTool::select(const QRect &r) +void SelectTool::select(const TQRect &r) { // Calculate the start and end clicks in terms of page coordinates - KoPoint startPoint = view()->canvasWidget()->mapFromScreen( QPoint( r.x(), r.y() ) ); - KoPoint releasePoint = view()->canvasWidget()->mapFromScreen( QPoint( r.x() + r.width(), r.y() + r.height() ) ); + KoPoint startPoint = view()->canvasWidget()->mapFromScreen( TQPoint( r.x(), r.y() ) ); + KoPoint releasePoint = view()->canvasWidget()->mapFromScreen( TQPoint( r.x() + r.width(), r.y() + r.height() ) ); double x, y, w, h; @@ -192,7 +192,7 @@ void SelectTool::select(const QRect &r) view()->activePage()->selectStencils( x, y, w, h ); } -void SelectTool::mousePress(const QPoint &pos) +void SelectTool::mousePress(const TQPoint &pos) { // Last point is used for undrawing at the last position and calculating the distance the mouse has moved m_lastPoint = view()->canvasWidget()->mapFromScreen(pos); @@ -239,7 +239,7 @@ void SelectTool::mousePress(const QPoint &pos) /** * Tests if we should start rubber banding (always returns true). */ -bool SelectTool::startRubberBanding(const QPoint &pos) +bool SelectTool::startRubberBanding(const TQPoint &pos) { KivioCanvas* canvas = view()->canvasWidget(); // We didn't find a stencil, so unselect everything if we aren't holding the control key down @@ -247,7 +247,7 @@ bool SelectTool::startRubberBanding(const QPoint &pos) canvas->activePage()->unselectAllStencils(); canvas->startRectDraw( pos, KivioCanvas::Rubber ); - canvas->repaint(); + canvas->tqrepaint(); return true; } @@ -256,7 +256,7 @@ bool SelectTool::startRubberBanding(const QPoint &pos) /** * Tests if we can start dragging a stencil. */ -bool SelectTool::startDragging(const QPoint &pos, bool onlySelected) +bool SelectTool::startDragging(const TQPoint &pos, bool onlySelected) { KivioCanvas* canvas = view()->canvasWidget(); KivioPage *pPage = canvas->activePage(); @@ -299,7 +299,7 @@ bool SelectTool::startDragging(const QPoint &pos, bool onlySelected) // Create a new painter object canvas->beginUnclippedSpawnerPainter(); - // Build the list of old geometry + // Build the list of old tqgeometry KivioSelectDragData *pData; m_lstOldGeometry.clear(); pStencil = canvas->activePage()->selectedStencils()->first(); @@ -322,7 +322,7 @@ bool SelectTool::startDragging(const QPoint &pos, bool onlySelected) return true; } -bool SelectTool::startCustomDragging(const QPoint &pos, bool selectedOnly ) +bool SelectTool::startCustomDragging(const TQPoint &pos, bool selectedOnly ) { KivioCanvas* canvas = view()->canvasWidget(); KivioPage *pPage = canvas->activePage(); @@ -365,7 +365,7 @@ bool SelectTool::startCustomDragging(const QPoint &pos, bool selectedOnly ) m_customDragOrigPoint = pStencil->customIDPoint(m_customDragID); view()->canvasWidget()->setShowConnectorTargets(true); - view()->canvasWidget()->repaint(); + view()->canvasWidget()->tqrepaint(); // Create a new painter object canvas->beginUnclippedSpawnerPainter(); @@ -377,7 +377,7 @@ bool SelectTool::startCustomDragging(const QPoint &pos, bool selectedOnly ) /** * Tests if we can start resizing a stencil */ -bool SelectTool::startResizing(const QPoint &pos) +bool SelectTool::startResizing(const TQPoint &pos) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint pagePoint = canvas->mapFromScreen(pos); @@ -450,9 +450,9 @@ bool SelectTool::startResizing(const QPoint &pos) -void SelectTool::mouseMove(QMouseEvent* e) +void SelectTool::mouseMove(TQMouseEvent* e) { - QPoint pos = e->pos(); + TQPoint pos = e->pos(); bool ignoreGridGuides = e->state() & ShiftButton; switch( m_mode ) @@ -481,7 +481,7 @@ void SelectTool::mouseMove(QMouseEvent* e) m_lastPoint = view()->canvasWidget()->mapFromScreen(pos); } -void SelectTool::continueRubberBanding(const QPoint &pos) +void SelectTool::continueRubberBanding(const TQPoint &pos) { view()->canvasWidget()->continueRectDraw( pos, KivioCanvas::Rubber ); } @@ -491,10 +491,10 @@ void SelectTool::continueRubberBanding(const QPoint &pos) * Continues the dragging process of a stencil (moving) * * How does this work? Initially we create a list of all the original - * geometry of all the selected stencils. We use that to calculate delta + * tqgeometry of all the selected stencils. We use that to calculate delta * movements and snap them to the grid. */ -void SelectTool::continueDragging(const QPoint &pos, bool ignoreGridGuides) +void SelectTool::continueDragging(const TQPoint &pos, bool ignoreGridGuides) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint pagePoint = canvas->mapFromScreen( pos ); @@ -512,7 +512,7 @@ void SelectTool::continueDragging(const QPoint &pos, bool ignoreGridGuides) canvas->drawSelectedStencilsXOR(); } else { canvas->activePage()->setPaintSelected(false); - canvas->repaint(); + canvas->tqrepaint(); m_firstTime = false; } @@ -598,7 +598,7 @@ void SelectTool::continueDragging(const QPoint &pos, bool ignoreGridGuides) view()->updateToolBars(); } -void SelectTool::continueCustomDragging(const QPoint &pos) +void SelectTool::continueCustomDragging(const TQPoint &pos) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint pagePoint = canvas->mapFromScreen(pos); @@ -628,7 +628,7 @@ void SelectTool::continueCustomDragging(const QPoint &pos) canvas->drawStencilXOR(m_pCustomDraggingStencil); } else { m_pCustomDraggingStencil->setHidden(true); - canvas->repaint(); + canvas->tqrepaint(); m_firstTime = false; } } @@ -641,14 +641,14 @@ void SelectTool::continueCustomDragging(const QPoint &pos) if(m_pCustomDraggingStencil->type() != kstConnector){ canvas->drawStencilXOR(m_pCustomDraggingStencil); } else { - view()->canvasWidget()->repaint(); + view()->canvasWidget()->tqrepaint(); } view()->updateToolBars(); } -void SelectTool::continueResizing(const QPoint &pos, bool ignoreGridGuides) +void SelectTool::continueResizing(const TQPoint &pos, bool ignoreGridGuides) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint pagePoint = canvas->mapFromScreen(pos); @@ -659,7 +659,7 @@ void SelectTool::continueResizing(const QPoint &pos, bool ignoreGridGuides) KivioSelectDragData *pData = m_lstOldGeometry.first(); -/* QWMatrix m; +/* TQWMatrix m; double w2 = m_pResizingStencil->w() / 2.0; double h2 = m_pResizingStencil->h() / 2.0; m.translate(m_pResizingStencil->x(), m_pResizingStencil->y()); @@ -674,7 +674,7 @@ void SelectTool::continueResizing(const QPoint &pos, bool ignoreGridGuides) if( !pData ) { - kdDebug(43000) << "SelectTool::continueResizing() - Original geometry not found" << endl; + kdDebug(43000) << "SelectTool::continueResizing() - Original tqgeometry not found" << endl; return; } @@ -687,7 +687,7 @@ void SelectTool::continueResizing(const QPoint &pos, bool ignoreGridGuides) canvas->drawStencilXOR( m_pResizingStencil ); } else { m_pResizingStencil->setHidden(true); - canvas->repaint(); + canvas->tqrepaint(); m_firstTime = false; } @@ -814,7 +814,7 @@ void SelectTool::continueResizing(const QPoint &pos, bool ignoreGridGuides) /** * Change the mouse cursor based on what it is over. */ -void SelectTool::changeMouseCursor(const QPoint &pos) +void SelectTool::changeMouseCursor(const TQPoint &pos) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint pagePoint = canvas->mapFromScreen(pos); @@ -897,7 +897,7 @@ int SelectTool::isOverResizeHandle( KivioStencil *pStencil, const double x, cons int available; - QWMatrix m; + TQWMatrix m; double w = pStencil->w(); double h = pStencil->h(); double w2 = pStencil->w() / 2.0; @@ -969,7 +969,7 @@ int SelectTool::isOverResizeHandle( KivioStencil *pStencil, const double x, cons } -void SelectTool::mouseRelease(const QPoint &pos) +void SelectTool::mouseRelease(const TQPoint &pos) { m_releasePoint = pos; @@ -994,11 +994,11 @@ void SelectTool::mouseRelease(const QPoint &pos) m_mode = stmNone; - view()->canvasWidget()->guideLines().repaintAfterSnapping(); + view()->canvasWidget()->guideLines().tqrepaintAfterSnapping(); view()->doc()->updateView(view()->activePage()); } -void SelectTool::endRubberBanding(const QPoint &pos) +void SelectTool::endRubberBanding(const TQPoint &pos) { KivioCanvas* canvas = view()->canvasWidget(); // End the rubber-band drawing @@ -1015,7 +1015,7 @@ void SelectTool::endRubberBanding(const QPoint &pos) view()->updateToolBars(); } -void SelectTool::endDragging(const QPoint&) +void SelectTool::endDragging(const TQPoint&) { KivioCanvas* canvas = view()->canvasWidget(); canvas->activePage()->setPaintSelected(true); @@ -1050,11 +1050,11 @@ void SelectTool::endDragging(const QPoint&) canvas->drawSelectedStencilsXOR(); canvas->endUnclippedSpawnerPainter(); - // Clear the list of old geometry + // Clear the list of old tqgeometry m_lstOldGeometry.clear(); } -void SelectTool::endCustomDragging(const QPoint&) +void SelectTool::endCustomDragging(const TQPoint&) { KivioCanvas* canvas = view()->canvasWidget(); m_pCustomDraggingStencil->setHidden(false); @@ -1077,10 +1077,10 @@ void SelectTool::endCustomDragging(const QPoint&) canvas->endUnclippedSpawnerPainter(); canvas->setShowConnectorTargets(false); - canvas->repaint(); + canvas->tqrepaint(); } -void SelectTool::endResizing(const QPoint&) +void SelectTool::endResizing(const TQPoint&) { KivioCanvas* canvas = view()->canvasWidget(); m_pResizingStencil->setHidden(false); @@ -1105,7 +1105,7 @@ void SelectTool::endResizing(const QPoint&) /** * Shows the popupmenu at a given point. */ -void SelectTool::showPopupMenu( const QPoint &pos ) +void SelectTool::showPopupMenu( const TQPoint &pos ) { KPopupMenu* menu = 0; @@ -1138,7 +1138,7 @@ void SelectTool::showPopupMenu( const QPoint &pos ) * it launches the text tool on the selected stencils and switches back * to this tool when it's done. */ -void SelectTool::leftDoubleClick(const QPoint& pos) +void SelectTool::leftDoubleClick(const TQPoint& pos) { if( view()->activePage()->selectedStencils()->count() <= 0 ) return; @@ -1164,7 +1164,7 @@ void SelectTool::leftDoubleClick(const QPoint& pos) } } -void SelectTool::editText(QPtrList<KivioStencil>* stencils) +void SelectTool::editText(TQPtrList<KivioStencil>* stencils) { // Locate the text tool. If not found, bail with an error Kivio::Plugin *p = view()->pluginManager()->findPlugin("Text Mouse Tool"); @@ -1191,7 +1191,7 @@ void SelectTool::editStencilText() editText(view()->activePage()->selectedStencils()); } -void SelectTool::keyPress(QKeyEvent* e) +void SelectTool::keyPress(TQKeyEvent* e) { KivioCanvas* canvas = view()->canvasWidget(); @@ -1200,7 +1200,7 @@ void SelectTool::keyPress(QKeyEvent* e) // Create a new painter object canvas->beginUnclippedSpawnerPainter(); - // Build the list of old geometry + // Build the list of old tqgeometry KivioSelectDragData *pData; m_lstOldGeometry.clear(); KivioStencil* pStencil = canvas->activePage()->selectedStencils()->first(); @@ -1253,8 +1253,8 @@ void SelectTool::keyPress(QKeyEvent* e) break; } - endDragging(QPoint()); - canvas->guideLines().repaintAfterSnapping(); + endDragging(TQPoint()); + canvas->guideLines().tqrepaintAfterSnapping(); canvas->setFocus(); } |