diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-05-30 14:27:29 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-06-25 16:43:08 +0900 |
| commit | 35ced32e331ee29fda1642616c803637952f5b22 (patch) | |
| tree | da44726777f814e19c7ef1e43854f6a1693dd6fb /doc/html/tutorial1-14.html | |
| parent | 7dd4848d61e4c52091d6c644356c84c67536bde2 (diff) | |
| download | tqt-35ced32e331ee29fda1642616c803637952f5b22.tar.gz tqt-35ced32e331ee29fda1642616c803637952f5b22.zip | |
Replace TRUE/FALSE with boolean values true/false - part 1
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit a7f1e6e2552d9cdbb3d76bff089db522248b9a24)
Diffstat (limited to 'doc/html/tutorial1-14.html')
| -rw-r--r-- | doc/html/tutorial1-14.html | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/html/tutorial1-14.html b/doc/html/tutorial1-14.html index 094c8081c..9d7a692e3 100644 --- a/doc/html/tutorial1-14.html +++ b/doc/html/tutorial1-14.html @@ -80,13 +80,13 @@ three mouse event handlers. The names say it all. <p> This private function checks if a point is inside the barrel of the cannon. <p> <pre> bool barrelPressed; </pre> -<p> This private variable is TRUE if the user has pressed the mouse on the +<p> This private variable is true if the user has pressed the mouse on the barrel and not released it. <p> <h3> <a href="t14-cannon-cpp.html">t14/cannon.cpp</a> </h3> <a name="1-2"></a><p> -<p> <pre> barrelPressed = FALSE; +<p> <pre> barrelPressed = false; </pre> <p> This line has been added to the constructor. Initially, the mouse is not pressed on the barrel. @@ -100,7 +100,7 @@ the third, too. if ( e-><a href="qmouseevent.html#button">button</a>() != LeftButton ) return; <a name="x2418"></a> if ( barrelHit( e-><a href="qmouseevent.html#pos">pos</a>() ) ) - barrelPressed = TRUE; + barrelPressed = true; } </pre> <p> This is a TQt event handler. It is called when the user presses a @@ -108,7 +108,7 @@ mouse button when the mouse cursor is over the widget. <p> If the event was not generated by the left mouse button, we return immediately. Otherwise, we check if the position of the mouse cursor is within the cannon's barrel. If it is, we set <tt>barrelPressed</tt> to -TRUE. +true. <p> Notice that the pos() function returns a point in the widget's coordinate system. <p> <pre> void CannonField::<a href="ntqwidget.html#mouseMoveEvent">mouseMoveEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> *e ) @@ -141,7 +141,7 @@ value converted to degrees. <p> <pre> <a name="x2432"></a>void CannonField::<a href="ntqwidget.html#mouseReleaseEvent">mouseReleaseEvent</a>( <a href="qmouseevent.html">TQMouseEvent</a> *e ) { <a name="x2417"></a> if ( e-><a href="qmouseevent.html#button">button</a>() == LeftButton ) - barrelPressed = FALSE; + barrelPressed = false; } </pre> <p> This TQt event handler is called whenever the user releases a mouse @@ -179,8 +179,8 @@ the bottom edge of the barrier to the bottom edge of the widget. <a name="x2434"></a><a name="x2426"></a> return barrelRect.<a href="ntqrect.html#contains">contains</a>( mtx.<a href="ntqwmatrix.html#map">map</a>(p) ); } </pre> -<p> This function returns TRUE if the point is in the barrel; otherwise it returns -FALSE. +<p> This function returns true if the point is in the barrel; otherwise it returns +false. <p> Here we use the class <a href="ntqwmatrix.html">TQWMatrix</a>. It is defined in the header file ntqwmatrix.h, which is included by ntqpainter.h. <p> <a href="ntqwmatrix.html">TQWMatrix</a> defines a coordinate system mapping. It can perform the same @@ -192,7 +192,7 @@ coordinate system and then we rotate it. inside the barrel. To do this, we invert the <a href="ntqwmatrix.html#TransformationMode">transformation matrix</a>. The inverted matrix performs the inverse transformation that we used when drawing the barrel. We map the point <tt>p</tt> using the inverted -matrix and return TRUE if it is inside the original barrel rectangle. +matrix and return true if it is inside the original barrel rectangle. <p> <h3> <a href="t14-gamebrd-cpp.html">t14/gamebrd.cpp</a> </h3> <a name="1-3"></a><p> |
