diff options
Diffstat (limited to 'doc/html/desktop-example.html')
-rw-r--r-- | doc/html/desktop-example.html | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/doc/html/desktop-example.html b/doc/html/desktop-example.html index fffc382c8..64ccac086 100644 --- a/doc/html/desktop-example.html +++ b/doc/html/desktop-example.html @@ -34,7 +34,7 @@ body { background: #ffffff; color: black; } <p> The desktop demo contains three routines, each of which draws -something on the desktop. It does some nice stuff with <a href="ntqpainter.html">TQPainter</a>, +something on the desktop. It does some nice stuff with <a href="tqpainter.html">TQPainter</a>, and also demonstrates how one can treat the desktop as a widget like any other. <p> <hr> @@ -51,7 +51,7 @@ any other. #include <<a href="tqimage-h.html">tqimage.h</a>> #include <<a href="tqbitmap-h.html">tqbitmap.h</a>> -#include <<a href="qpainter-h.html">ntqpainter.h</a>> +#include <<a href="tqpainter-h.html">tqpainter.h</a>> #include <<a href="qapplication-h.html">ntqapplication.h</a>> #include <<a href="tqdropsite-h.html">tqdropsite.h</a>> #include <<a href="tqdragobject-h.html">tqdragobject.h</a>> @@ -109,12 +109,12 @@ void poly() yvel[i] = velocity(i); } - <a href="ntqpainter.html">TQPainter</a> paint; -<a name="x1733"></a> paint.<a href="ntqpainter.html#begin">begin</a>( d ); // start painting desktop + <a href="tqpainter.html">TQPainter</a> paint; +<a name="x1733"></a> paint.<a href="tqpainter.html#begin">begin</a>( d ); // start painting desktop for ( int ntimes=0; ntimes<2000; ntimes++ ) { - paint.<a href="ntqpainter.html#setBrush">setBrush</a>( TQColor(kindaRand()%360, 180, 255, TQColor::Hsv) ); -<a name="x1735"></a> paint.<a href="ntqpainter.html#drawPolygon">drawPolygon</a>( a[head] ); + paint.<a href="tqpainter.html#setBrush">setBrush</a>( TQColor(kindaRand()%360, 180, 255, TQColor::Hsv) ); +<a name="x1735"></a> paint.<a href="tqpainter.html#drawPolygon">drawPolygon</a>( a[head] ); if ( ++tail >= maxcurves ) tail = 0; @@ -147,7 +147,7 @@ void poly() a[head].setPoint( i, x, y ); } } -<a name="x1737"></a> paint.<a href="ntqpainter.html#end">end</a>(); // painting done +<a name="x1737"></a> paint.<a href="tqpainter.html#end">end</a>(); // painting done delete[] a; } @@ -190,39 +190,39 @@ void rotate() // void generateStone( <a href="ntqpixmap.html">TQPixmap</a> *pm, - const <a href="ntqcolor.html">TQColor</a> &c1, const <a href="ntqcolor.html">TQColor</a> &c2, const <a href="ntqcolor.html">TQColor</a> &c3 ) + const <a href="tqcolor.html">TQColor</a> &c1, const <a href="tqcolor.html">TQColor</a> &c2, const <a href="tqcolor.html">TQColor</a> &c3 ) { - <a href="ntqpainter.html">TQPainter</a> p; + <a href="tqpainter.html">TQPainter</a> p; <a href="ntqpen.html">TQPen</a> p1 ( c1, 0 ); <a href="ntqpen.html">TQPen</a> p2 ( c2, 0 ); <a href="ntqpen.html">TQPen</a> p3 ( c3, 0 ); - p.<a href="ntqpainter.html#begin">begin</a>( pm ); + p.<a href="tqpainter.html#begin">begin</a>( pm ); <a name="x1746"></a> for( int i = 0 ; i < pm-><a href="ntqpixmap.html#width">width</a>() ; i++ ) <a name="x1743"></a> for( int j = 0 ; j < pm-><a href="ntqpixmap.html#height">height</a>() ; j++ ) { int r = kindaRand(); if ( r < KINDA_RAND_MAX / 3 ) -<a name="x1741"></a> p.<a href="ntqpainter.html#setPen">setPen</a>( p1 ); +<a name="x1741"></a> p.<a href="tqpainter.html#setPen">setPen</a>( p1 ); else if ( r < KINDA_RAND_MAX / 3 * 2 ) - p.<a href="ntqpainter.html#setPen">setPen</a>( p2 ); + p.<a href="tqpainter.html#setPen">setPen</a>( p2 ); else - p.<a href="ntqpainter.html#setPen">setPen</a>( p3 ); -<a name="x1734"></a> p.<a href="ntqpainter.html#drawPoint">drawPoint</a>( i,j ); + p.<a href="tqpainter.html#setPen">setPen</a>( p3 ); +<a name="x1734"></a> p.<a href="tqpainter.html#drawPoint">drawPoint</a>( i,j ); } - p.<a href="ntqpainter.html#end">end</a>(); + p.<a href="tqpainter.html#end">end</a>(); } -void drawShadeText( <a href="ntqpainter.html">TQPainter</a> *p, int x, int y, const char *text, - const <a href="ntqcolor.html">TQColor</a> &topColor, const <a href="ntqcolor.html">TQColor</a> &bottomColor, +void drawShadeText( <a href="tqpainter.html">TQPainter</a> *p, int x, int y, const char *text, + const <a href="tqcolor.html">TQColor</a> &topColor, const <a href="tqcolor.html">TQColor</a> &bottomColor, int sw = 2 ) { -<a name="x1739"></a> if ( !p-><a href="ntqpainter.html#isActive">isActive</a>() ) +<a name="x1739"></a> if ( !p-><a href="tqpainter.html#isActive">isActive</a>() ) return; - p-><a href="ntqpainter.html#setPen">setPen</a>( bottomColor ); -<a name="x1736"></a> p-><a href="ntqpainter.html#drawText">drawText</a>( x+sw, y+sw, text ); - p-><a href="ntqpainter.html#setPen">setPen</a>( topColor ); - p-><a href="ntqpainter.html#drawText">drawText</a>( x, y, text ); + p-><a href="tqpainter.html#setPen">setPen</a>( bottomColor ); +<a name="x1736"></a> p-><a href="tqpainter.html#drawText">drawText</a>( x+sw, y+sw, text ); + p-><a href="tqpainter.html#setPen">setPen</a>( topColor ); + p-><a href="tqpainter.html#drawText">drawText</a>( x, y, text ); } // NOTE: desktop drag/drop is experimental @@ -232,7 +232,7 @@ class DesktopWidget : public <a href="tqwidget.html">TQWidget</a>, private TQDro public: DesktopWidget( const char *s, TQWidget *parent=0, const char *name=0 ); ~DesktopWidget(); - void paintEvent( <a href="qpaintevent.html">TQPaintEvent</a> * ); + void paintEvent( <a href="tqpaintevent.html">TQPaintEvent</a> * ); void dragEnterEvent( <a href="tqdragenterevent.html">TQDragEnterEvent</a> *e ) { @@ -276,11 +276,11 @@ DesktopWidget::~DesktopWidget() delete pm; } -void DesktopWidget::<a href="tqwidget.html#paintEvent">paintEvent</a>( <a href="qpaintevent.html">TQPaintEvent</a> * ) +void DesktopWidget::<a href="tqwidget.html#paintEvent">paintEvent</a>( <a href="tqpaintevent.html">TQPaintEvent</a> * ) { - <a href="ntqcolor.html">TQColor</a> c1 = <a href="tqwidget.html#backgroundColor">backgroundColor</a>(); -<a name="x1726"></a> <a href="ntqcolor.html">TQColor</a> c2 = c1.<a href="ntqcolor.html#light">light</a>(104); -<a name="x1725"></a> <a href="ntqcolor.html">TQColor</a> c3 = c1.<a href="ntqcolor.html#dark">dark</a>(106); + <a href="tqcolor.html">TQColor</a> c1 = <a href="tqwidget.html#backgroundColor">backgroundColor</a>(); +<a name="x1726"></a> <a href="tqcolor.html">TQColor</a> c2 = c1.<a href="tqcolor.html#light">light</a>(104); +<a name="x1725"></a> <a href="tqcolor.html">TQColor</a> c3 = c1.<a href="tqcolor.html#dark">dark</a>(106); if ( !pm ) { pm = new <a href="ntqpixmap.html">TQPixmap</a>( 64, 64 ); generateStone( pm, c1, c2, c3 ); @@ -292,10 +292,10 @@ void DesktopWidget::<a href="tqwidget.html#paintEvent">paintEvent</a>( <a href=" int x = <a href="tqwidget.html#width">width</a>()/2 - br.<a href="ntqrect.html#width">width</a>()/2; int y = <a href="tqwidget.html#height">height</a>()/2 - br.<a href="ntqrect.html#height">height</a>()/2; <a name="x1742"></a> offscreen.<a href="ntqpixmap.html#fill">fill</a>( this, x, y ); - <a href="ntqpainter.html">TQPainter</a> p; - p.<a href="ntqpainter.html#begin">begin</a>( &offscreen ); + <a href="tqpainter.html">TQPainter</a> p; + p.<a href="tqpainter.html#begin">begin</a>( &offscreen ); <a name="x1758"></a><a name="x1757"></a> drawShadeText( &p, -br.<a href="ntqrect.html#x">x</a>(), -br.<a href="ntqrect.html#y">y</a>(), text, c2, c3, 3 ); - p.<a href="ntqpainter.html#end">end</a>(); + p.<a href="tqpainter.html#end">end</a>(); <a href="tqimage.html#bitBlt">bitBlt</a>( this, x, y, &offscreen ); } @@ -311,16 +311,16 @@ void desktopText( const char *s = "Trolltech" ) { const int border = 20; -<a name="x1723"></a> <a href="ntqcolor.html">TQColor</a> c1 = tqApp-><a href="ntqapplication.html#palette">palette</a>().inactive().background(); - <a href="ntqcolor.html">TQColor</a> c2 = c1.<a href="ntqcolor.html#light">light</a>(104); - <a href="ntqcolor.html">TQColor</a> c3 = c1.<a href="ntqcolor.html#dark">dark</a>(106); +<a name="x1723"></a> <a href="tqcolor.html">TQColor</a> c1 = tqApp-><a href="ntqapplication.html#palette">palette</a>().inactive().background(); + <a href="tqcolor.html">TQColor</a> c2 = c1.<a href="tqcolor.html#light">light</a>(104); + <a href="tqcolor.html">TQColor</a> c3 = c1.<a href="tqcolor.html#dark">dark</a>(106); <a href="ntqpixmap.html">TQPixmap</a> pm(10,10); - <a href="ntqpainter.html">TQPainter</a> p; - p.<a href="ntqpainter.html#begin">begin</a>( &pm ); -<a name="x1738"></a> <a href="ntqrect.html">TQRect</a> r = p.<a href="ntqpainter.html#fontMetrics">fontMetrics</a>().boundingRect( s ); - p.<a href="ntqpainter.html#end">end</a>(); + <a href="tqpainter.html">TQPainter</a> p; + p.<a href="tqpainter.html#begin">begin</a>( &pm ); +<a name="x1738"></a> <a href="ntqrect.html">TQRect</a> r = p.<a href="tqpainter.html#fontMetrics">fontMetrics</a>().boundingRect( s ); + p.<a href="tqpainter.html#end">end</a>(); int appWidth = tqApp-><a href="ntqapplication.html#desktop">desktop</a>()->width(); int appHeight = tqApp-><a href="ntqapplication.html#desktop">desktop</a>()->height(); @@ -331,9 +331,9 @@ void desktopText( const char *s = "Trolltech" ) <a name="x1754"></a><a name="x1744"></a> pm.<a href="ntqpixmap.html#resize">resize</a>( r.<a href="ntqrect.html#size">size</a>() + TQSize( border*2, border*2 ) ); generateStone( &pm, c1, c2, c3 ); - p.<a href="ntqpainter.html#begin">begin</a>( &pm ); + p.<a href="tqpainter.html#begin">begin</a>( &pm ); drawShadeText( &p, -r.<a href="ntqrect.html#x">x</a>() + border, -r.<a href="ntqrect.html#y">y</a>() + border, s, c2, c3 ); - p.<a href="ntqpainter.html#end">end</a>(); + p.<a href="tqpainter.html#end">end</a>(); tqApp-><a href="ntqapplication.html#desktop">desktop</a>()->setBackgroundPixmap( pm ); } @@ -347,8 +347,8 @@ int main( int argc, char **argv ) <a href="ntqapplication.html">TQApplication</a> app( argc, argv ); if ( argc > 1 ) { - <a href="ntqfont.html">TQFont</a> f( "charter", 96, TQFont::Black ); -<a name="x1728"></a> f.<a href="ntqfont.html#setStyleHint">setStyleHint</a>( TQFont::Times ); + <a href="tqfont.html">TQFont</a> f( "charter", 96, TQFont::Black ); +<a name="x1728"></a> f.<a href="tqfont.html#setStyleHint">setStyleHint</a>( TQFont::Times ); <a name="x1724"></a> app.<a href="ntqapplication.html#setFont">setFont</a>( f ); } |