Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

filledrectangletool.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   DrawPad - a drawing program for Opie Environment                      *
00004  *                                                                         *
00005  *   (C) 2002 by S. Prud'homme <prudhomme@laposte.net>                     *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  ***************************************************************************/
00013 
00014 #include "filledrectangletool.h"
00015 
00016 #include "drawpad.h"
00017 #include "drawpadcanvas.h"
00018 
00019 FilledRectangleTool::FilledRectangleTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas)
00020     : ShapeTool(drawPad, drawPadCanvas)
00021 {
00022 }
00023 
00024 FilledRectangleTool::~FilledRectangleTool()
00025 {
00026 }
00027 
00028 void FilledRectangleTool::drawFinalShape(QPainter& p)
00029 {
00030     p.setRasterOp(Qt::NotROP);
00031     p.drawRect(QRect(m_polyline[2], m_polyline[0]));
00032     p.setRasterOp(Qt::CopyROP);
00033     p.fillRect(QRect(m_polyline[2], m_polyline[0]), m_pDrawPad->brush());
00034     p.setPen(m_pDrawPad->pen());
00035     p.drawRect(QRect(m_polyline[2], m_polyline[0]));
00036 }
00037 
00038 void FilledRectangleTool::drawTemporaryShape(QPainter& p)
00039 {
00040     p.setRasterOp(Qt::NotROP);
00041     p.drawRect(QRect(m_polyline[2], m_polyline[1]));
00042     p.drawRect(QRect(m_polyline[2], m_polyline[0]));
00043 }

Generated on Sat Nov 5 16:17:29 2005 for OPIE by  doxygen 1.4.2