diff options
author | Michele Calgaro <[email protected]> | 2024-07-20 20:15:52 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2024-07-21 23:04:19 +0900 |
commit | 1e9fa8e06de5da7fcc268e9cccb2d6b21c5f53a3 (patch) | |
tree | 5f1bb482f68ee0f95843fbf375cd2274acdabf25 /doc/html/xform-example.html | |
parent | 14c414378d96f7463b989384f4a0e5dd76632b6d (diff) | |
download | tqt3-1e9fa8e06de5da7fcc268e9cccb2d6b21c5f53a3.tar.gz tqt3-1e9fa8e06de5da7fcc268e9cccb2d6b21c5f53a3.zip |
Rename graphics class nt* related files to equivalent tq* (part 2)
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'doc/html/xform-example.html')
-rw-r--r-- | doc/html/xform-example.html | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/doc/html/xform-example.html b/doc/html/xform-example.html index 9ca9ae8c8..7a7752c68 100644 --- a/doc/html/xform-example.html +++ b/doc/html/xform-example.html @@ -65,8 +65,8 @@ arbitrarily. #include <<a href="tqwidgetstack-h.html">tqwidgetstack.h</a>> #include <<a href="tqpainter-h.html">tqpainter.h</a>> -#include <<a href="qpixmap-h.html">ntqpixmap.h</a>> -#include <<a href="qpicture-h.html">ntqpicture.h</a>> +#include <<a href="tqpixmap-h.html">tqpixmap.h</a>> +#include <<a href="tqpicture-h.html">tqpicture.h</a>> #include <stdlib.h> @@ -84,10 +84,10 @@ public: XFormControl( const <a href="tqfont.html">TQFont</a> &initialFont, TQWidget *parent=0, const char *name=0 ); ~XFormControl() {} - <a href="ntqwmatrix.html">TQWMatrix</a> matrix(); + <a href="tqwmatrix.html">TQWMatrix</a> matrix(); signals: - void newMatrix( <a href="ntqwmatrix.html">TQWMatrix</a> ); + void newMatrix( <a href="tqwmatrix.html">TQWMatrix</a> ); void newText( const <a href="tqstring.html">TQString</a>& ); void newFont( const <a href="tqfont.html">TQFont</a> & ); void newMode( int ); @@ -118,7 +118,7 @@ private: /* ShowXForm displays a text or a pixmap (TQPixmap) using a coordinate - <a href="ntqwmatrix.html#TransformationMode">transformation matrix</a> (TQWMatrix) + <a href="tqwmatrix.html#TransformationMode">transformation matrix</a> (TQWMatrix) */ class ShowXForm : public <a href="tqwidget.html">TQWidget</a>, public ModeNames @@ -132,21 +132,21 @@ public: Mode mode() const { return m; } public slots: void setText( const <a href="tqstring.html">TQString</a>& ); - void setMatrix( <a href="ntqwmatrix.html">TQWMatrix</a> ); + void setMatrix( <a href="tqwmatrix.html">TQWMatrix</a> ); void setFont( const <a href="tqfont.html">TQFont</a> &f ); - void setPixmap( <a href="ntqpixmap.html">TQPixmap</a> ); - void setPicture( const <a href="ntqpicture.html">TQPicture</a>& ); + void setPixmap( <a href="tqpixmap.html">TQPixmap</a> ); + void setPicture( const <a href="tqpicture.html">TQPicture</a>& ); void setMode( int ); private: <a href="tqsizepolicy.html">TQSizePolicy</a> sizePolicy() const; <a href="tqsize.html">TQSize</a> sizeHint() const; void paintEvent( <a href="tqpaintevent.html">TQPaintEvent</a> * ); void resizeEvent( <a href="qresizeevent.html">TQResizeEvent</a> * ); - <a href="ntqwmatrix.html">TQWMatrix</a> mtx; // coordinate transform matrix + <a href="tqwmatrix.html">TQWMatrix</a> mtx; // coordinate transform matrix <a href="tqstring.html">TQString</a> text; // text to be displayed - <a href="ntqpixmap.html">TQPixmap</a> pix; // pixmap to be displayed - <a href="ntqpicture.html">TQPicture</a> picture; // text to be displayed - <a href="ntqrect.html">TQRect</a> eraseRect; // covers last displayed text/pixmap + <a href="tqpixmap.html">TQPixmap</a> pix; // pixmap to be displayed + <a href="tqpicture.html">TQPicture</a> picture; // text to be displayed + <a href="tqrect.html">TQRect</a> eraseRect; // covers last displayed text/pixmap Mode m; }; @@ -263,17 +263,17 @@ void <a name="f399"></a>XFormControl::newTxt(const <a href="tqstring.html">TQStr */ TQWMatrix <a name="f400"></a>XFormControl::matrix() { - <a href="ntqwmatrix.html">TQWMatrix</a> m; + <a href="tqwmatrix.html">TQWMatrix</a> m; if (mode != Text) { double magVal = 1.0*magS-><a href="ntqslider.html#value">value</a>()/100; -<a name="x1281"></a> m.<a href="ntqwmatrix.html#scale">scale</a>( magVal, magVal ); +<a name="x1281"></a> m.<a href="tqwmatrix.html#scale">scale</a>( magVal, magVal ); } double shearVal = 1.0*shearS-><a href="ntqslider.html#value">value</a>()/25; -<a name="x1282"></a> m.<a href="ntqwmatrix.html#shear">shear</a>( shearVal, shearVal ); -<a name="x1280"></a> m.<a href="ntqwmatrix.html#rotate">rotate</a>( rotS-><a href="ntqslider.html#value">value</a>() ); +<a name="x1282"></a> m.<a href="tqwmatrix.html#shear">shear</a>( shearVal, shearVal ); +<a name="x1280"></a> m.<a href="tqwmatrix.html#rotate">rotate</a>( rotS-><a href="ntqslider.html#value">value</a>() ); <a name="x1223"></a> if ( mirror-><a href="ntqcheckbox.html#isChecked">isChecked</a>() ) { - m.<a href="ntqwmatrix.html#scale">scale</a>( 1, -1 ); - m.<a href="ntqwmatrix.html#rotate">rotate</a>( 180 ); + m.<a href="tqwmatrix.html#scale">scale</a>( 1, -1 ); + m.<a href="tqwmatrix.html#rotate">rotate</a>( 180 ); } <a href="tqstring.html">TQString</a> tmp; @@ -367,7 +367,7 @@ void <a name="f389"></a>ShowXForm::setText( const <a href="tqstring.html">TQStri showIt(); } -void <a name="f390"></a>ShowXForm::setMatrix( <a href="ntqwmatrix.html">TQWMatrix</a> w ) +void <a name="f390"></a>ShowXForm::setMatrix( <a href="tqwmatrix.html">TQWMatrix</a> w ) { mtx = w; showIt(); @@ -379,14 +379,14 @@ void <a name="f390"></a>ShowXForm::setMatrix( <a href="ntqwmatrix.html">TQWMatri TQWidget::<a href="tqwidget.html#setFont">setFont</a>( f ); } -void <a name="f391"></a>ShowXForm::setPixmap( <a href="ntqpixmap.html">TQPixmap</a> pm ) +void <a name="f391"></a>ShowXForm::setPixmap( <a href="tqpixmap.html">TQPixmap</a> pm ) { pix = pm; m = Image; showIt(); } -void <a name="f392"></a>ShowXForm::setPicture( const <a href="ntqpicture.html">TQPicture</a>& p ) +void <a name="f392"></a>ShowXForm::setPicture( const <a href="tqpicture.html">TQPicture</a>& p ) { picture = p; m = Picture; @@ -401,55 +401,55 @@ void <a name="f393"></a>ShowXForm::setMode( int mode ) void <a name="f394"></a>ShowXForm::showIt() { <a href="tqpainter.html">TQPainter</a> p; - <a href="ntqrect.html">TQRect</a> r; // rectangle covering new text/pixmap in virtual coordinates - <a href="ntqwmatrix.html">TQWMatrix</a> um; // copy user specified transform + <a href="tqrect.html">TQRect</a> r; // rectangle covering new text/pixmap in virtual coordinates + <a href="tqwmatrix.html">TQWMatrix</a> 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 - <a href="ntqrect.html">TQRect</a> br; + <a href="tqrect.html">TQRect</a> br; <a href="tqfontmetrics.html">TQFontMetrics</a> fm( <a href="tqwidget.html#fontMetrics">fontMetrics</a>() ); // get widget font metrics switch ( mode() ) { case Text: <a name="x1225"></a> br = fm.<a href="tqfontmetrics.html#boundingRect">boundingRect</a>( text ); // rectangle covering text r = br; - textYPos = -r.<a href="ntqrect.html#y">y</a>(); - textXPos = -r.<a href="ntqrect.html#x">x</a>(); -<a name="x1258"></a><a name="x1254"></a><a name="x1251"></a> br.<a href="ntqrect.html#moveTopLeft">moveTopLeft</a>( TQPoint( -br.<a href="ntqrect.html#width">width</a>()/2, -br.<a href="ntqrect.html#height">height</a>()/2 ) ); + textYPos = -r.<a href="tqrect.html#y">y</a>(); + textXPos = -r.<a href="tqrect.html#x">x</a>(); +<a name="x1258"></a><a name="x1254"></a><a name="x1251"></a> br.<a href="tqrect.html#moveTopLeft">moveTopLeft</a>( TQPoint( -br.<a href="tqrect.html#width">width</a>()/2, -br.<a href="tqrect.html#height">height</a>()/2 ) ); break; case Image: -<a name="x1248"></a><a name="x1246"></a> r = TQRect(0, 0, pix.<a href="ntqpixmap.html#width">width</a>()+1, pix.<a href="ntqpixmap.html#height">height</a>()+1); +<a name="x1248"></a><a name="x1246"></a> r = TQRect(0, 0, pix.<a href="tqpixmap.html#width">width</a>()+1, pix.<a href="tqpixmap.html#height">height</a>()+1); break; case Picture: // ### need TQPicture::boundingRect() r = TQRect(0,0,1000,1000); break; } - r.<a href="ntqrect.html#moveTopLeft">moveTopLeft</a>( TQPoint(-r.<a href="ntqrect.html#width">width</a>()/2, -r.<a href="ntqrect.html#height">height</a>()/2) ); -<a name="x1253"></a> r.<a href="ntqrect.html#moveBy">moveBy</a>( -1, -1 ); // add border for matrix round off -<a name="x1255"></a> r.<a href="ntqrect.html#setSize">setSize</a>( TQSize( r.<a href="ntqrect.html#width">width</a>() + 2,r.<a href="ntqrect.html#height">height</a>() + 2 ) ); + r.<a href="tqrect.html#moveTopLeft">moveTopLeft</a>( TQPoint(-r.<a href="tqrect.html#width">width</a>()/2, -r.<a href="tqrect.html#height">height</a>()/2) ); +<a name="x1253"></a> r.<a href="tqrect.html#moveBy">moveBy</a>( -1, -1 ); // add border for matrix round off +<a name="x1255"></a> r.<a href="tqrect.html#setSize">setSize</a>( TQSize( r.<a href="tqrect.html#width">width</a>() + 2,r.<a href="tqrect.html#height">height</a>() + 2 ) ); // compute union of new and old rect // the resulting rectangle will cover what is already displayed // and have room for the new text/pixmap -<a name="x1279"></a><a name="x1257"></a> eraseRect = eraseRect.<a href="ntqrect.html#unite">unite</a>( mtx.<a href="ntqwmatrix.html#mapRect">mapRect</a>(r) ); - int pw = TQMIN(eraseRect.<a href="ntqrect.html#width">width</a>(),width()); - int ph = TQMIN(eraseRect.<a href="ntqrect.html#height">height</a>(),height()); - <a href="ntqpixmap.html">TQPixmap</a> pm( pw, ph ); // off-screen drawing pixmap -<a name="x1245"></a> pm.<a href="ntqpixmap.html#fill">fill</a>( <a href="tqwidget.html#backgroundColor">backgroundColor</a>() ); +<a name="x1279"></a><a name="x1257"></a> eraseRect = eraseRect.<a href="tqrect.html#unite">unite</a>( mtx.<a href="tqwmatrix.html#mapRect">mapRect</a>(r) ); + int pw = TQMIN(eraseRect.<a href="tqrect.html#width">width</a>(),width()); + int ph = TQMIN(eraseRect.<a href="tqrect.html#height">height</a>(),height()); + <a href="tqpixmap.html">TQPixmap</a> pm( pw, ph ); // off-screen drawing pixmap +<a name="x1245"></a> pm.<a href="tqpixmap.html#fill">fill</a>( <a href="tqwidget.html#backgroundColor">backgroundColor</a>() ); <a name="x1233"></a> p.<a href="tqpainter.html#begin">begin</a>( &pm ); -<a name="x1283"></a> um.<a href="ntqwmatrix.html#translate">translate</a>( pw/2, ph/2 ); // 0,0 is center +<a name="x1283"></a> um.<a href="tqwmatrix.html#translate">translate</a>( pw/2, ph/2 ); // 0,0 is center um = mtx * um; <a name="x1242"></a> p.<a href="tqpainter.html#setWorldMatrix">setWorldMatrix</a>( um ); switch ( mode() ) { case Text: <a name="x1240"></a> p.<a href="tqpainter.html#setFont">setFont</a>( <a href="tqwidget.html#font">font</a>() ); // use widget font -<a name="x1256"></a><a name="x1252"></a> p.<a href="tqpainter.html#drawText">drawText</a>( r.<a href="ntqrect.html#left">left</a>() + textXPos, r.<a href="ntqrect.html#top">top</a>() + textYPos, text ); +<a name="x1256"></a><a name="x1252"></a> p.<a href="tqpainter.html#drawText">drawText</a>( r.<a href="tqrect.html#left">left</a>() + textXPos, r.<a href="tqrect.html#top">top</a>() + textYPos, text ); #if 0 p.<a href="tqpainter.html#setPen">setPen</a>( red ); p.<a href="tqpainter.html#drawRect">drawRect</a>( br ); #endif break; case Image: -<a name="x1235"></a> p.<a href="tqpainter.html#drawPixmap">drawPixmap</a>( -pix.<a href="ntqpixmap.html#width">width</a>()/2, -pix.<a href="ntqpixmap.html#height">height</a>()/2, pix ); +<a name="x1235"></a> p.<a href="tqpainter.html#drawPixmap">drawPixmap</a>( -pix.<a href="tqpixmap.html#width">width</a>()/2, -pix.<a href="tqpixmap.html#height">height</a>()/2, pix ); break; case Picture: // ### need TQPicture::boundingRect() @@ -463,7 +463,7 @@ void <a name="f394"></a>ShowXForm::showIt() int ypos = <a href="tqwidget.html#height">height</a>()/2 - ph/2; <a href="tqimage.html#bitBlt">bitBlt</a>( this, xpos, ypos, // copy pixmap to widget &pm, 0, 0, -1, -1 ); -<a name="x1278"></a> eraseRect = mtx.<a href="ntqwmatrix.html#map">map</a>( r ); +<a name="x1278"></a> eraseRect = mtx.<a href="tqwmatrix.html#map">map</a>( r ); } @@ -494,15 +494,15 @@ void <a name="f395"></a>XFormCenter::newMode( int m ) return; if ( m == Image && first_i ) { first_i = FALSE; - <a href="ntqpixmap.html">TQPixmap</a> pm; -<a name="x1247"></a> if ( pm.<a href="ntqpixmap.html#load">load</a>( "image.any" ) ) + <a href="tqpixmap.html">TQPixmap</a> pm; +<a name="x1247"></a> if ( pm.<a href="tqpixmap.html#load">load</a>( "image.any" ) ) sx->setPixmap( pm ); return; } if ( m == Picture && first_p ) { first_p = FALSE; - <a href="ntqpicture.html">TQPicture</a> p; -<a name="x1244"></a> if (p.<a href="ntqpicture.html#load">load</a>( "picture.any" )) + <a href="tqpicture.html">TQPicture</a> p; +<a name="x1244"></a> if (p.<a href="tqpicture.html#load">load</a>( "picture.any" )) sx->setPicture( p ); return; } |