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/xform-example.html | 66 ++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'doc/html/xform-example.html') diff --git a/doc/html/xform-example.html b/doc/html/xform-example.html index 772cf2572..9ca9ae8c8 100644 --- a/doc/html/xform-example.html +++ b/doc/html/xform-example.html @@ -59,12 +59,12 @@ arbitrarily. #include <ntqlcdnumber.h> #include <ntqslider.h> #include <tqmenubar.h> -#include <ntqfontdialog.h> +#include <tqfontdialog.h> #include <ntqlayout.h> #include <ntqvbox.h> #include <tqwidgetstack.h> -#include <ntqpainter.h> +#include <tqpainter.h> #include <ntqpixmap.h> #include <ntqpicture.h> @@ -81,7 +81,7 @@ class XFormControl : public TQVBox, public ModeNames { TQ_OBJECT public: - XFormControl( const TQFont &initialFont, TQWidget *parent=0, const char *name=0 ); + XFormControl( const TQFont &initialFont, TQWidget *parent=0, const char *name=0 ); ~XFormControl() {} TQWMatrix matrix(); @@ -89,13 +89,13 @@ public: signals: void newMatrix( TQWMatrix ); void newText( const TQString& ); - void newFont( const TQFont & ); + void newFont( const TQFont & ); void newMode( int ); private slots: void newMtx(); void newTxt(const TQString&); void selectFont(); - void fontSelected( const TQFont & ); + void fontSelected( const TQFont & ); void changeMode(int); void timerEvent(TQTimerEvent*); private: @@ -113,7 +113,7 @@ private: TQRadioButton *rb_txt; // Radio button for text TQRadioButton *rb_img; // Radio button for image TQRadioButton *rb_pic; // Radio button for picture - TQFont currentFont; + TQFont currentFont; }; /* @@ -125,7 +125,7 @@ class ShowXForm : public TQWidget, public ModeNames { TQ_OBJECT public: - ShowXForm( const TQFont &f, TQWidget *parent=0, const char *name=0 ); + ShowXForm( const TQFont &f, TQWidget *parent=0, const char *name=0 ); ~ShowXForm() {} void showIt(); // (Re)displays text or pixmap @@ -133,14 +133,14 @@ public: public slots: void setText( const TQString& ); void setMatrix( TQWMatrix ); - void setFont( const TQFont &f ); + void setFont( const TQFont &f ); void setPixmap( TQPixmap ); void setPicture( const TQPicture& ); void setMode( int ); private: TQSizePolicy sizePolicy() const; TQSize sizeHint() const; - void paintEvent( TQPaintEvent * ); + void paintEvent( TQPaintEvent * ); void resizeEvent( TQResizeEvent * ); TQWMatrix mtx; // coordinate transform matrix TQString text; // text to be displayed @@ -150,7 +150,7 @@ private: Mode m; }; -XFormControl::XFormControl( const TQFont &initialFont, +XFormControl::XFormControl( const TQFont &initialFont, TQWidget *parent, const char *name ) : TQVBox( parent, name ) { @@ -294,14 +294,14 @@ TQWMatrix XFormControl::matrix() void XFormControl::selectFont() { bool ok; - TQFont f = TQFontDialog::getFont( &ok, currentFont ); + TQFont f = TQFontDialog::getFont( &ok, currentFont ); if ( ok ) { currentFont = f; fontSelected( f ); } } -void XFormControl::fontSelected( const TQFont &font ) +void XFormControl::fontSelected( const TQFont &font ) { emit newFont( font ); changeMode(Text); @@ -330,7 +330,7 @@ void XFormControl::changeMode(int m) tqApp->flushX(); } -ShowXForm::ShowXForm( const TQFont &initialFont, +ShowXForm::ShowXForm( const TQFont &initialFont, TQWidget *parent, const char *name ) : TQWidget( parent, name, WResizeNoErase ) { @@ -350,7 +350,7 @@ void XFormControl::changeMode(int m) return TQSize(400,400); } -void ShowXForm::paintEvent( TQPaintEvent * ) +void ShowXForm::paintEvent( TQPaintEvent * ) { showIt(); } @@ -373,7 +373,7 @@ void ShowXForm::setMatrix( TQWMatri showIt(); } -void ShowXForm::setFont( const TQFont &f ) +void ShowXForm::setFont( const TQFont &f ) { m = Text; TQWidget::setFont( f ); @@ -400,16 +400,16 @@ void ShowXForm::setMode( int mode ) void ShowXForm::showIt() { - TQPainter p; + TQPainter p; TQRect r; // rectangle covering new text/pixmap in virtual coordinates TQWMatrix um; // copy user specified transform int textYPos = 0; // distance from boundingRect y pos to baseline int textXPos = 0; // distance from boundingRect x pos to text start TQRect br; - TQFontMetrics fm( fontMetrics() ); // get widget font metrics + TQFontMetrics fm( fontMetrics() ); // get widget font metrics switch ( mode() ) { case Text: - br = fm.boundingRect( text ); // rectangle covering text + br = fm.boundingRect( text ); // rectangle covering text r = br; textYPos = -r.y(); textXPos = -r.x(); @@ -435,29 +435,29 @@ void ShowXForm::showIt() TQPixmap pm( pw, ph ); // off-screen drawing pixmap pm.fill( backgroundColor() ); - p.begin( &pm ); + p.begin( &pm ); um.translate( pw/2, ph/2 ); // 0,0 is center um = mtx * um; - p.setWorldMatrix( um ); + p.setWorldMatrix( um ); switch ( mode() ) { case Text: - p.setFont( font() ); // use widget font - p.drawText( r.left() + textXPos, r.top() + textYPos, text ); + p.setFont( font() ); // use widget font + p.drawText( r.left() + textXPos, r.top() + textYPos, text ); #if 0 - p.setPen( red ); - p.drawRect( br ); + p.setPen( red ); + p.drawRect( br ); #endif break; case Image: - p.drawPixmap( -pix.width()/2, -pix.height()/2, pix ); + p.drawPixmap( -pix.width()/2, -pix.height()/2, pix ); break; case Picture: // ### need TQPicture::boundingRect() - p.scale(0.25,0.25); - p.translate(-230,-180); - p.drawPicture( picture ); + p.scale(0.25,0.25); + p.translate(-230,-180); + p.drawPicture( picture ); } - p.end(); + p.end(); int xpos = width()/2 - pw/2; int ypos = height()/2 - ph/2; @@ -478,7 +478,7 @@ class XFormCenter : public TQHBox, public ModeNames public: XFormCenter( TQWidget *parent=0, const char *name=0 ); public slots: - void setFont( const TQFont &f ) { sx->setFont( f ); } + void setFont( const TQFont &f ) { sx->setFont( f ); } void newMode( int ); private: ShowXForm *sx; @@ -512,7 +512,7 @@ void XFormCenter::newMode( int m ) XFormCenter::XFormCenter( TQWidget *parent, const char *name ) : TQHBox( parent, name ) { - TQFont f( "Charter", 36, TQFont::Bold ); + TQFont f( "Charter", 36, TQFont::Bold ); xc = new XFormControl( f, this ); sx = new ShowXForm( f, this ); @@ -523,8 +523,8 @@ void XFormCenter::newMode( int m ) TQ_SLOT(setText(const TQString&)) ); connect( xc, TQ_SIGNAL(newMatrix(TQWMatrix)), sx, TQ_SLOT(setMatrix(TQWMatrix)) ); - connect( xc, TQ_SIGNAL(newFont(const TQFont&)), sx, - TQ_SLOT(setFont(const TQFont&)) ); + connect( xc, TQ_SIGNAL(newFont(const TQFont&)), sx, + TQ_SLOT(setFont(const TQFont&)) ); connect( xc, TQ_SIGNAL(newMode(int)), TQ_SLOT(newMode(int)) ); sx->setText( "Troll" ); newMode( Image ); -- cgit v1.2.1