summaryrefslogtreecommitdiffstats
path: root/kimagemapeditor/drawzone.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kimagemapeditor/drawzone.cpp')
-rw-r--r--kimagemapeditor/drawzone.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/kimagemapeditor/drawzone.cpp b/kimagemapeditor/drawzone.cpp
index 60b6fe9f..152f5300 100644
--- a/kimagemapeditor/drawzone.cpp
+++ b/kimagemapeditor/drawzone.cpp
@@ -37,8 +37,8 @@
#include "kimecommon.h"
-DrawZone::DrawZone(TQWidget *parent,KImageMapEditor* _imageMapEditor)
- : TQScrollView(parent)
+DrawZone::DrawZone(TQWidget *tqparent,KImageMapEditor* _imageMapEditor)
+ : TQScrollView(tqparent)
{
imageMapEditor=_imageMapEditor;
// setPicture(TQImage());
@@ -175,7 +175,7 @@ void DrawZone::setZoom(double z)
pix.convertFromImage(image);
// if the picture has transparent areas,
// fill them with Gimp like background
- if (pix.mask()) {
+ if (pix.tqmask()) {
TQPixmap backPix(32,32);
TQPainter p2(&backPix);
p2.fillRect(0,0,32,32,TQColor(156,149,156));
@@ -189,7 +189,7 @@ void DrawZone::setZoom(double z)
p.flush();
resizeContents(visibleWidth()>imageRect.width() ? visibleWidth() : imageRect.width(),
visibleHeight()>imageRect.height() ? visibleHeight() : imageRect.height());
- repaintContents(0,0,contentsWidth(),contentsHeight(),true);
+ tqrepaintContents(0,0,contentsWidth(),contentsHeight(),true);
}
TQPoint DrawZone::translateFromZoom(const TQPoint & p) const {
@@ -238,7 +238,7 @@ void DrawZone::contentsMousePressEvent(TQMouseEvent* e)
drawStart=e->pos();
// Check if it's on picture if not
// move it to the picture's border
- if (!imageRect.contains(drawStart)) {
+ if (!imageRect.tqcontains(drawStart)) {
if (drawStart.x()>imageRect.right())
drawStart.setX(imageRect.right());
if (drawStart.x()<imageRect.left())
@@ -262,7 +262,7 @@ void DrawZone::contentsMousePressEvent(TQMouseEvent* e)
}
if ( currentAction==None ) {
- if (e->button()==RightButton)
+ if (e->button()==Qt::RightButton)
{
if ( (currentArea=imageMapEditor->onArea(drawStart)) )
{
@@ -278,7 +278,7 @@ void DrawZone::contentsMousePressEvent(TQMouseEvent* e)
}
else
- if (e->button()==MidButton) {
+ if (e->button()==Qt::MidButton) {
contentsMouseDoubleClickEvent(e);
}
else // LeftClick on selectionpoint
@@ -379,7 +379,7 @@ void DrawZone::contentsMousePressEvent(TQMouseEvent* e)
r=oldArea->selectionRect();
if (currentArea) {
r= r | currentArea->selectionRect();
- repaintContents(translateToZoom(r),false);
+ tqrepaintContents(translateToZoom(r),false);
}
@@ -393,7 +393,7 @@ void DrawZone::contentsMouseReleaseEvent(TQMouseEvent *e) {
// Check if it's on picture if not
// move it to the picture's border
- if (!imageRect.contains(drawEnd)) {
+ if (!imageRect.tqcontains(drawEnd)) {
if (drawEnd.x()>imageRect.right())
drawEnd.setX(imageRect.right());
if (drawEnd.x()<imageRect.left())
@@ -419,8 +419,8 @@ void DrawZone::contentsMouseReleaseEvent(TQMouseEvent *e) {
// and clicked on the first PolygonPoint or
// the right Button was pressed the Polygon is finished
if ((currentArea->selectionPoints()->count()>2)
- && (currentArea->selectionPoints()->first()->contains(drawEnd)
- || (e->button()==RightButton)))
+ && (currentArea->selectionPoints()->first()->tqcontains(drawEnd)
+ || (e->button()==Qt::RightButton)))
{
currentArea->setFinished(true);
currentAction=None;
@@ -501,7 +501,7 @@ void DrawZone::contentsMouseReleaseEvent(TQMouseEvent *e) {
imageMapEditor->updateActionAccess();
imageMapEditor->updateSelection();
- repaintContents(imageRect,false);
+ tqrepaintContents(imageRect,false);
} else {
currentAction=None;
}
@@ -509,11 +509,11 @@ void DrawZone::contentsMouseReleaseEvent(TQMouseEvent *e) {
if (currentArea)
{
currentArea->setMoving(false);
- repaintArea(*currentArea);
+ tqrepaintArea(*currentArea);
}
delete oldArea;
oldArea=0L;
-// repaintContents(0,0,contentsWidth(),contentsHeight(),false);
+// tqrepaintContents(0,0,contentsWidth(),contentsHeight(),false);
imageMapEditor->slotUpdateSelectionCoords();
}
@@ -528,7 +528,7 @@ void DrawZone::contentsMouseMoveEvent(TQMouseEvent *e)
// If outside the image
// set it to the border
- if (!imageRect.contains(drawCurrent)) {
+ if (!imageRect.tqcontains(drawCurrent)) {
if (drawCurrent.x()>imageRect.right())
drawCurrent.setX(imageRect.right());
if (drawCurrent.x()<imageRect.left())
@@ -545,12 +545,12 @@ void DrawZone::contentsMouseMoveEvent(TQMouseEvent *e)
drawCurrent=translateFromZoom(drawCurrent);
if (currentAction==DrawRectangle) {
- // To avoid flicker, only repaint the minimum rect
+ // To avoid flicker, only tqrepaint the minimum rect
TQRect oldRect=translateToZoom(currentArea->rect());
currentArea->setRect(TQRect(drawStart,drawCurrent).normalize());
TQRect newRect=translateToZoom(currentArea->selectionRect());
TQRect r=oldRect | newRect;
- repaintContents(r,false);
+ tqrepaintContents(r,false);
imageMapEditor->slotUpdateSelectionCoords( currentArea->rect() );
} else
if (currentAction==DrawCircle) {
@@ -576,7 +576,7 @@ void DrawZone::contentsMouseMoveEvent(TQMouseEvent *e)
currentArea->setRect(TQRect(drawStart,endPoint).normalize());
TQRect newRect=translateToZoom(currentArea->rect());
TQRect r=oldRect | newRect;
- repaintContents(r,false);
+ tqrepaintContents(r,false);
imageMapEditor->slotUpdateSelectionCoords( currentArea->rect() );
} else
if ( currentAction==DrawPolygon ) {
@@ -584,14 +584,14 @@ void DrawZone::contentsMouseMoveEvent(TQMouseEvent *e)
currentArea->moveSelectionPoint(currentSelectionPoint,drawCurrent);
TQRect newRect=translateToZoom(currentArea->rect());
TQRect r=oldRect | newRect;
- repaintContents(r,false);
+ tqrepaintContents(r,false);
} else
if ( currentAction==DrawFreehand) {
TQRect oldRect=translateToZoom(currentArea->rect());
currentArea->insertCoord(currentArea->countSelectionPoints(), drawCurrent);
TQRect newRect=translateToZoom(currentArea->rect());
TQRect r=oldRect | newRect;
- repaintContents(r,false);
+ tqrepaintContents(r,false);
} else
if ( currentAction==MoveArea ) {
TQRect oldRect=translateToZoom(currentArea->selectionRect());
@@ -599,7 +599,7 @@ void DrawZone::contentsMouseMoveEvent(TQMouseEvent *e)
TQRect newRect=translateToZoom(currentArea->selectionRect());
TQRect r=oldRect | newRect;
currentArea->setMoving(true);
- repaintContents(r,false);
+ tqrepaintContents(r,false);
drawStart=drawCurrent;
imageMapEditor->slotUpdateSelectionCoords();
} else
@@ -608,7 +608,7 @@ void DrawZone::contentsMouseMoveEvent(TQMouseEvent *e)
currentArea->moveSelectionPoint(currentSelectionPoint,drawCurrent);
TQRect newRect=translateToZoom(currentArea->selectionRect());
TQRect r=oldRect | newRect;
- repaintContents(r,false);
+ tqrepaintContents(r,false);
imageMapEditor->slotUpdateSelectionCoords();
} else
if (currentAction==DoSelect) {
@@ -629,27 +629,27 @@ void DrawZone::contentsMouseMoveEvent(TQMouseEvent *e)
imageMapEditor->deselectWithoutUpdate( it.current() );
}
*/
- // We don't have to repaint the hole selection rectangle
- // only the borders have to be repainted.
+ // We don't have to tqrepaint the hole selection rectangle
+ // only the borders have to be tqrepainted.
// So we have to create 4 rectangles for every rectangle
- // which represent the borders and then repaint them.
+ // which represent the borders and then tqrepaint them.
TQRect lb,rb,tb,bb;
createBorderRectangles(translateToZoom(r),lb,rb,tb,bb);
- repaintContents(lb,false);
- repaintContents(rb,false);
- repaintContents(tb,false);
- repaintContents(bb,false);
+ tqrepaintContents(lb,false);
+ tqrepaintContents(rb,false);
+ tqrepaintContents(tb,false);
+ tqrepaintContents(bb,false);
createBorderRectangles(translateToZoom(oldSelectionRect),lb,rb,tb,bb);
- repaintContents(lb,false);
- repaintContents(rb,false);
- repaintContents(tb,false);
- repaintContents(bb,false);
+ tqrepaintContents(lb,false);
+ tqrepaintContents(rb,false);
+ tqrepaintContents(tb,false);
+ tqrepaintContents(bb,false);
-// repaintContents(oldSelectionRect | r,false);
+// tqrepaintContents(oldSelectionRect | r,false);
oldSelectionRect = r;
-// repaintContents(translateToZoom(r),false);
+// tqrepaintContents(translateToZoom(r),false);
//+ imageMapEditor->updateSelection();
@@ -658,7 +658,7 @@ void DrawZone::contentsMouseMoveEvent(TQMouseEvent *e)
// TQRect r2(drawStart.x(),drawStart.y(),drawOld.x()-drawStart.x(),drawOld.y()-drawStart.y());
// r2 = r2.normalize();
// r = translateToZoom(r | r2);
-// repaintContents(r,false);
+// tqrepaintContents(r,false);
} else
if ( currentAction==None )
{
@@ -782,17 +782,17 @@ void DrawZone::cancelDrawing()
TQRect r = translateToZoom(currentArea->selectionRect());
delete currentArea;
currentArea = 0L;
- repaintContents(r,false);
+ tqrepaintContents(r,false);
imageMapEditor->slotUpdateSelectionCoords();
}
}
-void DrawZone::repaintArea(const Area & a) {
- repaintContents(translateToZoom(a.selectionRect()),false);
+void DrawZone::tqrepaintArea(const Area & a) {
+ tqrepaintContents(translateToZoom(a.selectionRect()),false);
}
-void DrawZone::repaintRect(const TQRect & r) {
- repaintContents(translateToZoom(r),false);
+void DrawZone::tqrepaintRect(const TQRect & r) {
+ tqrepaintContents(translateToZoom(r),false);
}
void DrawZone::drawContents(TQPainter* p,int clipx,int clipy,int clipw,int cliph)
@@ -848,7 +848,7 @@ void DrawZone::drawContents(TQPainter* p,int clipx,int clipy,int clipw,int cliph
if (currentAction == DoSelect )
{
TQPen pen = TQPen(TQColor("white"),1);
- p2.setRasterOp(Qt::XorROP);
+ p2.setRasterOp(TQt::XorROP);
pen.setStyle(Qt::DotLine);
p2.setPen(pen);