diff options
Diffstat (limited to 'kivio/plugins/kiviotexttool/tool_text.cpp')
-rw-r--r-- | kivio/plugins/kiviotexttool/tool_text.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/kivio/plugins/kiviotexttool/tool_text.cpp b/kivio/plugins/kiviotexttool/tool_text.cpp index 8b7e52e7..645a79a4 100644 --- a/kivio/plugins/kiviotexttool/tool_text.cpp +++ b/kivio/plugins/kiviotexttool/tool_text.cpp @@ -19,7 +19,7 @@ */ #include "tool_text.h" -#include <qcursor.h> +#include <tqcursor.h> #include <kiconloader.h> #include <kstandarddirs.h> #include <kdebug.h> @@ -46,17 +46,17 @@ #include "stenciltexteditor.h" -TextTool::TextTool( KivioView* parent ) : Kivio::MouseTool(parent, "Text Mouse Tool") +TextTool::TextTool( KivioView* tqparent ) : Kivio::MouseTool(tqparent, "Text Mouse Tool") { m_textAction = new Kivio::MouseToolAction( i18n("Text Tool"), "text", Key_F2, actionCollection(), "text" ); - connect(m_textAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); - connect(m_textAction, SIGNAL(doubleClicked()), this, SLOT(makePermanent())); + connect(m_textAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); + connect(m_textAction, TQT_SIGNAL(doubleClicked()), this, TQT_SLOT(makePermanent())); m_permanent = false; m_mode = stmNone; - QPixmap pix = BarIcon("kivio_text_cursor",KivioFactory::global()); - m_pTextCursor = new QCursor(pix,2,2); + TQPixmap pix = BarIcon("kivio_text_cursor",KivioFactory::global()); + m_pTextCursor = new TQCursor(pix,2,2); } TextTool::~TextTool() @@ -71,22 +71,22 @@ TextTool::~TextTool() * @param e The event to be identified and processed * */ -bool TextTool::processEvent(QEvent* e) +bool TextTool::processEvent(TQEvent* e) { switch (e->type()) { - case QEvent::MouseButtonPress: - mousePress( (QMouseEvent*)e ); + case TQEvent::MouseButtonPress: + mousePress( (TQMouseEvent*)e ); return true; break; - case QEvent::MouseButtonRelease: - mouseRelease( (QMouseEvent*)e ); + case TQEvent::MouseButtonRelease: + mouseRelease( (TQMouseEvent*)e ); return true; break; - case QEvent::MouseMove: - mouseMove( (QMouseEvent*)e ); + case TQEvent::MouseMove: + mouseMove( (TQMouseEvent*)e ); return true; break; @@ -110,11 +110,11 @@ void TextTool::setActivated(bool a) } } -void TextTool::text(QRect r) +void TextTool::text(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() ) ); // Calculate the x,y position of the textion box float x = startPoint.x() < releasePoint.x() ? startPoint.x() : releasePoint.x(); @@ -162,9 +162,9 @@ void TextTool::text(QRect r) } } -void TextTool::mousePress( QMouseEvent *e ) +void TextTool::mousePress( TQMouseEvent *e ) { - if(e->button() == LeftButton) { + if(e->button() == Qt::LeftButton) { KoPoint pagePoint = view()->canvasWidget()->mapFromScreen(e->pos()); int colType; KivioPage *page = view()->activePage(); @@ -182,16 +182,16 @@ void TextTool::mousePress( QMouseEvent *e ) /** * Tests if we should start rubber banding (always returns true). */ -bool TextTool::startRubberBanding( QMouseEvent *e ) +bool TextTool::startRubberBanding( TQMouseEvent *e ) { view()->canvasWidget()->startRectDraw( e->pos(), KivioCanvas::Rubber ); - view()->canvasWidget()->repaint(); + view()->canvasWidget()->tqrepaint(); m_startPoint = e->pos(); return true; } -void TextTool::mouseMove( QMouseEvent * e ) +void TextTool::mouseMove( TQMouseEvent * e ) { switch( m_mode ) { @@ -204,12 +204,12 @@ void TextTool::mouseMove( QMouseEvent * e ) } } -void TextTool::continueRubberBanding( QMouseEvent *e ) +void TextTool::continueRubberBanding( TQMouseEvent *e ) { view()->canvasWidget()->continueRectDraw( e->pos(), KivioCanvas::Rubber ); } -void TextTool::mouseRelease( QMouseEvent *e ) +void TextTool::mouseRelease( TQMouseEvent *e ) { m_releasePoint = e->pos(); @@ -222,14 +222,14 @@ void TextTool::mouseRelease( QMouseEvent *e ) m_mode = stmNone; - view()->canvasWidget()->repaint(); + view()->canvasWidget()->tqrepaint(); } -void TextTool::endRubberBanding(QMouseEvent */*e*/) +void TextTool::endRubberBanding(TQMouseEvent */*e*/) { // End the rubber-band drawing view()->canvasWidget()->endRectDraw(); - QRect rect; + TQRect rect; if( m_startPoint != m_releasePoint ) { rect = view()->canvasWidget()->rect(); @@ -246,7 +246,7 @@ void TextTool::endRubberBanding(QMouseEvent */*e*/) } } -void TextTool::applyToolAction(QPtrList<KivioStencil>* stencils) +void TextTool::applyToolAction(TQPtrList<KivioStencil>* stencils) { if(stencils->isEmpty()) { return; @@ -273,21 +273,21 @@ void TextTool::applyToolAction(QPtrList<KivioStencil>* stencils) editor.setFontColor(stencil->textColor()); editor.setBackgroundColor(stencil->bgColor()); editor.setText(stencil->text()); - editor.setHorizontalAlign(static_cast<Qt::AlignmentFlags>(stencil->hTextAlign())); - editor.setVerticalAlign(static_cast<Qt::AlignmentFlags>(stencil->vTextAlign())); + editor.setHorizontalAlign(static_cast<TQt::AlignmentFlags>(stencil->hTextAlign())); + editor.setVerticalAlign(static_cast<TQt::AlignmentFlags>(stencil->vTextAlign())); - if(editor.exec() == QDialog::Accepted) { + if(editor.exec() == TQDialog::Accepted) { KMacroCommand* macroCmd = new KMacroCommand(i18n("Change Stencil Text and Formatting")); bool changed = false; - QString text = editor.text(); - QFont font = editor.font(); - QColor textColor = editor.fontColor(); - int halignment = editor.horizontalAlignment(); - int valignment = editor.verticalAlignment(); + TQString text = editor.text(); + TQFont font = editor.font(); + TQColor textColor = editor.fontColor(); + int htqalignment = editor.horizontalAlignment(); + int vtqalignment = editor.verticalAlignment(); bool changeFont = (stencil->textFont() != font); bool changeTextColor = (stencil->textColor() != textColor); - bool changeHAlignment = (stencil->hTextAlign() != halignment); - bool changeVAlignment = (stencil->vTextAlign() != valignment); + bool changeHAlignment = (stencil->hTextAlign() != htqalignment); + bool changeVAlignment = (stencil->vTextAlign() != vtqalignment); while( stencil ) @@ -317,18 +317,18 @@ void TextTool::applyToolAction(QPtrList<KivioStencil>* stencils) changed = true; } - if(changeHAlignment && (stencil->hTextAlign() != halignment)) { + if(changeHAlignment && (stencil->hTextAlign() != htqalignment)) { KivioChangeStencilHAlignmentCommand* cmd = new KivioChangeStencilHAlignmentCommand( - i18n("Change Stencil Horizontal Alignment"), view()->activePage(), stencil, stencil->hTextAlign(), halignment); - stencil->setHTextAlign(halignment); + i18n("Change StencilQt::Horizontal Alignment"), view()->activePage(), stencil, stencil->hTextAlign(), htqalignment); + stencil->setHTextAlign(htqalignment); macroCmd->addCommand(cmd); changed = true; } - if(changeVAlignment && (stencil->vTextAlign() != valignment)) { + if(changeVAlignment && (stencil->vTextAlign() != vtqalignment)) { KivioChangeStencilVAlignmentCommand* cmd = new KivioChangeStencilVAlignmentCommand( - i18n("Change Stencil Vertical Alignment"), view()->activePage(), stencil, stencil->vTextAlign(), valignment); - stencil->setVTextAlign(valignment); + i18n("Change StencilQt::Vertical Alignment"), view()->activePage(), stencil, stencil->vTextAlign(), vtqalignment); + stencil->setVTextAlign(vtqalignment); macroCmd->addCommand(cmd); changed = true; } @@ -351,7 +351,7 @@ void TextTool::applyToolAction(KivioStencil* stencil, const KoPoint& pos) return; } - QString name = stencil->getTextBoxName(pos); + TQString name = stencil->getTextBoxName(pos); if(name.isEmpty()) { return; @@ -362,13 +362,13 @@ void TextTool::applyToolAction(KivioStencil* stencil, const KoPoint& pos) editor.setFontColor(stencil->textColor(name)); editor.setBackgroundColor(stencil->bgColor()); editor.setText(stencil->text(name)); - editor.setHorizontalAlign(static_cast<Qt::AlignmentFlags>(stencil->hTextAlign(name))); - editor.setVerticalAlign(static_cast<Qt::AlignmentFlags>(stencil->vTextAlign(name))); + editor.setHorizontalAlign(static_cast<TQt::AlignmentFlags>(stencil->hTextAlign(name))); + editor.setVerticalAlign(static_cast<TQt::AlignmentFlags>(stencil->vTextAlign(name))); - if(editor.exec() == QDialog::Accepted) { + if(editor.exec() == TQDialog::Accepted) { KMacroCommand* macroCmd = new KMacroCommand(i18n("Change Stencil Text and Formatting")); bool changed = false; - QString text = editor.text(); + TQString text = editor.text(); if(stencil->text(name) != text) { @@ -379,7 +379,7 @@ void TextTool::applyToolAction(KivioStencil* stencil, const KoPoint& pos) changed = true; } - QFont font = editor.font(); + TQFont font = editor.font(); if(stencil->textFont(name) != font) { KivioChangeStencilFontCommand* cmd = new KivioChangeStencilFontCommand(i18n("Change Stencil Font"), @@ -389,7 +389,7 @@ void TextTool::applyToolAction(KivioStencil* stencil, const KoPoint& pos) changed = true; } - QColor textColor = editor.fontColor(); + TQColor textColor = editor.fontColor(); if(stencil->textColor(name) != textColor) { KivioChangeStencilColorCommand* cmd = new KivioChangeStencilColorCommand(i18n("Change Stencil Text Color"), @@ -400,24 +400,24 @@ void TextTool::applyToolAction(KivioStencil* stencil, const KoPoint& pos) changed = true; } - int halignment = editor.horizontalAlignment(); + int htqalignment = editor.horizontalAlignment(); - if(stencil->hTextAlign(name) != halignment) { + if(stencil->hTextAlign(name) != htqalignment) { KivioChangeStencilHAlignmentCommand* cmd = new KivioChangeStencilHAlignmentCommand( - i18n("Change Stencil Horizontal Alignment"), view()->activePage(), stencil, - stencil->hTextAlign(name), halignment, name); - stencil->setHTextAlign(name, halignment); + i18n("Change StencilQt::Horizontal Alignment"), view()->activePage(), stencil, + stencil->hTextAlign(name), htqalignment, name); + stencil->setHTextAlign(name, htqalignment); macroCmd->addCommand(cmd); changed = true; } - int valignment = editor.verticalAlignment(); + int vtqalignment = editor.verticalAlignment(); - if(stencil->vTextAlign(name) != valignment) { + if(stencil->vTextAlign(name) != vtqalignment) { KivioChangeStencilVAlignmentCommand* cmd = new KivioChangeStencilVAlignmentCommand( - i18n("Change Stencil Vertical Alignment"), view()->activePage(), stencil, - stencil->vTextAlign(name), valignment, name); - stencil->setVTextAlign(name, valignment); + i18n("Change StencilQt::Vertical Alignment"), view()->activePage(), stencil, + stencil->vTextAlign(name), vtqalignment, name); + stencil->setVTextAlign(name, vtqalignment); macroCmd->addCommand(cmd); changed = true; } |