diff options
Diffstat (limited to 'k9author/k9menueditor.cpp')
-rw-r--r-- | k9author/k9menueditor.cpp | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/k9author/k9menueditor.cpp b/k9author/k9menueditor.cpp index 1af07a1..fa227d0 100644 --- a/k9author/k9menueditor.cpp +++ b/k9author/k9menueditor.cpp @@ -13,34 +13,34 @@ #include "k9menubutton.h" #include "k9menuedit.h" #include "k9canvasselection.h" -#include <qwmatrix.h> -#include <qcursor.h> +#include <tqwmatrix.h> +#include <tqcursor.h> #include <kcursor.h> k9MenuEditor::k9MenuEditor( - QCanvas& c, QWidget* parent, + TQCanvas& c, TQWidget* tqparent, const char* name, WFlags f) : - QCanvasView(&c,parent,name,f) { - this->setMaximumSize(QSize(724,580)); + TQCanvasView(&c,tqparent,name,f) { + this->setMaximumSize(TQSize(724,580)); moving=NULL; m_canvasSelection=new k9CanvasSelection(this); viewport()->setMouseTracking(true); } -void k9MenuEditor::contentsMouseReleaseEvent(QMouseEvent* e) { +void k9MenuEditor::contentsMouseReleaseEvent(TQMouseEvent* e) { m_canvasSelection->release(); emit itemSelected(); } -void k9MenuEditor::contentsMousePressEvent(QMouseEvent* e) { - QPoint p = inverseWorldMatrix().map(e->pos()); +void k9MenuEditor::contentsMousePressEvent(TQMouseEvent* e) { + TQPoint p = inverseWorldMatrix().map(e->pos()); moving_start = p; - QCanvasItemList l=canvas()->collisions(p); + TQCanvasItemList l=canvas()->collisions(p); moving=0; - for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { - QCanvasItem *item=*it; - if (item->rtti()==QCanvasItem::Rtti_Rectangle) + for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { + TQCanvasItem *item=*it; + if (item->rtti()==TQCanvasItem::Rtti_Rectangle) moving = item; if (item->rtti()>2000) { moving=item; @@ -49,12 +49,12 @@ void k9MenuEditor::contentsMousePressEvent(QMouseEvent* e) { } if (moving) return; - for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { -// if ((*it)->rtti()==QCanvasItem::Rtti_Rectangle) + for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { +// if ((*it)->rtti()==TQCanvasItem::Rtti_Rectangle) // continue; moving = *it; if (moving->rtti()==1000) { - if (e->state() & QMouseEvent::ControlButton) + if (e->state() & TQt::ControlButton) addSelection(moving); else { if (!isSelected(moving)) { @@ -75,8 +75,8 @@ void k9MenuEditor::contentsMousePressEvent(QMouseEvent* e) { } void k9MenuEditor::clear() { - QCanvasItemList list = canvas()->allItems(); - QCanvasItemList::Iterator it = list.begin(); + TQCanvasItemList list = canvas()->allItems(); + TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { if ( *it ) delete *it; @@ -89,19 +89,19 @@ void k9MenuEditor::clearSelection() { m_selection.clear(); } -bool k9MenuEditor::isSelected(QCanvasItem *_item) { +bool k9MenuEditor::isSelected(TQCanvasItem *_item) { k9CanvasSprite *s=(k9CanvasSprite *)_item; k9MenuButton *button=s->getButton(); - if (m_selection.find(button) !=-1) + if (m_selection.tqfind(button) !=-1) return true; else return false; } -void k9MenuEditor::addSelection(QCanvasItem *_item) { +void k9MenuEditor::addSelection(TQCanvasItem *_item) { k9CanvasSprite *s=(k9CanvasSprite *)_item; k9MenuButton *button=s->getButton(); - if (m_selection.find(button) !=-1) { + if (m_selection.tqfind(button) !=-1) { button->select(false); m_selection.remove(button); } else { @@ -110,13 +110,13 @@ void k9MenuEditor::addSelection(QCanvasItem *_item) { } } -void k9MenuEditor::updateCursor(QMouseEvent *e) { - QPoint p = inverseWorldMatrix().map(e->pos()); - QCanvasItemList l=canvas()->collisions(p); - for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { - QCanvasItem *item=*it; +void k9MenuEditor::updateCursor(TQMouseEvent *e) { + TQPoint p = inverseWorldMatrix().map(e->pos()); + TQCanvasItemList l=canvas()->collisions(p); + for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { + TQCanvasItem *item=*it; switch (item->rtti()) { - case QCanvasItem::Rtti_Rectangle : + case TQCanvasItem::Rtti_Rectangle : setCursor(KCursor::sizeAllCursor()); return; case 2002 : @@ -142,15 +142,15 @@ void k9MenuEditor::updateCursor(QMouseEvent *e) { setCursor(KCursor::arrowCursor()); } -void k9MenuEditor::contentsMouseMoveEvent(QMouseEvent* e) { +void k9MenuEditor::contentsMouseMoveEvent(TQMouseEvent* e) { updateCursor(e); if ( moving && (e->state() & Qt::LeftButton ==Qt::LeftButton) ) { - if (moving->rtti() !=QCanvasItem::Rtti_Text || moving==m_menu->getText()) { - QPoint p = inverseWorldMatrix().map(e->pos()); + if (moving->rtti() !=TQCanvasItem::Rtti_Text || moving==m_menu->getText()) { + TQPoint p = inverseWorldMatrix().map(e->pos()); int offsetX=p.x() - moving_start.x(); int offsetY=p.y() - moving_start.y(); moving_start = p; - if (moving->rtti()==1000 || moving->rtti() == QCanvasItem::Rtti_Rectangle) { + if (moving->rtti()==1000 || moving->rtti() == TQCanvasItem::Rtti_Rectangle) { for (k9MenuButton *b=m_selection.first();b;b=m_selection.next()) { k9CanvasSprite*spr=b->getSprite(); spr->moveBy(offsetX,offsetY); @@ -163,29 +163,29 @@ void k9MenuEditor::contentsMouseMoveEvent(QMouseEvent* e) { if (moving->rtti() >2001 && moving->rtti() <2010) { k9CanvasSelectionRedim *ssr=(k9CanvasSelectionRedim*)moving; ssr->updateSelection(); - } else if (moving->rtti() != QCanvasItem::Rtti_Text ){ + } else if (moving->rtti() != TQCanvasItem::Rtti_Text ){ //if selection not resized, move the selection m_canvasSelection->moveBy(offsetX,offsetY); m_canvasSelection->update(); } if (moving==m_menu->getText()) - emit m_menu->updateTextPos(QPoint(moving->x(),moving->y())); + emit m_menu->updateTextPos(TQPoint(moving->x(),moving->y())); canvas()->update(); } } else if ((e->state() & Qt::LeftButton) ==Qt::LeftButton ) { m_canvasSelection->hide(); canvas()->update(); - QPoint p = inverseWorldMatrix().map(e->pos()); + TQPoint p = inverseWorldMatrix().map(e->pos()); int offsetX=p.x() - moving_start.x(); int offsetY=p.y() - moving_start.y(); m_canvasSelection->setSize(offsetX,offsetY); m_canvasSelection->show(); canvas()->update(); clearSelection(); - QCanvasItemList l=canvas()->collisions(m_canvasSelection->getRect()); - for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { - QCanvasItem *item = *it; + TQCanvasItemList l=canvas()->collisions(m_canvasSelection->getRect()); + for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { + TQCanvasItem *item = *it; if (item->rtti()==1000) { addSelection(item); } @@ -193,11 +193,11 @@ void k9MenuEditor::contentsMouseMoveEvent(QMouseEvent* e) { } } -void k9MenuEditor::resizeEvent ( QResizeEvent * e ) { - QWMatrix m; +void k9MenuEditor::resizeEvent ( TQResizeEvent * e ) { + TQWMatrix m; double scalex=(e->size().width()-4.0)/720.0; double scaley=(e->size().height()-4.0)/576.0; - m.scale(QMIN(scalex,scaley),QMIN(scalex,scaley)); + m.scale(TQMIN(scalex,scaley),TQMIN(scalex,scaley)); this->setWorldMatrix(m); } @@ -215,18 +215,18 @@ k9MenuButton * k9MenuEditor::getSelected() { return NULL; } -QCanvasItem* k9MenuEditor::getMoving() const { +TQCanvasItem* k9MenuEditor::getMoving() const { return moving; } -void k9MenuEditor::setMoving(QCanvasItem* _value) { +void k9MenuEditor::setMoving(TQCanvasItem* _value) { moving = _value; } -QPtrList< k9MenuButton > *k9MenuEditor::getSelection() { +TQPtrList< k9MenuButton > *k9MenuEditor::getSelection() { return &m_selection; } |