From 0917fbb5387978eb7b2e2fd68bcb6beaa8c46505 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 25 Aug 2024 15:36:25 +0900 Subject: Rename remaining ntq[a-c]* related files to equivalent tq* (except ntqapplication.h and ntqconfig.h) Signed-off-by: Michele Calgaro --- doc/html/tutorial1-14.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'doc/html/tutorial1-14.html') diff --git a/doc/html/tutorial1-14.html b/doc/html/tutorial1-14.html index 6ad3faebf..6e1712f1c 100644 --- a/doc/html/tutorial1-14.html +++ b/doc/html/tutorial1-14.html @@ -197,9 +197,9 @@ matrix and return TRUE if it is inside the original barrel rectangle.

-

    #include <ntqaccel.h>
+

    #include <tqaccel.h>
 
-

We include the class definition of TQAccel. +

We include the class definition of TQAccel.

        TQVBox *box = new TQVBox( this, "cannonFrame" );
         box->setFrameStyle( TQFrame::WinPanel | TQFrame::Sunken );
         cannonField = new CannonField( box, "cannonField" );
@@ -208,24 +208,24 @@ matrix and return TRUE if it is inside the original barrel rectangle.
 CannonField as a child of that box. Because nothing else is in the
 box, the effect is that the TQVBox will put a frame around the
 CannonField.
-

        TQAccel *accel = new TQAccel( this );
-        accel->connectItem( accel->insertItem( Key_Enter ),
+

        TQAccel *accel = new TQAccel( this );
+        accel->connectItem( accel->insertItem( Key_Enter ),
                             this, TQ_SLOT(fire()) );
-        accel->connectItem( accel->insertItem( Key_Return ),
+        accel->connectItem( accel->insertItem( Key_Return ),
                             this, TQ_SLOT(fire()) );
 

Here we create and set up an accelerator. An accelerator is an object that intercepts keyboard events to an application and calls slots if certain keys are pressed. This mechanism is also called shortcut keys. Note that an accelerator is a child of a widget and will be -destroyed when that widget is destroyed. TQAccel is not a widget +destroyed when that widget is destroyed. TQAccel is not a widget and has no visible effect on its parent.

We define two shortcut keys. We want the slot fire() to be called when the user presses Enter, and we want the application to quit when key Ctrl+Q is pressed. Because Enter is sometimes Return and there are even keyboards with both keys, we make both Enter and Return invoke fire(). -

        accel->connectItem( accel->insertItem( CTRL+Key_Q ),
+

        accel->connectItem( accel->insertItem( CTRL+Key_Q ),
                             tqApp, TQ_SLOT(quit()) );
 

And then we set up Ctrl+Q to do the same thing as Alt+Q. Some -- cgit v1.2.3