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-11.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'doc/html/tutorial1-11.html') diff --git a/doc/html/tutorial1-11.html b/doc/html/tutorial1-11.html index ce5de2a61..5ea46d920 100644 --- a/doc/html/tutorial1-11.html +++ b/doc/html/tutorial1-11.html @@ -61,7 +61,7 @@ implementation.

This private slot is used to move the shot while it is in the air, using a TQTimer.

    private:
-        void  paintShot( TQPainter * );
+        void  paintShot( TQPainter * );
 

This private function paints the shot.

        TQRect shotRect() const;
@@ -143,10 +143,10 @@ shot one step along its trajectory.
 stop the timer or we add the new shotRect() to the TQRegion.
 

Finally, we repaint the TQRegion. This will send a single paint event for just the one or two rectangles that need updating. -

    void CannonField::paintEvent( TQPaintEvent *e )
+

    void CannonField::paintEvent( TQPaintEvent *e )
     {
-        TQRect updateR = e->rect();
-        TQPainter p( this );
+        TQRect updateR = e->rect();
+        TQPainter p( this );
 
         if ( updateR.intersects( cannonRect() ) )
             paintCannon( &p );
@@ -159,11 +159,11 @@ for just the one or two rectangles that need updating.
 chapter. Now we fetch the bounding rectangle of the region that
 needs painting, check whether it intersects either the cannon and/or
 the shot, and if necessary, call paintCannon() and/or paintShot().
-

    void CannonField::paintShot( TQPainter *p )
+

    void CannonField::paintShot( TQPainter *p )
     {
-        p->setBrush( black );
-        p->setPen( NoPen );
-        p->drawRect( shotRect() );
+        p->setBrush( black );
+        p->setPen( NoPen );
+        p->drawRect( shotRect() );
     }
 

This private function paints the shot by drawing a black filled rectangle. @@ -232,7 +232,7 @@ of the CannonField. makefile and build the application.)

Exercises

-

Make the shot a filled circle. Hint: TQPainter::drawEllipse() may +

Make the shot a filled circle. Hint: TQPainter::drawEllipse() may help.

Change the color of the cannon when a shot is in the air.

You're now ready for Chapter 12. -- cgit v1.2.3