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/themes-example.html | 342 +++++++++++++++++++++---------------------- 1 file changed, 171 insertions(+), 171 deletions(-) (limited to 'doc/html/themes-example.html') diff --git a/doc/html/themes-example.html b/doc/html/themes-example.html index 1a6d2da1..8c0ac4f8 100644 --- a/doc/html/themes-example.html +++ b/doc/html/themes-example.html @@ -74,38 +74,38 @@ public: void unPolish( TQApplication*); void drawPrimitive( PrimitiveElement pe, - TQPainter *p, + TQPainter *p, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags flags = Style_Default, const TQStyleOption& = TQStyleOption::Default ) const; void drawControl( ControlElement element, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags how = Style_Default, const TQStyleOption& = TQStyleOption::Default ) const; void drawControlMask( ControlElement element, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControl( ComplexControl cc, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags how = Style_Default, SCFlags sub = SC_All, SCFlags subActive = SC_None, const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControlMask( ComplexControl control, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, const TQStyleOption& = TQStyleOption::Default ) const; @@ -120,7 +120,7 @@ public: private: void drawSemicircleButton(TQPainter *p, const TQRect &r, int dir, - bool sunken, const TQColorGroup &g ) const; + bool sunken, const TQColorGroup &g ) const; TQPalette oldPalette; TQPixmap *sunkenDark; TQPixmap *sunkenLight; @@ -150,7 +150,7 @@ private: #include "ntqapplication.h" #include "ntqcombobox.h" -#include "ntqpainter.h" +#include "tqpainter.h" #include "ntqdrawutil.h" // for now #include "ntqpixmap.h" // for now #include "ntqpalette.h" // for now @@ -882,7 +882,7 @@ static const char *button_xpm[] = { ".rb..g.e#s.YaPbV#z.wbnbV.wbn#Dbn.OaP.4.y.4#N.K.K#T#t.U.Q#z.w#F#YazanaNan.bap#Ga0az#0#P#b#KbR.Z#aaz#ibK#h#u.wbC#B#b.1bebs#B#D#baLbcbA.k#P#G#E#S#2.K.8bAbL.Tbw.6.K#G#0.wbVbVbV#s#s.e.Oba.K.4aT.k.0" }; -static void drawroundrect( TQPainter *p, TQCOORD x, TQCOORD y, +static void drawroundrect( TQPainter *p, TQCOORD x, TQCOORD y, TQCOORD w, TQCOORD h, TQCOORD d ); static inline int buttonthickness( int d ); @@ -924,8 +924,8 @@ enum { PointUp, PointDown, PointLeft, PointRight }; int i; for (i=0; i<img.numColors(); i++) { TQRgb rgb = img.color(i); - TQColor c(rgb); - rgb = c.dark(120).rgb(); + TQColor c(rgb); + rgb = c.dark(120).rgb(); img.setColor(i,rgb); } TQPixmap mid; @@ -935,8 +935,8 @@ enum { PointUp, PointDown, PointLeft, PointRight }; img.detach(); for (i=0; i<img.numColors(); i++) { TQRgb rgb = img.color(i); - TQColor c(rgb); - rgb = c.light().rgb(); + TQColor c(rgb); + rgb = c.light().rgb(); img.setColor(i,rgb); } TQPixmap light; @@ -946,8 +946,8 @@ enum { PointUp, PointDown, PointLeft, PointRight }; img.detach(); for (i=0; i<img.numColors(); i++) { TQRgb rgb = img.color(i); - TQColor c(rgb); - rgb = c.dark(180).rgb(); + TQColor c(rgb); + rgb = c.dark(180).rgb(); img.setColor(i,rgb); } TQPixmap dark; @@ -962,8 +962,8 @@ enum { PointUp, PointDown, PointLeft, PointRight }; img.detach(); for (i=0; i<img.numColors(); i++) { TQRgb rgb = img.color(i); - TQColor c(rgb); - rgb = c.dark(180).rgb(); + TQColor c(rgb); + rgb = c.dark(180).rgb(); img.setColor(i,rgb); } sunkenDark = new TQPixmap; @@ -974,8 +974,8 @@ enum { PointUp, PointDown, PointLeft, PointRight }; img.detach(); for (i=0; i<img.numColors(); i++) { TQRgb rgb = img.color(i); - TQColor c(rgb); - rgb = c.light(130).rgb(); + TQColor c(rgb); + rgb = c.light(130).rgb(); img.setColor(i,rgb); } sunkenLight= new TQPixmap; @@ -985,7 +985,7 @@ enum { PointUp, PointDown, PointLeft, PointRight }; TQPalette op(TQColor(212,140,95)); // TQPalette op(white); - TQColorGroup active (op.active().foreground(), + TQColorGroup active (op.active().foreground(), TQBrush(op.active().button(),button), TQBrush(op.active().light(), light), TQBrush(op.active().dark(), dark), @@ -995,7 +995,7 @@ enum { PointUp, PointDown, PointLeft, PointRight }; TQColor(236,182,120), TQBrush(op.active().background(), background) ); - TQColorGroup disabled (op.disabled().foreground(), + TQColorGroup disabled (op.disabled().foreground(), TQBrush(op.disabled().button(),button), TQBrush(op.disabled().light(), light), op.disabled().dark(), @@ -1055,9 +1055,9 @@ void NorwegianWoodStyle::unPolish( void NorwegianWoodStyle::drawPrimitive( PrimitiveElement pe, - TQPainter *p, + TQPainter *p, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags flags, const TQStyleOption& opt ) const { int x, y, w, h; @@ -1071,12 +1071,12 @@ void NorwegianWoodStyle::unPolish( TQRegion internR = roundRectRegion( TQRect(x + b, y + b, w - 2 * b, h - 2 * b), d - b ); - TQPen oldPen = p->pen(); + TQPen oldPen = p->pen(); - TQBrush brush( flags & Style_Sunken ? cg.brush(TQColorGroup::Mid) : - cg.brush(TQColorGroup::Button) ); - p->setClipRegion( internR ); - p->fillRect( r, brush ); + TQBrush brush( flags & Style_Sunken ? cg.brush(TQColorGroup::Mid) : + cg.brush(TQColorGroup::Button) ); + p->setClipRegion( internR ); + p->fillRect( r, brush ); int e = TQMIN( w, h ) / 2; TQPoint p2( x + w - 1 - e, y + e ); @@ -1085,24 +1085,24 @@ void NorwegianWoodStyle::unPolish( TQPointArray a; a.setPoints( 5, x,y, x+w-1, y, p2.x(), p2.y(), p3.x(), p3.y(), x, y + h - 1 ); - p->setClipRegion( TQRegion(a) - internR ); + p->setClipRegion( TQRegion(a) - internR ); - p->fillRect( r, (flags & Style_Sunken ? TQBrush( cg.dark(), *sunkenDark) - : cg.brush(TQColorGroup::Light)) ); + p->fillRect( r, (flags & Style_Sunken ? TQBrush( cg.dark(), *sunkenDark) + : cg.brush(TQColorGroup::Light)) ); // A little inversion is needed the buttons // ( but not flat) if ( flags & Style_Raised || flags & Style_Sunken ) { a.setPoint( 0, x + w - 1, y + w - 1 ); - p->setClipRegion( TQRegion( a ) - internR ); + p->setClipRegion( TQRegion( a ) - internR ); - p->fillRect( r, (flags & Style_Sunken ? TQBrush( cg.light(), *sunkenLight) : cg.brush( TQColorGroup::Dark ) ) ); + p->fillRect( r, (flags & Style_Sunken ? TQBrush( cg.light(), *sunkenLight) : cg.brush( TQColorGroup::Dark ) ) ); } - p->setClipRegion( internR ); - p->setClipping( FALSE ); - p->setPen( cg.foreground() ); + p->setClipRegion( internR ); + p->setClipping( FALSE ); + p->setPen( cg.foreground() ); drawroundrect( p, x, y, w, h, d ); - p->setPen( oldPen ); + p->setPen( oldPen ); break; } case PE_ScrollBarAddLine: @@ -1124,10 +1124,10 @@ void NorwegianWoodStyle::unPolish( void NorwegianWoodStyle::drawControl( ControlElement element, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags how, const TQStyleOption& opt ) const { switch( element ) { @@ -1135,7 +1135,7 @@ void NorwegianWoodStyle::unPolish( TQPushButton *btn; btn = ( const TQPushButton * )widget; - TQColorGroup myCg( cg ); + TQColorGroup myCg( cg ); SFlags flags = Style_Default; if ( btn->isOn() ) flags |= Style_On; @@ -1151,17 +1151,17 @@ void NorwegianWoodStyle::unPolish( r.coords( &x1, &y1, &x2, &y2 ); - p->setPen( cg.foreground() ); - p->setBrush( TQBrush( cg.button(), NoBrush ) ); + p->setPen( cg.foreground() ); + p->setBrush( TQBrush( cg.button(), NoBrush ) ); - TQBrush fill; + TQBrush fill; if ( btn->isDown() ) - fill = cg.brush( TQColorGroup::Mid ); + fill = cg.brush( TQColorGroup::Mid ); else if ( btn->isOn() ) - fill = TQBrush( cg.mid(), Dense4Pattern ); + fill = TQBrush( cg.mid(), Dense4Pattern ); else - fill = cg.brush( TQColorGroup::Button ); - myCg.setBrush( TQColorGroup::Mid, fill ); + fill = cg.brush( TQColorGroup::Button ); + myCg.setBrush( TQColorGroup::Mid, fill ); if ( btn->isDefault() ) { x1 += 2; @@ -1178,7 +1178,7 @@ void NorwegianWoodStyle::unPolish( TQPen pen( TQt::black, 4 ); pen.setCapStyle( TQt::RoundCap ); pen.setJoinStyle( TQt::RoundJoin ); - p->setPen( pen ); + p->setPen( pen ); drawroundrect( p, x1 - 1, y1 - 1, x2 - x1 + 3, y2 - y1 + 3, 8 ); } @@ -1194,8 +1194,8 @@ void NorwegianWoodStyle::unPolish( if ( p->brush().style() != NoBrush ) - p->setBrush( NoBrush ); + if ( p->brush().style() != NoBrush ) + p->setBrush( NoBrush ); break; } case CE_PushButtonLabel: @@ -1212,7 +1212,7 @@ void NorwegianWoodStyle::unPolish( isMenuButton() ) dx = ( y2 - y1 ) / 3; if ( dx || dy ) - p->translate( dx, dy ); + p->translate( dx, dy ); x += 2; y += 2; @@ -1222,10 +1222,10 @@ void NorwegianWoodStyle::unPolish( isEnabled(), btn->pixmap(), btn->text(), -1, - (btn->isDown() || btn->isOn()) ? &cg.brightText() - : &cg.buttonText() ); + (btn->isDown() || btn->isOn()) ? &cg.brightText() + : &cg.buttonText() ); if ( dx || dy ) - p->translate( -dx, -dy ); + p->translate( -dx, -dy ); break; } default: @@ -1235,7 +1235,7 @@ void NorwegianWoodStyle::unPolish( void NorwegianWoodStyle::drawControlMask( ControlElement element, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, const TQStyleOption& opt ) const @@ -1244,8 +1244,8 @@ void NorwegianWoodStyle::unPolish( int d = TQMIN( r.width(), r.height() ) / 2; - p->setPen( color1 ); - p->setBrush( color1 ); + p->setPen( color1 ); + p->setBrush( color1 ); drawroundrect( p, r.x(), r.y(), r.width(), r.height(), d ); break; } @@ -1256,10 +1256,10 @@ void NorwegianWoodStyle::unPolish( void NorwegianWoodStyle::drawComplexControl( ComplexControl cc, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags how, SCFlags sub, SCFlags subActive, @@ -1283,20 +1283,20 @@ void NorwegianWoodStyle::unPolish( drawPrimitive( PE_ArrowDown, p, TQRect(ax, ay, awh, awh), cg, how, opt ); - TQPen oldPen = p->pen(); - p->setPen( cg.light() ); - p->drawLine( ax, sy, ax + awh - 1, sy ); - p->drawLine( ax, sy, ax, sy + sh - 1 ); - p->setPen( cg.dark() ); - p->drawLine( ax + 1, sy + sh - 1, ax + awh - 1, sy + sh - 1 ); - p->drawLine( ax + awh - 1, sy + 1, ax + awh - 1, sy + sh - 1 ); - p->setPen( oldPen ); + TQPen oldPen = p->pen(); + p->setPen( cg.light() ); + p->drawLine( ax, sy, ax + awh - 1, sy ); + p->drawLine( ax, sy, ax, sy + sh - 1 ); + p->setPen( cg.dark() ); + p->drawLine( ax + 1, sy + sh - 1, ax + awh - 1, sy + sh - 1 ); + p->drawLine( ax + awh - 1, sy + 1, ax + awh - 1, sy + sh - 1 ); + p->setPen( oldPen ); if ( cmb->editable() ) { TQRect r( querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxEditField, opt) ); - qDrawShadePanel( p, r, cg, TRUE, 1, - &cg.brush(TQColorGroup::Button) ); + qDrawShadePanel( p, r, cg, TRUE, 1, + &cg.brush(TQColorGroup::Button) ); } break; @@ -1309,7 +1309,7 @@ void NorwegianWoodStyle::unPolish( void NorwegianWoodStyle::drawComplexControlMask( ComplexControl control, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, const TQStyleOption& opt ) const @@ -1318,8 +1318,8 @@ void NorwegianWoodStyle::unPolish( width(), r.height() ) / 2; - p->setPen( color1 ); - p->setBrush( color1 ); + p->setPen( color1 ); + p->setBrush( color1 ); drawroundrect( p, r.x(), r.y(), r.width(), r.height(), d ); break; } @@ -1426,12 +1426,12 @@ void NorwegianWoodStyle::unPolish( TQPainter *p, TQCOORD x, TQCOORD y, +static void drawroundrect( TQPainter *p, TQCOORD x, TQCOORD y, TQCOORD w, TQCOORD h, TQCOORD d ) { int rx = (200*d)/w; int ry = (200*d)/h; - p->drawRoundRect( x, y, w, h, rx, ry ); + p->drawRoundRect( x, y, w, h, rx, ry ); } static TQRegion roundRectRegion( const TQRect& g, int r ) @@ -1495,9 +1495,9 @@ static void get_combo_parameters( const TQRect &r static inline int buttonthickness( int d ) { return d > 20 ? 5 : ( d < 10 ? 2: 3 ); } -void NorwegianWoodStyle::drawSemicircleButton( TQPainter *p, const TQRect &r, +void NorwegianWoodStyle::drawSemicircleButton( TQPainter *p, const TQRect &r, int dir, bool sunken, - const TQColorGroup &g ) const + const TQColorGroup &g ) const { int b = pixelMetric( PM_ScrollBarExtent ) > 20 ? 3 : 2; @@ -1531,21 +1531,21 @@ void NorwegianWoodStyle::drawSemicircleButton( TQPointArray a; a.setPoints( 3, r.x(), r.y(), r.x(), r.bottom(), r.right(), r.top() ); - TQRegion oldClip = p->clipRegion(); - bool bReallyClip = p->hasClipping(); // clip only if we really want. - p->setClipRegion( intern ); - p->fillRect( r, g.brush( TQColorGroup::Button ) ); + TQRegion oldClip = p->clipRegion(); + bool bReallyClip = p->hasClipping(); // clip only if we really want. + p->setClipRegion( intern ); + p->fillRect( r, g.brush( TQColorGroup::Button ) ); - p->setClipRegion( TQRegion(a)&extrn ); - p->fillRect( r, sunken ? g.dark() : g.light() ); + p->setClipRegion( TQRegion(a)&extrn ); + p->fillRect( r, sunken ? g.dark() : g.light() ); a.setPoints( 3, r.right(), r.bottom(), r.x(), r.bottom(), r.right(), r.top() ); - p->setClipRegion( TQRegion(a) & extrn ); - p->fillRect( r, sunken ? g.light() : g.dark() ); + p->setClipRegion( TQRegion(a) & extrn ); + p->fillRect( r, sunken ? g.light() : g.dark() ); - p->setClipRegion( oldClip ); - p->setClipping( bReallyClip ); + p->setClipRegion( oldClip ); + p->setClipping( bReallyClip ); } #endif @@ -1588,25 +1588,25 @@ public: void unPolish( TQWidget* ); void drawPrimitive( PrimitiveElement pe, - TQPainter *p, + TQPainter *p, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags flags = Style_Default, const TQStyleOption& = TQStyleOption::Default) const; void drawControl( ControlElement element, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags how = Style_Default, const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControl( ComplexControl cc, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags how = Style_Default, SCFlags sub = SC_All, SCFlags subActive = SC_None, @@ -1615,10 +1615,10 @@ public: private: - void drawMetalFrame( TQPainter *p, int x, int y, int w, int h ) const; - void drawMetalGradient( TQPainter *p, int x, int y, int w, int h, + void drawMetalFrame( TQPainter *p, int x, int y, int w, int h ) const; + void drawMetalGradient( TQPainter *p, int x, int y, int w, int h, bool sunken, bool horz, bool flat=FALSE ) const; - void drawMetalButton( TQPainter *p, int x, int y, int w, int h, + void drawMetalButton( TQPainter *p, int x, int y, int w, int h, bool sunken, bool horz, bool flat=FALSE ) const; TQPalette oldPalette; }; @@ -1646,7 +1646,7 @@ private: #include "ntqapplication.h" #include "ntqcombobox.h" -#include "ntqpainter.h" +#include "tqpainter.h" #include "ntqdrawutil.h" // for now #include "ntqpixmap.h" // for now #include "ntqpalette.h" // for now @@ -1681,9 +1681,9 @@ private: // we simply create a nice TQColorGroup with a couple of fancy // pixmaps here and apply to it all widgets - TQFont f("times", app->font().pointSize() ); - f.setBold( TRUE ); - f.setItalic( TRUE ); + TQFont f("times", app->font().pointSize() ); + f.setBold( TRUE ); + f.setItalic( TRUE ); app->setFont( f, TRUE, "TQMenuBar"); app->setFont( f, TRUE, "TQPopupMenu"); @@ -1691,7 +1691,7 @@ private: // TQPixmap button( stonedark_xpm ); - TQColor gold("#B9B9A5A54040"); //same as topgrad below + TQColor gold("#B9B9A5A54040"); //same as topgrad below TQPixmap button( 1, 1 ); button.fill( gold ); TQPixmap background(marble_xpm); @@ -1701,10 +1701,10 @@ private: TQPalette op = app->palette(); - TQColor backCol( 227,227,227 ); + TQColor backCol( 227,227,227 ); // TQPalette op(white); - TQColorGroup active (op.active().foreground(), + TQColorGroup active (op.active().foreground(), TQBrush(op.active().button(),button), TQBrush(op.active().light(), light), TQBrush(op.active().dark(), dark), @@ -1714,9 +1714,9 @@ private: op.active().base(),// TQColor(236,182,120), TQBrush(backCol, background) ); - active.setColor( TQColorGroup::ButtonText, TQt::white ); - active.setColor( TQColorGroup::Shadow, TQt::black ); - TQColorGroup disabled (op.disabled().foreground(), + active.setColor( TQColorGroup::ButtonText, TQt::white ); + active.setColor( TQColorGroup::Shadow, TQt::black ); + TQColorGroup disabled (op.disabled().foreground(), TQBrush(op.disabled().button(),button), TQBrush(op.disabled().light(), light), op.disabled().dark(), @@ -1780,9 +1780,9 @@ void MetalStyle::unPolish( void MetalStyle::drawPrimitive( PrimitiveElement pe, - TQPainter *p, + TQPainter *p, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags flags, const TQStyleOption& opt ) const { switch( pe ) { @@ -1824,10 +1824,10 @@ void MetalStyle::unPolish( void MetalStyle::drawControl( ControlElement element, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags how, const TQStyleOption& opt ) const { @@ -1840,25 +1840,25 @@ void MetalStyle::unPolish( r.coords( &x1, &y1, &x2, &y2 ); - p->setPen( cg.foreground() ); - p->setBrush( TQBrush(cg.button(), NoBrush) ); + p->setPen( cg.foreground() ); + p->setBrush( TQBrush(cg.button(), NoBrush) ); - TQBrush fill; + TQBrush fill; if ( btn->isDown() ) - fill = cg.brush( TQColorGroup::Mid ); + fill = cg.brush( TQColorGroup::Mid ); else if ( btn->isOn() ) - fill = TQBrush( cg.mid(), Dense4Pattern ); + fill = TQBrush( cg.mid(), Dense4Pattern ); else - fill = cg.brush( TQColorGroup::Button ); + fill = cg.brush( TQColorGroup::Button ); if ( btn->isDefault() ) { TQPointArray a; a.setPoints( 9, x1, y1, x2, y1, x2, y2, x1, y2, x1, y1+1, x2-1, y1+1, x2-1, y2-1, x1+1, y2-1, x1+1, y1+1 ); - p->setPen( TQt::black ); - p->drawPolyline( a ); + p->setPen( TQt::black ); + p->drawPolyline( a ); x1 += 2; y1 += 2; x2 -= 2; @@ -1885,8 +1885,8 @@ void MetalStyle::unPolish( if ( p->brush().style() != NoBrush ) - p->setBrush( NoBrush ); + if ( p->brush().style() != NoBrush ) + p->setBrush( NoBrush ); break; } case CE_PushButtonLabel: @@ -1907,7 +1907,7 @@ void MetalStyle::unPolish( p->translate( dx, dy ); + p->translate( dx, dy ); x += 2; y += 2; w -= 4; @@ -1916,9 +1916,9 @@ void MetalStyle::unPolish( isEnabled(), btn->pixmap(), btn->text(), -1, - (btn->isDown() || btn->isOn())? &cg.brightText() : &cg.buttonText() ); + (btn->isDown() || btn->isOn())? &cg.brightText() : &cg.buttonText() ); if ( dx || dy ) - p->translate( -dx, -dy ); + p->translate( -dx, -dy ); break; } default: @@ -1927,10 +1927,10 @@ void MetalStyle::unPolish( void MetalStyle::drawComplexControl( ComplexControl cc, - TQPainter *p, + TQPainter *p, const TQWidget *widget, const TQRect &r, - const TQColorGroup &cg, + const TQColorGroup &cg, SFlags how, SCFlags sub, SCFlags subActive, @@ -1956,9 +1956,9 @@ void MetalStyle::unPolish( TQComboBox *cmb = ( const TQComboBox* ) widget; - qDrawWinPanel( p, r.x(), r.y(), r.width(), r.height(), cg, TRUE, - cmb->isEnabled() ? &cg.brush( TQColorGroup::Base ) : - &cg.brush( TQColorGroup::Background ) ); + qDrawWinPanel( p, r.x(), r.y(), r.width(), r.height(), cg, TRUE, + cmb->isEnabled() ? &cg.brush( TQColorGroup::Base ) : + &cg.brush( TQColorGroup::Background ) ); drawMetalButton( p, r.x() + r.width() - 2 - 16, r.y() + 2, 16, r.height() - 4, how & Style_Sunken, TRUE ); drawPrimitive( PE_ArrowDown, p, @@ -1982,7 +1982,7 @@ void MetalStyle::unPolish( MetalStyle::drawMetalButton( TQPainter *p, int x, int y, int w, int h, +void MetalStyle::drawMetalButton( TQPainter *p, int x, int y, int w, int h, bool sunken, bool horz, bool flat ) const { @@ -1993,13 +1993,13 @@ void MetalStyle::drawMetalButton( T -void MetalStyle::drawMetalFrame( TQPainter *p, int x, int y, int w, int h ) const +void MetalStyle::drawMetalFrame( TQPainter *p, int x, int y, int w, int h ) const { - TQColor top1("#878769691515"); - TQColor top2("#C6C6B4B44949"); + TQColor top1("#878769691515"); + TQColor top2("#C6C6B4B44949"); - TQColor bot2("#70705B5B1414"); - TQColor bot1("#56564A4A0E0E"); //first from the bottom + TQColor bot2("#70705B5B1414"); + TQColor bot1("#56564A4A0E0E"); //first from the bottom int x2 = x + w - 1; @@ -2007,39 +2007,39 @@ void MetalStyle::drawMetalFrame( TQ //frame: - p->setPen( top1 ); - p->drawLine( x, y2, x, y ); - p->drawLine( x, y, x2-1, y ); - p->setPen( top2 ); - p->drawLine( x+1, y2 -1, x+1, y+1 ); - p->drawLine( x+1, y+1 , x2-2, y+1 ); + p->setPen( top1 ); + p->drawLine( x, y2, x, y ); + p->drawLine( x, y, x2-1, y ); + p->setPen( top2 ); + p->drawLine( x+1, y2 -1, x+1, y+1 ); + p->drawLine( x+1, y+1 , x2-2, y+1 ); - p->setPen( bot1 ); - p->drawLine( x+1, y2, x2, y2 ); - p->drawLine( x2, y2, x2, y ); - p->setPen( bot2 ); - p->drawLine( x+1, y2-1, x2-1, y2-1 ); - p->drawLine( x2-1, y2-1, x2-1, y+1 ); + p->setPen( bot1 ); + p->drawLine( x+1, y2, x2, y2 ); + p->drawLine( x2, y2, x2, y ); + p->setPen( bot2 ); + p->drawLine( x+1, y2-1, x2-1, y2-1 ); + p->drawLine( x2-1, y2-1, x2-1, y+1 ); } -void MetalStyle::drawMetalGradient( TQPainter *p, int x, int y, int w, int h, +void MetalStyle::drawMetalGradient( TQPainter *p, int x, int y, int w, int h, bool sunken, bool horz, bool flat ) const { - TQColor highlight("#E8E8DDDD6565"); - TQColor subh1("#CECEBDBD5151"); - TQColor subh2("#BFBFACAC4545"); + TQColor highlight("#E8E8DDDD6565"); + TQColor subh1("#CECEBDBD5151"); + TQColor subh2("#BFBFACAC4545"); - TQColor topgrad("#B9B9A5A54040"); - TQColor botgrad("#89896C6C1A1A"); + TQColor topgrad("#B9B9A5A54040"); + TQColor botgrad("#89896C6C1A1A"); if ( flat && !sunken ) { - p->fillRect( x + 2, y + 2, w - 4,h -4, topgrad ); + p->fillRect( x + 2, y + 2, w - 4,h -4, topgrad ); } else { // highlight: int i = 0; @@ -2053,18 +2053,18 @@ void MetalStyle::drawMetalGradient( drawLine( x1, y1+i, x2, y1+i ); \ + p->drawLine( x1, y1+i, x2, y1+i ); \ else \ - p->drawLine( x1+i, y1, x1+i, y2 ); \ + p->drawLine( x1+i, y1, x1+i, y2 ); \ i++; if ( !sunken ) { - p->setPen( highlight ); + p->setPen( highlight ); DRAWLINE; DRAWLINE; - p->setPen( subh1 ); + p->setPen( subh1 ); DRAWLINE; - p->setPen( subh2 ); + p->setPen( subh2 ); DRAWLINE; } // gradient: @@ -2072,32 +2072,32 @@ void MetalStyle::drawMetalGradient( topgrad.hsv( &h1, &s1, &v1 ); - botgrad.hsv( &h2, &s2, &v2 ); + topgrad.hsv( &h1, &s1, &v1 ); + botgrad.hsv( &h2, &s2, &v2 ); } else { - botgrad.hsv( &h1, &s1, &v1 ); - topgrad.hsv( &h2, &s2, &v2 ); + botgrad.hsv( &h1, &s1, &v1 ); + topgrad.hsv( &h2, &s2, &v2 ); } if ( ng > 1 ) { for ( int j =0; j < ng; j++ ) { - p->setPen( TQColor( h1 + ((h2-h1)*j)/(ng-1), + p->setPen( TQColor( h1 + ((h2-h1)*j)/(ng-1), s1 + ((s2-s1)*j)/(ng-1), v1 + ((v2-v1)*j)/(ng-1), TQColor::Hsv ) ); DRAWLINE; } } else if ( ng == 1 ) { - p->setPen( TQColor((h1+h2)/2, (s1+s2)/2, (v1+v2)/2, TQColor::Hsv) ); + p->setPen( TQColor((h1+h2)/2, (s1+s2)/2, (v1+v2)/2, TQColor::Hsv) ); DRAWLINE; } if ( sunken ) { - p->setPen( subh2 ); + p->setPen( subh2 ); DRAWLINE; - p->setPen( subh1 ); + p->setPen( subh1 ); DRAWLINE; - p->setPen( highlight ); + p->setPen( highlight ); DRAWLINE; DRAWLINE; } @@ -2135,7 +2135,7 @@ void MetalStyle::drawMetalGradient( tqmainwindow.h> -#include <ntqfont.h> +#include <tqfont.h> class TQTabWidget; @@ -2155,7 +2155,7 @@ protected slots: void aboutTQt(); private: - TQFont appFont; + TQFont appFont; }; @@ -2191,7 +2191,7 @@ private: #include <tqpopupmenu.h> #include <tqmenubar.h> #include <ntqmessagebox.h> -#include <ntqfont.h> +#include <tqfont.h> #include <tqstylefactory.h> #include <tqaction.h> #include <tqsignalmapper.h> -- cgit v1.2.1