diff options
Diffstat (limited to 'doc/html/tutorial1-11.html')
-rw-r--r-- | doc/html/tutorial1-11.html | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/doc/html/tutorial1-11.html b/doc/html/tutorial1-11.html index 5ea46d920..1385646c1 100644 --- a/doc/html/tutorial1-11.html +++ b/doc/html/tutorial1-11.html @@ -64,7 +64,7 @@ using a <a href="tqtimer.html">TQTimer</a>. void paintShot( <a href="tqpainter.html">TQPainter</a> * ); </pre> <p> This private function paints the shot. -<p> <pre> <a href="ntqrect.html">TQRect</a> shotRect() const; +<p> <pre> <a href="tqrect.html">TQRect</a> shotRect() const; </pre> <p> This private function returns the shot's enclosing rectangle if one is in the air; otherwise the returned rectangle is undefined. @@ -116,15 +116,15 @@ is reset to zero. The <tt>shoot_ang</tt> and <tt>shoot_f</tt> are set to the cur cannon angle and force. Finally, we start the timer. <p> <pre> void CannonField::moveShot() { - <a href="ntqregion.html">TQRegion</a> r( shotRect() ); + <a href="tqregion.html">TQRegion</a> r( shotRect() ); timerCount++; - <a href="ntqrect.html">TQRect</a> shotR = shotRect(); + <a href="tqrect.html">TQRect</a> shotR = shotRect(); - if ( shotR.<a href="ntqrect.html#x">x</a>() > width() || shotR.<a href="ntqrect.html#y">y</a>() > height() ) + if ( shotR.<a href="tqrect.html#x">x</a>() > width() || shotR.<a href="tqrect.html#y">y</a>() > height() ) <a name="x2378"></a> autoShootTimer-><a href="tqtimer.html#stop">stop</a>(); else - <a name="x2373"></a> r = r.<a href="ntqrect.html#unite">unite</a>( TQRegion( shotR ) ); + <a name="x2373"></a> r = r.<a href="tqrect.html#unite">unite</a>( TQRegion( shotR ) ); <a href="tqwidget.html#repaint">repaint</a>( r ); } </pre> @@ -132,7 +132,7 @@ cannon angle and force. Finally, we start the timer. milliseconds when the <a href="tqtimer.html">TQTimer</a> fires. <p> Its tasks are to compute the new position, repaint the screen with the shot in the new position, and if necessary, stop the timer. -<p> First we make a <a href="ntqregion.html">TQRegion</a> that holds the old shotRect(). A <a href="ntqregion.html">TQRegion</a> +<p> First we make a <a href="tqregion.html">TQRegion</a> that holds the old shotRect(). A <a href="tqregion.html">TQRegion</a> is capable of holding any sort of region, and we'll use it here to simplify the painting. ShotRect() returns the rectangle where the shot is now - it is explained in detail later. @@ -145,13 +145,13 @@ stop the timer or we add the new shotRect() to the TQRegion. for just the one or two rectangles that need updating. <p> <pre> void CannonField::<a href="tqwidget.html#paintEvent">paintEvent</a>( <a href="tqpaintevent.html">TQPaintEvent</a> *e ) { - <a name="x2369"></a> <a href="ntqrect.html">TQRect</a> updateR = e-><a href="tqpaintevent.html#rect">rect</a>(); + <a name="x2369"></a> <a href="tqrect.html">TQRect</a> updateR = e-><a href="tqpaintevent.html#rect">rect</a>(); <a href="tqpainter.html">TQPainter</a> p( this ); - <a name="x2370"></a> if ( updateR.<a href="ntqrect.html#intersects">intersects</a>( cannonRect() ) ) + <a name="x2370"></a> if ( updateR.<a href="tqrect.html#intersects">intersects</a>( cannonRect() ) ) paintCannon( &p ); if ( autoShootTimer-><a href="tqtimer.html#isActive">isActive</a>() && - updateR.<a href="ntqrect.html#intersects">intersects</a>( shotRect() ) ) + updateR.<a href="tqrect.html#intersects">intersects</a>( shotRect() ) ) paintShot( &p ); } </pre> @@ -179,13 +179,13 @@ the paintEvent() from the previous chapter. double velx = velocity*cos( radians ); double vely = velocity*sin( radians ); - <a name="x2372"></a> double x0 = ( barrelRect.<a href="ntqrect.html#right">right</a>() + 5 )*cos(radians); - double y0 = ( barrelRect.<a href="ntqrect.html#right">right</a>() + 5 )*sin(radians); + <a name="x2372"></a> double x0 = ( barrelRect.<a href="tqrect.html#right">right</a>() + 5 )*cos(radians); + double y0 = ( barrelRect.<a href="tqrect.html#right">right</a>() + 5 )*sin(radians); double x = x0 + velx*time; double y = y0 + vely*time - 0.5*gravity*time*time; - <a href="ntqrect.html">TQRect</a> r = TQRect( 0, 0, 6, 6 ); - <a name="x2371"></a> r.<a href="ntqrect.html#moveCenter">moveCenter</a>( TQPoint( tqRound(x), height() - 1 - tqRound(y) ) ); + <a href="tqrect.html">TQRect</a> r = TQRect( 0, 0, 6, 6 ); + <a name="x2371"></a> r.<a href="tqrect.html#moveCenter">moveCenter</a>( TQPoint( tqRound(x), height() - 1 - tqRound(y) ) ); return r; } </pre> @@ -197,7 +197,7 @@ movement in a gravity field. For simplicity, we've chosen to disregard any Einsteinian effects. <p> We calculate the center point in a coordinate system where y coordinates increase upward. After we have calculated the center -point, we construct a <a href="ntqrect.html">TQRect</a> with size 6x6 and move its center point to +point, we construct a <a href="tqrect.html">TQRect</a> with size 6x6 and move its center point to the point calculated above. In the same operation we convert the point into the widget's coordinate system (see <a href="coordsys.html">The Coordinate System</a>). |