From 35ced32e331ee29fda1642616c803637952f5b22 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 30 May 2025 14:27:29 +0900 Subject: Replace TRUE/FALSE with boolean values true/false - part 1 Signed-off-by: Michele Calgaro (cherry picked from commit a7f1e6e2552d9cdbb3d76bff089db522248b9a24) --- doc/html/tutorial2-05.html | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'doc/html/tutorial2-05.html') diff --git a/doc/html/tutorial2-05.html b/doc/html/tutorial2-05.html index ade4d2572..81b3394a2 100644 --- a/doc/html/tutorial2-05.html +++ b/doc/html/tutorial2-05.html @@ -53,7 +53,7 @@ conventional document-centric style. ~ChartForm(); int chartType() { return m_chartType; } - void setChanged( bool changed = TRUE ) { m_changed = changed; } + void setChanged( bool changed = true ) { m_changed = changed; } void drawElements(); TQPopupMenu *optionsMenu; // Why public? See canvasview.cpp @@ -178,19 +178,19 @@ menu options and toolbar buttons must be automatically unselected. This behaviour is achieved by creating a TQActionGroup and placing the chart type actions in the group.

        TQActionGroup *chartGroup = new TQActionGroup( this ); // Connected later
-        chartGroup->setExclusive( TRUE );
+        chartGroup->setExclusive( true );
 

The action group becomes a child of the form (this) and the exlusive behaviour is achieved by the setExclusive() call.

        optionsPieChartAction = new TQAction(
                 "Pie Chart", TQPixmap( options_piechart ),
                 "&Pie Chart", CTRL+Key_I, chartGroup, "pie chart" );
-        optionsPieChartAction->setToggleAction( TRUE );
+        optionsPieChartAction->setToggleAction( true );
 

Each action in the group is created in the same way as other actions, except that the action's parent is the group rather than the form. Because our chart type actions have an on/off state we call -setToggleAction(TRUE) for each of them. Note that we do not connect +setToggleAction(true) for each of them. Note that we do not connect the actions; instead, later on, we will connect the group to a slot that will cause the canvas to redraw.

@@ -300,10 +300,9 @@ call ensures that a status bar is created for this main window.

init()

    void ChartForm::init()
-    {
         setCaption( "Chart" );
         m_filename = TQString::null;
-        m_changed = FALSE;
+        m_changed = false;
 
         m_elements[0]  = Element( Element::INVALID, red );
         m_elements[1]  = Element( Element::INVALID, cyan );
@@ -341,13 +340,13 @@ already have a unique color (which they can change of course).
                     break;
                 case 1: // Cancel
                 default:
-                    return FALSE;
+                    return false;
                 case 2: // Abandon
                     break;
             }
         }
 
-        return TRUE;
+        return true;
     }
 

The okToClear() function is used to prompt the user to save their @@ -556,7 +555,7 @@ elements. { SetDataForm *setDataForm = new SetDataForm( &m_elements, m_decimalPlaces, this ); if ( setDataForm->exec() ) { - m_changed = TRUE; + m_changed = true; drawElements(); } delete setDataForm; -- cgit v1.2.3