From a30f5359f03c3017fa19a6770fab32d25d22cb87 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 15 Jul 2024 19:08:22 +0900 Subject: Rename graphics class nt* related files to equivalent tq* (part 1) Signed-off-by: Michele Calgaro --- doc/html/tutorial1-14.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'doc/html/tutorial1-14.html') diff --git a/doc/html/tutorial1-14.html b/doc/html/tutorial1-14.html index c0fcc00fe..962f6866e 100644 --- a/doc/html/tutorial1-14.html +++ b/doc/html/tutorial1-14.html @@ -62,14 +62,14 @@ wall.

    protected:
-        void  paintEvent( TQPaintEvent * );
+        void  paintEvent( TQPaintEvent * );
         void  mousePressEvent( TQMouseEvent * );
         void  mouseMoveEvent( TQMouseEvent * );
         void  mouseReleaseEvent( TQMouseEvent * );
 

In addition to the familiar event handlers, CannonField implements three mouse event handlers. The names say it all. -

        void  paintBarrier( TQPainter * );
+

        void  paintBarrier( TQPainter * );
 

This private function paints the barrier wall.

        TQRect barrierRect() const;
@@ -154,11 +154,11 @@ longer pressed.
 

paintBarrier() does the same sort of thing as paintShot(), paintTarget(), and paintCannon(). -

    void CannonField::paintBarrier( TQPainter *p )
+

    void CannonField::paintBarrier( TQPainter *p )
     {
-        p->setBrush( yellow );
-        p->setPen( black );
-        p->drawRect( barrierRect() );
+        p->setBrush( yellow );
+        p->setPen( black );
+        p->drawRect( barrierRect() );
     }
 

This private function paints the barrier as a rectangle filled with @@ -182,9 +182,9 @@ the bottom edge of the barrier to the bottom edge of the widget.

This function returns TRUE if the point is in the barrel; otherwise it returns FALSE.

Here we use the class TQWMatrix. It is defined in the header file -ntqwmatrix.h, which is included by ntqpainter.h. +ntqwmatrix.h, which is included by tqpainter.h.

TQWMatrix defines a coordinate system mapping. It can perform the same -transformations as the TQPainter. +transformations as the TQPainter.

Here we perform the same transformation steps as we do when drawing the barrel in the paintCannon() function. First we translate the coordinate system and then we rotate it. -- cgit v1.2.1