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/drawdemo-example.html | 86 +++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'doc/html/drawdemo-example.html') diff --git a/doc/html/drawdemo-example.html b/doc/html/drawdemo-example.html index 07c90e8c4..5ecd477c6 100644 --- a/doc/html/drawdemo-example.html +++ b/doc/html/drawdemo-example.html @@ -48,7 +48,7 @@ You can easily add you own drawing functions. *****************************************************************************/ #include <tqwidget.h> -#include <ntqpainter.h> +#include <tqpainter.h> #include <ntqprinter.h> #include <ntqpushbutton.h> #include <ntqradiobutton.h> @@ -66,12 +66,12 @@ You can easily add you own drawing functions. // The coordinate system x=(0..500), y=(0..500) spans the paint device. // -void drawColorWheel( TQPainter *p ) +void drawColorWheel( TQPainter *p ) { - TQFont f( "times", 18, TQFont::Bold ); - p->setFont( f ); - p->setPen( TQt::black ); - p->setWindow( 0, 0, 500, 500 ); // defines coordinate system + TQFont f( "times", 18, TQFont::Bold ); + p->setFont( f ); + p->setPen( TQt::black ); + p->setWindow( 0, 0, 500, 500 ); // defines coordinate system for ( int i=0; i<36; i++ ) { // draws 36 rotated rectangles @@ -79,16 +79,16 @@ void drawColorWheel( TQPainter *p ) matrix.translate( 250.0F, 250.0F ); // move to center matrix.shear( 0.0F, 0.3F ); // twist it matrix.rotate( (float)i*10 ); // rotate 0,10,20,.. degrees - p->setWorldMatrix( matrix ); // use this world matrix + p->setWorldMatrix( matrix ); // use this world matrix - TQColor c; - c.setHsv( i*10, 255, 255 ); // rainbow effect - p->setBrush( c ); // solid fill with color c - p->drawRect( 70, -10, 80, 10 ); // draw the rectangle + TQColor c; + c.setHsv( i*10, 255, 255 ); // rainbow effect + p->setBrush( c ); // solid fill with color c + p->drawRect( 70, -10, 80, 10 ); // draw the rectangle TQString n; n.sprintf( "H=%d", i*10 ); - p->drawText( 80+70+5, 0, n ); // draw the hue number + p->drawText( 80+70+5, 0, n ); // draw the hue number } } @@ -97,7 +97,7 @@ void drawColorWheel( TQPainter *p ) // This function draws a few lines of text using different fonts. // -void drawFonts( TQPainter *p ) +void drawFonts( TQPainter *p ) { static const char *fonts[] = { "Helvetica", "Courier", "Times", 0 }; static int sizes[] = { 10, 12, 18, 24, 36, 0 }; @@ -106,12 +106,12 @@ void drawFonts( TQPainter *p ) while ( fonts[f] ) { int s = 0; while ( sizes[s] ) { - TQFont font( fonts[f], sizes[s] ); - p->setFont( font ); - TQFontMetrics fm = p->fontMetrics(); - y += fm.ascent(); - p->drawText( 10, y, "Quartz Glyph Job Vex'd Cwm Finks" ); - y += fm.descent(); + TQFont font( fonts[f], sizes[s] ); + p->setFont( font ); + TQFontMetrics fm = p->fontMetrics(); + y += fm.ascent(); + p->drawText( 10, y, "Quartz Glyph Job Vex'd Cwm Finks" ); + y += fm.descent(); s++; } f++; @@ -123,22 +123,22 @@ void drawFonts( TQPainter *p ) // This function draws some shapes // -void drawShapes( TQPainter *p ) +void drawShapes( TQPainter *p ) { - TQBrush b1( TQt::blue ); - TQBrush b2( TQt::green, TQt::Dense6Pattern ); // green 12% fill - TQBrush b3( TQt::NoBrush ); // void brush - TQBrush b4( TQt::CrossPattern ); // black cross pattern - - p->setPen( TQt::red ); - p->setBrush( b1 ); - p->drawRect( 10, 10, 200, 100 ); - p->setBrush( b2 ); - p->drawRoundRect( 10, 150, 200, 100, 20, 20 ); - p->setBrush( b3 ); - p->drawEllipse( 250, 10, 200, 100 ); - p->setBrush( b4 ); - p->drawPie( 250, 150, 200, 100, 45*16, 90*16 ); + TQBrush b1( TQt::blue ); + TQBrush b2( TQt::green, TQt::Dense6Pattern ); // green 12% fill + TQBrush b3( TQt::NoBrush ); // void brush + TQBrush b4( TQt::CrossPattern ); // black cross pattern + + p->setPen( TQt::red ); + p->setBrush( b1 ); + p->drawRect( 10, 10, 200, 100 ); + p->setBrush( b2 ); + p->drawRoundRect( 10, 150, 200, 100, 20, 20 ); + p->setBrush( b3 ); + p->drawEllipse( 250, 10, 200, 100 ); + p->setBrush( b4 ); + p->drawPie( 250, 150, 200, 100, 45*16, 90*16 ); } @@ -178,8 +178,8 @@ public slots: void updateIt( int ); void printIt(); protected: - void drawIt( TQPainter * ); - void paintEvent( TQPaintEvent * ); + void drawIt( TQPainter * ); + void paintEvent( TQPaintEvent * ); void resizeEvent( TQResizeEvent * ); private: TQPrinter *printer; @@ -209,13 +209,13 @@ private: int maxheight = 10; int i; const char *n; - TQFontMetrics fm = bgroup->fontMetrics(); + TQFontMetrics fm = bgroup->fontMetrics(); // Find out the longest function description. // Here we make use of the last "0,0"-entry in the // ourDrawFunctions-array. for ( i=0; (n=ourDrawFunctions[i].name) != 0; i++ ) { - int w = fm.width( n ); + int w = fm.width( n ); maxwidth = TQMAX(w,maxwidth); // TQMAX is a macro defined in ntqglobal.h // and returns the biggest of to values. // Due to its macro nature one should use it with care and with @@ -295,7 +295,7 @@ void DrawView::updateIt( int index ) // Calls the drawing function as specified by the radio buttons. // -void DrawView::drawIt( TQPainter *p ) +void DrawView::drawIt( TQPainter *p ) { (*ourDrawFunctions[drawindex].f)(p); } @@ -307,8 +307,8 @@ void DrawView::drawIt( TQPainterDrawView::printIt() { if ( printer->setup( this ) ) { - TQPainter paint; - if( !paint.begin( printer ) ) + TQPainter paint; + if( !paint.begin( printer ) ) return; drawIt( &paint ); } @@ -318,9 +318,9 @@ void DrawView::printIt() // Called when the widget needs to be updated. // -void DrawView::paintEvent( TQPaintEvent * ) +void DrawView::paintEvent( TQPaintEvent * ) { - TQPainter paint( this ); + TQPainter paint( this ); drawIt( &paint ); } -- cgit v1.2.1