From ea318d1431c89e647598c510c4245c6571aa5f46 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 26 Jan 2012 23:32:43 -0600 Subject: Update to latest tqt3 automated conversion --- doc/html/themes-example.html | 1220 +++++++++++++++++++++--------------------- 1 file changed, 610 insertions(+), 610 deletions(-) (limited to 'doc/html/themes-example.html') diff --git a/doc/html/themes-example.html b/doc/html/themes-example.html index b30208b18..6d5fe2717 100644 --- a/doc/html/themes-example.html +++ b/doc/html/themes-example.html @@ -57,47 +57,47 @@ during runtime using the pulldown menu. #define WOOD_H -#include <qpalette.h> +#include <ntqpalette.h> #ifndef QT_NO_STYLE_WINDOWS -#include <qwindowsstyle.h> +#include <ntqwindowsstyle.h> -class NorwegianWoodStyle : public TQWindowsStyle +class NorwegianWoodStyle : public TQWindowsStyle { public: NorwegianWoodStyle(); - void polish( TQApplication*); - void polish( TQWidget* ); - void unPolish( TQWidget* ); - void unPolish( TQApplication*); + void polish( TQApplication*); + void polish( TQWidget* ); + void unPolish( TQWidget* ); + void unPolish( TQApplication*); void drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, + TQPainter *p, + const TQRect &r, const TQColorGroup &cg, SFlags flags = Style_Default, const TQStyleOption& = TQStyleOption::Default ) const; void drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQColorGroup &cg, SFlags how = Style_Default, const TQStyleOption& = TQStyleOption::Default ) const; void drawControlMask( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControl( ComplexControl cc, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQColorGroup &cg, SFlags how = Style_Default, SCFlags sub = SC_All, @@ -105,25 +105,25 @@ public: const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControlMask( ComplexControl control, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQStyleOption& = TQStyleOption::Default ) const; - TQRect querySubControlMetrics( ComplexControl control, - const TQWidget *widget, + TQRect querySubControlMetrics( ComplexControl control, + const TQWidget *widget, SubControl sc, const TQStyleOption& = TQStyleOption::Default ) const; - TQRect subRect( SubRect r, const TQWidget *widget ) const; + TQRect subRect( SubRect r, const TQWidget *widget ) const; private: - void drawSemicircleButton(TQPainter *p, const TQRect &r, int dir, + void drawSemicircleButton(TQPainter *p, const TQRect &r, int dir, bool sunken, const TQColorGroup &g ) const; - TQPalette oldPalette; - TQPixmap *sunkenDark; - TQPixmap *sunkenLight; + TQPalette oldPalette; + TQPixmap *sunkenDark; + TQPixmap *sunkenLight; }; @@ -148,21 +148,21 @@ private: #ifndef QT_NO_STYLE_WINDOWS -#include "qapplication.h" -#include "qcombobox.h" -#include "qpainter.h" -#include "qdrawutil.h" // for now -#include "qpixmap.h" // for now -#include "qpalette.h" // for now -#include "qwidget.h" -#include "qlabel.h" -#include "qimage.h" -#include "qpushbutton.h" -#include "qwidget.h" -#include "qrangecontrol.h" -#include "qscrollbar.h" +#include "ntqapplication.h" +#include "ntqcombobox.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" // for now +#include "ntqpixmap.h" // for now +#include "ntqpalette.h" // for now +#include "ntqwidget.h" +#include "ntqlabel.h" +#include "ntqimage.h" +#include "ntqpushbutton.h" +#include "ntqwidget.h" +#include "ntqrangecontrol.h" +#include "ntqscrollbar.h" #include <limits.h> -#include "qstylefactory.h" +#include "ntqstylefactory.h" /* XPM */ static const char *polish_xpm[] = { @@ -882,14 +882,14 @@ 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 ); -static TQRegion roundRectRegion( const TQRect& g, int r ); +static TQRegion roundRectRegion( const TQRect& g, int r ); -static void get_combo_parameters( const TQRect &r, +static void get_combo_parameters( const TQRect &r, int &ew, int &awh, int &ax, int &ay, int &sh, int &dh, int &sy ); @@ -899,210 +899,210 @@ static int get_combo_extra_width( int h, int *return_awh = 0 ); enum { PointUp, PointDown, PointLeft, PointRight }; -NorwegianWoodStyle::NorwegianWoodStyle() : TQWindowsStyle() +NorwegianWoodStyle::NorwegianWoodStyle() : TQWindowsStyle() { } /*! Reimplementation from TQStyle */ -void NorwegianWoodStyle::polish( TQApplication *app) +void NorwegianWoodStyle::polish( TQApplication *app) { - oldPalette = app->palette(); + oldPalette = app->palette(); // we simply create a nice TQColorGroup with a couple of fancy wood // pixmaps here and apply to it all widgets - TQImage img(button_xpm); - TQImage orig = img; - orig.detach(); - TQPixmap button; - button.convertFromImage(img); + TQImage img(button_xpm); + TQImage orig = img; + orig.detach(); + TQPixmap button; + button.convertFromImage(img); int i; - for (i=0; i<img.numColors(); i++) { - TQRgb rgb = img.color(i); - TQColor c(rgb); - rgb = c.dark(120).rgb(); - img.setColor(i,rgb); + for (i=0; i<img.numColors(); i++) { + TQRgb rgb = img.color(i); + TQColor c(rgb); + rgb = c.dark(120).rgb(); + img.setColor(i,rgb); } - TQPixmap mid; - mid.convertFromImage(img); + TQPixmap mid; + mid.convertFromImage(img); img = orig; - img.detach(); - for (i=0; i<img.numColors(); i++) { - TQRgb rgb = img.color(i); - TQColor c(rgb); - rgb = c.light().rgb(); - img.setColor(i,rgb); + img.detach(); + for (i=0; i<img.numColors(); i++) { + TQRgb rgb = img.color(i); + TQColor c(rgb); + rgb = c.light().rgb(); + img.setColor(i,rgb); } - TQPixmap light; - light.convertFromImage(img); + TQPixmap light; + light.convertFromImage(img); img = orig; - img.detach(); - for (i=0; i<img.numColors(); i++) { - TQRgb rgb = img.color(i); - TQColor c(rgb); - rgb = c.dark(180).rgb(); - img.setColor(i,rgb); + img.detach(); + for (i=0; i<img.numColors(); i++) { + TQRgb rgb = img.color(i); + TQColor c(rgb); + rgb = c.dark(180).rgb(); + img.setColor(i,rgb); } - TQPixmap dark; - dark.convertFromImage(img); + TQPixmap dark; + dark.convertFromImage(img); - TQImage bgimage(polish_xpm); - TQPixmap background; - background.convertFromImage(bgimage); + TQImage bgimage(polish_xpm); + TQPixmap background; + background.convertFromImage(bgimage); img = bgimage; - img.detach(); - for (i=0; i<img.numColors(); i++) { - TQRgb rgb = img.color(i); - TQColor c(rgb); - rgb = c.dark(180).rgb(); - img.setColor(i,rgb); + img.detach(); + for (i=0; i<img.numColors(); i++) { + TQRgb rgb = img.color(i); + TQColor c(rgb); + rgb = c.dark(180).rgb(); + img.setColor(i,rgb); } - sunkenDark = new TQPixmap; - sunkenDark->convertFromImage(img); + sunkenDark = new TQPixmap; + sunkenDark->convertFromImage(img); img = bgimage; - img.detach(); - for (i=0; i<img.numColors(); i++) { - TQRgb rgb = img.color(i); - TQColor c(rgb); - rgb = c.light(130).rgb(); - img.setColor(i,rgb); + img.detach(); + for (i=0; i<img.numColors(); i++) { + TQRgb rgb = img.color(i); + TQColor c(rgb); + rgb = c.light(130).rgb(); + img.setColor(i,rgb); } - sunkenLight= new TQPixmap; - sunkenLight->convertFromImage(img); + sunkenLight= new TQPixmap; + sunkenLight->convertFromImage(img); - TQPalette op(TQColor(212,140,95)); + TQPalette op(TQColor(212,140,95)); // TQPalette op(white); - TQColorGroup active (op.active().foreground(), - TQBrush(op.active().button(),button), - TQBrush(op.active().light(), light), - TQBrush(op.active().dark(), dark), - TQBrush(op.active().mid(), mid), - op.active().text(), + TQColorGroup active (op.active().foreground(), + TQBrush(op.active().button(),button), + TQBrush(op.active().light(), light), + TQBrush(op.active().dark(), dark), + TQBrush(op.active().mid(), mid), + op.active().text(), TQt::white, TQColor(236,182,120), - TQBrush(op.active().background(), background) + TQBrush(op.active().background(), background) ); - TQColorGroup disabled (op.disabled().foreground(), - TQBrush(op.disabled().button(),button), - TQBrush(op.disabled().light(), light), - op.disabled().dark(), - TQBrush(op.disabled().mid(), mid), - op.disabled().text(), + TQColorGroup disabled (op.disabled().foreground(), + TQBrush(op.disabled().button(),button), + TQBrush(op.disabled().light(), light), + op.disabled().dark(), + TQBrush(op.disabled().mid(), mid), + op.disabled().text(), TQt::white, TQColor(236,182,120), - TQBrush(op.disabled().background(), background) + TQBrush(op.disabled().background(), background) ); - app->setPalette(TQPalette(active, disabled, active), TRUE ); + app->setPalette(TQPalette(active, disabled, active), TRUE ); } -void NorwegianWoodStyle::unPolish( TQApplication *app) +void NorwegianWoodStyle::unPolish( TQApplication *app) { - app->setPalette(oldPalette, TRUE); + app->setPalette(oldPalette, TRUE); } /*! Reimplementation from TQStyle */ -void NorwegianWoodStyle::polish( TQWidget* w) +void NorwegianWoodStyle::polish( TQWidget* w) { // the polish function sets some widgets to transparent mode and // some to translate background mode in order to get the full // benefit from the nice pixmaps in the color group. - if ( !w->isTopLevel() ) { - if ( w->inherits("TQPushButton") - || w->inherits("TQToolButton") - || w->inherits("TQComboBox") ) { - w->setAutoMask( TRUE ); + if ( !w->isTopLevel() ) { + if ( w->inherits("TQPushButton") + || w->inherits("TQToolButton") + || w->inherits("TQComboBox") ) { + w->setAutoMask( TRUE ); return; } - if ( w->backgroundPixmap() ) - w->setBackgroundOrigin( TQWidget::WindowOrigin ); + if ( w->backgroundPixmap() ) + w->setBackgroundOrigin( TQWidget::WindowOrigin ); } } -void NorwegianWoodStyle::unPolish( TQWidget* w) +void NorwegianWoodStyle::unPolish( TQWidget* w) { // the polish function sets some widgets to transparent mode and // some to translate background mode in order to get the full // benefit from the nice pixmaps in the color group. - if ( !w->isTopLevel() ) { - if ( w->inherits("TQPushButton") - || w->inherits("TQToolButton") - || w->inherits("TQComboBox") ) { - w->setAutoMask( FALSE ); + if ( !w->isTopLevel() ) { + if ( w->inherits("TQPushButton") + || w->inherits("TQToolButton") + || w->inherits("TQComboBox") ) { + w->setAutoMask( FALSE ); return; } - if ( w->backgroundPixmap() ) - w->setBackgroundOrigin( TQWidget::WidgetOrigin ); + if ( w->backgroundPixmap() ) + w->setBackgroundOrigin( TQWidget::WidgetOrigin ); } } -void NorwegianWoodStyle::drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, +void NorwegianWoodStyle::drawPrimitive( PrimitiveElement pe, + TQPainter *p, + const TQRect &r, const TQColorGroup &cg, SFlags flags, const TQStyleOption& opt ) const { int x, y, w, h; - r.rect( &x, &y, &w, &h ); + r.rect( &x, &y, &w, &h ); switch ( pe ) { case PE_ButtonCommand: { int d = TQMIN( w, h ) / 2; int b = buttonthickness( d ); - TQRegion internR = roundRectRegion( TQRect(x + b, y + b, + 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) : + TQBrush brush( flags & Style_Sunken ? cg.brush(TQColorGroup::Mid) : cg.brush(TQColorGroup::Button) ); - p->setClipRegion( internR ); - p->fillRect( r, brush ); + p->setClipRegion( internR ); + p->fillRect( r, brush ); int e = TQMIN( w, h ) / 2; - TQPoint p2( x + w - 1 - e, y + e ); - TQPoint p3( x + e, y + h - 1 - e ); + TQPoint p2( x + w - 1 - e, y + e ); + TQPoint p3( x + e, y + h - 1 - e ); - TQPointArray a; - a.setPoints( 5, x,y, x+w-1, y, p2.x(), p2.y(), p3.x(), p3.y(), + 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) + 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 ); + a.setPoint( 0, x + w - 1, y + w - 1 ); + 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: @@ -1118,147 +1118,147 @@ void NorwegianWoodStyle::unPolish( TQWindowsStyle::drawPrimitive( pe, p, r, cg, flags, opt ); + TQWindowsStyle::drawPrimitive( pe, p, r, cg, flags, opt ); break; } } -void NorwegianWoodStyle::drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, +void NorwegianWoodStyle::drawControl( ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQColorGroup &cg, SFlags how, const TQStyleOption& opt ) const { switch( element ) { case CE_PushButton: { - const TQPushButton *btn; - btn = ( const TQPushButton * )widget; + const TQPushButton *btn; + btn = ( const TQPushButton * )widget; TQColorGroup myCg( cg ); SFlags flags = Style_Default; - if ( btn->isOn() ) + if ( btn->isOn() ) flags |= Style_On; - if ( btn->isDown() ) + if ( btn->isDown() ) flags |= Style_Down; - if ( btn->isOn() || btn->isDown() ) + if ( btn->isOn() || btn->isDown() ) flags |= Style_Sunken; - if ( btn->isDefault() ) + if ( btn->isDefault() ) flags |= Style_Default; - if ( ! btn->isFlat() && !(flags & Style_Down) ) + if ( ! btn->isFlat() && !(flags & Style_Down) ) flags |= Style_Raised; int x1, y1, x2, y2; - r.coords( &x1, &y1, &x2, &y2 ); + 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; - if ( btn->isDown() ) + TQBrush fill; + if ( btn->isDown() ) fill = cg.brush( TQColorGroup::Mid ); - else if ( btn->isOn() ) + else if ( btn->isOn() ) fill = TQBrush( cg.mid(), Dense4Pattern ); else fill = cg.brush( TQColorGroup::Button ); myCg.setBrush( TQColorGroup::Mid, fill ); - if ( btn->isDefault() ) { + if ( btn->isDefault() ) { x1 += 2; y1 += 2; x2 -= 2; y2 -= 2; } - drawPrimitive( PE_ButtonCommand, p, + drawPrimitive( PE_ButtonCommand, p, TQRect( x1, y1, x2 - x1 + 1, y2 - y1 + 1), myCg, flags, opt ); - if ( btn->isDefault() ) { - TQPen pen( TQt::black, 4 ); - pen.setCapStyle( TQt::RoundCap ); - pen.setJoinStyle( TQt::RoundJoin ); - p->setPen( pen ); + if ( btn->isDefault() ) { + TQPen pen( TQt::black, 4 ); + pen.setCapStyle( TQt::RoundCap ); + pen.setJoinStyle( TQt::RoundJoin ); + p->setPen( pen ); drawroundrect( p, x1 - 1, y1 - 1, x2 - x1 + 3, y2 - y1 + 3, 8 ); } - if ( btn->isMenuButton() ) { + if ( btn->isMenuButton() ) { int dx = ( y1 - y2 - 4 ) / 3; // reset the flags flags = Style_Default; - if ( btn->isEnabled() ) + if ( btn->isEnabled() ) flags |= Style_Enabled; - drawPrimitive( PE_ArrowDown, p, + drawPrimitive( PE_ArrowDown, p, TQRect( x2 - dx, dx, y1, y2 - y1), myCg, flags, opt ); } - if ( p->brush().style() != NoBrush ) - p->setBrush( NoBrush ); + if ( p->brush().style() != NoBrush ) + p->setBrush( NoBrush ); break; } case CE_PushButtonLabel: { - const TQPushButton *btn; - btn = (const TQPushButton*)widget; + const TQPushButton *btn; + btn = (const TQPushButton*)widget; int x, y, w, h; - r.rect( &x, &y, &w, &h ); + r.rect( &x, &y, &w, &h ); int x1, y1, x2, y2; - r.coords( &x1, &y1, &x2, &y2 ); + r.coords( &x1, &y1, &x2, &y2 ); int dx = 0; int dy = 0; - if ( btn->isMenuButton() ) + if ( btn->isMenuButton() ) dx = ( y2 - y1 ) / 3; if ( dx || dy ) - p->translate( dx, dy ); + p->translate( dx, dy ); x += 2; y += 2; w -= 4; h -= 4; - drawItem( p, TQRect( x, y, w, h ), + drawItem( p, TQRect( x, y, w, h ), AlignCenter | ShowPrefix, - cg, btn->isEnabled(), - btn->pixmap(), btn->text(), -1, - (btn->isDown() || btn->isOn()) ? &cg.brightText() + cg, btn->isEnabled(), + btn->pixmap(), btn->text(), -1, + (btn->isDown() || btn->isOn()) ? &cg.brightText() : &cg.buttonText() ); if ( dx || dy ) - p->translate( -dx, -dy ); + p->translate( -dx, -dy ); break; } default: - TQWindowsStyle::drawControl( element, p, widget, r, cg, how, opt ); + TQWindowsStyle::drawControl( element, p, widget, r, cg, how, opt ); break; } } -void NorwegianWoodStyle::drawControlMask( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, +void NorwegianWoodStyle::drawControlMask( ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQStyleOption& opt ) const { switch( element ) { case CE_PushButton: { - int d = TQMIN( r.width(), r.height() ) / 2; - p->setPen( color1 ); - p->setBrush( color1 ); - drawroundrect( p, r.x(), r.y(), r.width(), r.height(), d ); + int d = TQMIN( r.width(), r.height() ) / 2; + p->setPen( color1 ); + p->setBrush( color1 ); + drawroundrect( p, r.x(), r.y(), r.width(), r.height(), d ); break; } default: - TQWindowsStyle::drawControlMask( element, p, widget, r, opt ); + TQWindowsStyle::drawControlMask( element, p, widget, r, opt ); break; } } -void NorwegianWoodStyle::drawComplexControl( ComplexControl cc, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, +void NorwegianWoodStyle::drawComplexControl( ComplexControl cc, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQColorGroup &cg, SFlags how, SCFlags sub, @@ -1268,87 +1268,87 @@ void NorwegianWoodStyle::unPolish( TQComboBox *cmb; - cmb = (const TQComboBox*)widget; + const TQComboBox *cmb; + cmb = (const TQComboBox*)widget; int awh, ax, ay, sh, sy, dh, ew; - get_combo_parameters( subRect(SR_PushButtonContents, widget), + get_combo_parameters( subRect(SR_PushButtonContents, widget), ew, awh, ax, ay, sh, dh, sy ); - drawPrimitive( PE_ButtonCommand, p, r, cg, Style_Raised, opt ); - TQStyle *mstyle = TQStyleFactory::create( "Motif" ); + drawPrimitive( PE_ButtonCommand, p, r, cg, Style_Raised, opt ); + TQStyle *mstyle = TQStyleFactory::create( "Motif" ); if ( mstyle ) - mstyle->drawPrimitive( PE_ArrowDown, p, + mstyle->drawPrimitive( PE_ArrowDown, p, TQRect(ax, ay, awh, awh), cg, how, opt ); else - drawPrimitive( PE_ArrowDown, p, + 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 ); - - if ( cmb->editable() ) { - TQRect r( querySubControlMetrics(CC_ComboBox, widget, + 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, + qDrawShadePanel( p, r, cg, TRUE, 1, &cg.brush(TQColorGroup::Button) ); } break; } default: - TQWindowsStyle::drawComplexControl( cc, p, widget, r, cg, how, + TQWindowsStyle::drawComplexControl( cc, p, widget, r, cg, how, sub, subActive, opt ); break; } } -void NorwegianWoodStyle::drawComplexControlMask( ComplexControl control, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, +void NorwegianWoodStyle::drawComplexControlMask( ComplexControl control, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQStyleOption& opt ) const { switch ( control ) { case CC_ComboBox: { - int d = TQMIN( r.width(), r.height() ) / 2; - p->setPen( color1 ); - p->setBrush( color1 ); - drawroundrect( p, r.x(), r.y(), r.width(), r.height(), d ); + int d = TQMIN( r.width(), r.height() ) / 2; + p->setPen( color1 ); + p->setBrush( color1 ); + drawroundrect( p, r.x(), r.y(), r.width(), r.height(), d ); break; } default: - TQWindowsStyle::drawComplexControlMask( control, p, widget, r, opt ); + TQWindowsStyle::drawComplexControlMask( control, p, widget, r, opt ); break; } } -TQRect NorwegianWoodStyle::querySubControlMetrics( ComplexControl control, - const TQWidget *widget, +TQRect NorwegianWoodStyle::querySubControlMetrics( ComplexControl control, + const TQWidget *widget, SubControl sc, const TQStyleOption& opt ) const { - TQRect rect; + TQRect rect; switch ( control ) { case CC_ComboBox: { switch( sc ) { case SC_ComboBoxEditField: { - rect = subRect( SR_PushButtonContents, widget ); - int ew = get_combo_extra_width( rect.height(), 0 ); - rect.setRect( rect.x() + 1, rect.y() + 1, - rect.width() - 2 - ew, rect.height() - 2 ); + rect = subRect( SR_PushButtonContents, widget ); + int ew = get_combo_extra_width( rect.height(), 0 ); + rect.setRect( rect.x() + 1, rect.y() + 1, + rect.width() - 2 - ew, rect.height() - 2 ); break; } default: - rect = TQWindowsStyle::querySubControlMetrics( control, widget, + rect = TQWindowsStyle::querySubControlMetrics( control, widget, sc, opt ); break; } @@ -1356,97 +1356,97 @@ void NorwegianWoodStyle::unPolish( TQScrollBar* sb; - sb = (const TQScrollBar*)widget; - bool horz = sb->orientation() == TQScrollBar::Horizontal; + const TQScrollBar* sb; + sb = (const TQScrollBar*)widget; + bool horz = sb->orientation() == TQScrollBar::Horizontal; int b = 2; - int w = horz ? sb->height() : sb->width(); + int w = horz ? sb->height() : sb->width(); switch ( sc ) { case SC_ScrollBarAddLine: - rect.setRect( b, b, w - 2 * b, w - 2 * b ); + rect.setRect( b, b, w - 2 * b, w - 2 * b ); if ( horz ) - rect.moveBy( sb->width() - w, 0 ); + rect.moveBy( sb->width() - w, 0 ); else - rect.moveBy( 0, sb->height() - w ); + rect.moveBy( 0, sb->height() - w ); break; case SC_ScrollBarSubLine: - rect.setRect( b, b, w - 2 * b, w - 2 * b ); + rect.setRect( b, b, w - 2 * b, w - 2 * b ); break; default: - rect = TQWindowsStyle::querySubControlMetrics( control, widget, + rect = TQWindowsStyle::querySubControlMetrics( control, widget, sc, opt ); break; } break; } default: - rect = TQWindowsStyle::querySubControlMetrics( control, widget, + rect = TQWindowsStyle::querySubControlMetrics( control, widget, sc, opt ); break; } return rect; } -TQRect NorwegianWoodStyle::subRect( SubRect sr, const TQWidget * widget ) const +TQRect NorwegianWoodStyle::subRect( SubRect sr, const TQWidget * widget ) const { - TQRect r; + TQRect r; switch ( sr ) { case SR_PushButtonContents: { - const TQPushButton *btn; - btn = (const TQPushButton*)widget; - r = btn->rect(); - int d = TQMIN( r.width(), r.height() ) / 2; + const TQPushButton *btn; + btn = (const TQPushButton*)widget; + r = btn->rect(); + int d = TQMIN( r.width(), r.height() ) / 2; int b = buttonthickness( d ); d -= b; b++; - if ( r.width() < r.height() ) - r.setRect( r.x() + b, r.y() + d, - r.width() - 2 * b, r.height() - 2 * d ); + if ( r.width() < r.height() ) + r.setRect( r.x() + b, r.y() + d, + r.width() - 2 * b, r.height() - 2 * d ); else - r.setRect( r.x() + d, r.y() + b, - r.width() - 2 * d, r.height() - 2 * b ); + r.setRect( r.x() + d, r.y() + b, + r.width() - 2 * d, r.height() - 2 * b ); break; } case SR_ComboBoxFocusRect: { - r = subRect( SR_PushButtonContents, widget ); - int ew = get_combo_extra_width( r.height() ); - r.setRect( r.x() + 1, r.y() + 1, r.width() - 2 - ew, - r.height() - 2 ); + r = subRect( SR_PushButtonContents, widget ); + int ew = get_combo_extra_width( r.height() ); + r.setRect( r.x() + 1, r.y() + 1, r.width() - 2 - ew, + r.height() - 2 ); break; } default: - r = TQWindowsStyle::subRect( sr, widget ); + r = TQWindowsStyle::subRect( sr, widget ); break; } return r; } -static void drawroundrect( 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 ) +static TQRegion roundRectRegion( const TQRect& g, int r ) { - TQPointArray a; - a.setPoints( 8, g.x()+r, g.y(), g.right()-r, g.y(), - g.right(), g.y()+r, g.right(), g.bottom()-r, - g.right()-r, g.bottom(), g.x()+r, g.bottom(), - g.x(), g.bottom()-r, g.x(), g.y()+r ); - TQRegion reg( a ); + TQPointArray a; + a.setPoints( 8, g.x()+r, g.y(), g.right()-r, g.y(), + g.right(), g.y()+r, g.right(), g.bottom()-r, + g.right()-r, g.bottom(), g.x()+r, g.bottom(), + g.x(), g.bottom()-r, g.x(), g.y()+r ); + TQRegion reg( a ); int d = r*2-1; - reg += TQRegion( g.x(),g.y(),r*2,r*2, TQRegion::Ellipse ); - reg += TQRegion( g.right()-d,g.y(),r*2,r*2, TQRegion::Ellipse ); - reg += TQRegion( g.x(),g.bottom()-d,r*2,r*2, TQRegion::Ellipse ); - reg += TQRegion( g.right()-d,g.bottom()-d,r*2,r*2, TQRegion::Ellipse ); + reg += TQRegion( g.x(),g.y(),r*2,r*2, TQRegion::Ellipse ); + reg += TQRegion( g.right()-d,g.y(),r*2,r*2, TQRegion::Ellipse ); + reg += TQRegion( g.x(),g.bottom()-d,r*2,r*2, TQRegion::Ellipse ); + reg += TQRegion( g.right()-d,g.bottom()-d,r*2,r*2, TQRegion::Ellipse ); return reg; } @@ -1469,83 +1469,83 @@ static int get_combo_extra_width( int h, int *return_awh ) } -static void get_combo_parameters( const TQRect &r, +static void get_combo_parameters( const TQRect &r, int &ew, int &awh, int &ax, int &ay, int &sh, int &dh, int &sy ) { - ew = get_combo_extra_width( r.height(), &awh ); + ew = get_combo_extra_width( r.height(), &awh ); sh = (awh+3)/4; if ( sh < 3 ) sh = 3; dh = sh/2 + 1; - ay = r.y() + (r.height()-awh-sh-dh)/2; + ay = r.y() + (r.height()-awh-sh-dh)/2; if ( ay < 0 ) { //panic mode ay = 0; - sy = r.height(); + sy = r.height(); } else { sy = ay+awh+dh; } - ax = r.x() + r.width() - ew +(ew-awh)/2; + ax = r.x() + r.width() - ew +(ew-awh)/2; } 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 { - int b = pixelMetric( PM_ScrollBarExtent ) > 20 ? 3 : 2; + int b = pixelMetric( PM_ScrollBarExtent ) > 20 ? 3 : 2; - TQRegion extrn( r.x(), r.y(), r.width(), r.height(), TQRegion::Ellipse ); - TQRegion intern( r.x()+b, r.y()+b, r.width()-2*b, r.height()-2*b, TQRegion::Ellipse ); - int w2 = r.width()/2; - int h2 = r.height()/2; + TQRegion extrn( r.x(), r.y(), r.width(), r.height(), TQRegion::Ellipse ); + TQRegion intern( r.x()+b, r.y()+b, r.width()-2*b, r.height()-2*b, TQRegion::Ellipse ); + int w2 = r.width()/2; + int h2 = r.height()/2; int bug = 1; //off-by-one somewhere!!!??? switch( dir ) { case PointRight: - extrn += TQRegion( r.x(), r.y(), w2, r.height() ); - intern += TQRegion( r.x()+b,r.y()+b, w2-2*b, r.height()-2*b ); + extrn += TQRegion( r.x(), r.y(), w2, r.height() ); + intern += TQRegion( r.x()+b,r.y()+b, w2-2*b, r.height()-2*b ); break; case PointLeft: - extrn += TQRegion( r.x()+w2, r.y(), w2, r.height() ); - intern += TQRegion( r.x()+w2+b,r.y()+b, w2-2*b, r.height()-2*b ); + extrn += TQRegion( r.x()+w2, r.y(), w2, r.height() ); + intern += TQRegion( r.x()+w2+b,r.y()+b, w2-2*b, r.height()-2*b ); break; case PointUp: - extrn += TQRegion( r.x(), r.y()+h2, r.width(), h2 ); - intern += TQRegion( r.x()+b,r.y()+h2+b, r.width()-2*b-bug, h2-2*b-bug ); + extrn += TQRegion( r.x(), r.y()+h2, r.width(), h2 ); + intern += TQRegion( r.x()+b,r.y()+h2+b, r.width()-2*b-bug, h2-2*b-bug ); break; case PointDown: - extrn += TQRegion( r.x(), r.y(), r.width(), h2 ); - intern += TQRegion( r.x()+b,r.y()+b, r.width()-2*b-bug, h2-2*b-bug ); + extrn += TQRegion( r.x(), r.y(), r.width(), h2 ); + intern += TQRegion( r.x()+b,r.y()+b, r.width()-2*b-bug, h2-2*b-bug ); break; } extrn = extrn - intern; - TQPointArray a; - a.setPoints( 3, r.x(), r.y(), r.x(), r.bottom(), r.right(), r.top() ); + 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() ); + 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( oldClip ); - p->setClipping( bReallyClip ); + p->setClipRegion( oldClip ); + p->setClipping( bReallyClip ); } #endif @@ -1571,56 +1571,56 @@ void NorwegianWoodStyle::drawSemicircleButton( qpalette.h> +#include <ntqpalette.h> #ifndef QT_NO_STYLE_WINDOWS -#include <qwindowsstyle.h> +#include <ntqwindowsstyle.h> -class MetalStyle : public TQWindowsStyle +class MetalStyle : public TQWindowsStyle { public: MetalStyle(); - void polish( TQApplication*); - void unPolish( TQApplication*); - void polish( TQWidget* ); - void unPolish( TQWidget* ); + void polish( TQApplication*); + void unPolish( TQApplication*); + void polish( TQWidget* ); + void unPolish( TQWidget* ); void drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, + TQPainter *p, + const TQRect &r, const TQColorGroup &cg, SFlags flags = Style_Default, const TQStyleOption& = TQStyleOption::Default) const; void drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQColorGroup &cg, SFlags how = Style_Default, const TQStyleOption& = TQStyleOption::Default ) const; void drawComplexControl( ComplexControl cc, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQColorGroup &cg, SFlags how = Style_Default, SCFlags sub = SC_All, SCFlags subActive = SC_None, const TQStyleOption& = TQStyleOption::Default ) const; - int pixelMetric( PixelMetric, const TQWidget * ) const; + int pixelMetric( PixelMetric, const TQWidget * ) const; 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; + TQPalette oldPalette; }; #endif @@ -1644,20 +1644,20 @@ private: #ifndef QT_NO_STYLE_WINDOWS -#include "qapplication.h" -#include "qcombobox.h" -#include "qpainter.h" -#include "qdrawutil.h" // for now -#include "qpixmap.h" // for now -#include "qpalette.h" // for now -#include "qwidget.h" -#include "qlabel.h" -#include "qimage.h" -#include "qpushbutton.h" -#include "qwidget.h" -#include "qrangecontrol.h" -#include "qscrollbar.h" -#include "qslider.h" +#include "ntqapplication.h" +#include "ntqcombobox.h" +#include "ntqpainter.h" +#include "ntqdrawutil.h" // for now +#include "ntqpixmap.h" // for now +#include "ntqpalette.h" // for now +#include "ntqwidget.h" +#include "ntqlabel.h" +#include "ntqimage.h" +#include "ntqpushbutton.h" +#include "ntqwidget.h" +#include "ntqrangecontrol.h" +#include "ntqscrollbar.h" +#include "ntqslider.h" #include <limits.h> @@ -1669,119 +1669,119 @@ private: -MetalStyle::MetalStyle() : TQWindowsStyle() { } +MetalStyle::MetalStyle() : TQWindowsStyle() { } /*! Reimplementation from TQStyle */ -void MetalStyle::polish( TQApplication *app) +void MetalStyle::polish( TQApplication *app) { - oldPalette = app->palette(); + oldPalette = app->palette(); // 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 ); - app->setFont( f, TRUE, "TQMenuBar"); - app->setFont( f, TRUE, "TQPopupMenu"); + TQFont f("times", app->font().pointSize() ); + f.setBold( TRUE ); + f.setItalic( TRUE ); + app->setFont( f, TRUE, "TQMenuBar"); + app->setFont( f, TRUE, "TQPopupMenu"); // TQPixmap button( stonedark_xpm ); - TQColor gold("#B9B9A5A54040"); //same as topgrad below - TQPixmap button( 1, 1 ); button.fill( gold ); + TQColor gold("#B9B9A5A54040"); //same as topgrad below + TQPixmap button( 1, 1 ); button.fill( gold ); - TQPixmap background(marble_xpm); - TQPixmap dark( 1, 1 ); dark.fill( red.dark() ); - TQPixmap mid( stone1_xpm ); - TQPixmap light( stone1_xpm );//1, 1 ); light.fill( green ); + TQPixmap background(marble_xpm); + TQPixmap dark( 1, 1 ); dark.fill( red.dark() ); + TQPixmap mid( stone1_xpm ); + TQPixmap light( stone1_xpm );//1, 1 ); light.fill( green ); - TQPalette op = app->palette(); + TQPalette op = app->palette(); - TQColor backCol( 227,227,227 ); + TQColor backCol( 227,227,227 ); // TQPalette op(white); - TQColorGroup active (op.active().foreground(), - TQBrush(op.active().button(),button), - TQBrush(op.active().light(), light), - TQBrush(op.active().dark(), dark), - TQBrush(op.active().mid(), mid), - op.active().text(), + TQColorGroup active (op.active().foreground(), + TQBrush(op.active().button(),button), + TQBrush(op.active().light(), light), + TQBrush(op.active().dark(), dark), + TQBrush(op.active().mid(), mid), + op.active().text(), TQt::white, - op.active().base(),// TQColor(236,182,120), + 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(), - TQBrush(op.disabled().button(),button), - TQBrush(op.disabled().light(), light), - op.disabled().dark(), - TQBrush(op.disabled().mid(), mid), - op.disabled().text(), + TQColorGroup disabled (op.disabled().foreground(), + TQBrush(op.disabled().button(),button), + TQBrush(op.disabled().light(), light), + op.disabled().dark(), + TQBrush(op.disabled().mid(), mid), + op.disabled().text(), TQt::white, - op.disabled().base(),// TQColor(236,182,120), + op.disabled().base(),// TQColor(236,182,120), TQBrush(backCol, background) ); - TQPalette newPalette( active, disabled, active ); - app->setPalette( newPalette, TRUE ); + TQPalette newPalette( active, disabled, active ); + app->setPalette( newPalette, TRUE ); } /*! Reimplementation from TQStyle */ -void MetalStyle::unPolish( TQApplication *app) +void MetalStyle::unPolish( TQApplication *app) { - app->setPalette(oldPalette, TRUE); - app->setFont( app->font(), TRUE ); + app->setPalette(oldPalette, TRUE); + app->setFont( app->font(), TRUE ); } /*! Reimplementation from TQStyle */ -void MetalStyle::polish( TQWidget* w) +void MetalStyle::polish( TQWidget* w) { // the polish function sets some widgets to transparent mode and // some to translate background mode in order to get the full // benefit from the nice pixmaps in the color group. - if (w->inherits("TQPushButton")){ - w->setBackgroundMode( TQWidget::NoBackground ); + if (w->inherits("TQPushButton")){ + w->setBackgroundMode( TQWidget::NoBackground ); return; } - if ( !w->isTopLevel() ) { - if ( w->backgroundPixmap() ) - w->setBackgroundOrigin( TQWidget::WindowOrigin ); + if ( !w->isTopLevel() ) { + if ( w->backgroundPixmap() ) + w->setBackgroundOrigin( TQWidget::WindowOrigin ); } } -void MetalStyle::unPolish( TQWidget* w) +void MetalStyle::unPolish( TQWidget* w) { // the polish function sets some widgets to transparent mode and // some to translate background mode in order to get the full // benefit from the nice pixmaps in the color group. - if (w->inherits("TQPushButton")){ - w->setBackgroundMode( TQWidget::PaletteButton ); + if (w->inherits("TQPushButton")){ + w->setBackgroundMode( TQWidget::PaletteButton ); return; } - if ( !w->isTopLevel() ) { - if ( w->backgroundPixmap() ) - w->setBackgroundOrigin( TQWidget::WidgetOrigin ); + if ( !w->isTopLevel() ) { + if ( w->backgroundPixmap() ) + w->setBackgroundOrigin( TQWidget::WidgetOrigin ); } } -void MetalStyle::drawPrimitive( PrimitiveElement pe, - TQPainter *p, - const TQRect &r, +void MetalStyle::drawPrimitive( PrimitiveElement pe, + TQPainter *p, + const TQRect &r, const TQColorGroup &cg, SFlags flags, const TQStyleOption& opt ) const { @@ -1792,41 +1792,41 @@ void MetalStyle::unPolish( drawMetalButton( p, r.x(), r.y(), r.width(), r.height(), + drawMetalButton( p, r.x(), r.y(), r.width(), r.height(), (flags & (Style_Sunken|Style_On|Style_Down)), TRUE, !(flags & Style_Raised) ); break; case PE_PanelMenuBar: - drawMetalFrame( p, r.x(), r.y(), r.width(), r.height() ); + drawMetalFrame( p, r.x(), r.y(), r.width(), r.height() ); break; case PE_ScrollBarAddLine: - drawMetalButton( p, r.x(), r.y(), r.width(), r.height(), + drawMetalButton( p, r.x(), r.y(), r.width(), r.height(), flags & Style_Down, !( flags & Style_Horizontal ) ); - drawPrimitive( (flags & Style_Horizontal) ? PE_ArrowRight :PE_ArrowDown, + drawPrimitive( (flags & Style_Horizontal) ? PE_ArrowRight :PE_ArrowDown, p, r, cg, flags, opt ); break; case PE_ScrollBarSubLine: - drawMetalButton( p, r.x(), r.y(), r.width(), r.height(), + drawMetalButton( p, r.x(), r.y(), r.width(), r.height(), flags & Style_Down, !( flags & Style_Horizontal ) ); - drawPrimitive( (flags & Style_Horizontal) ? PE_ArrowLeft : PE_ArrowUp, + drawPrimitive( (flags & Style_Horizontal) ? PE_ArrowLeft : PE_ArrowUp, p, r, cg, flags, opt ); break; case PE_ScrollBarSlider: - drawMetalButton( p, r.x(), r.y(), r.width(), r.height(), FALSE, + drawMetalButton( p, r.x(), r.y(), r.width(), r.height(), FALSE, flags & Style_Horizontal ); break; default: - TQWindowsStyle::drawPrimitive( pe, p, r, cg, flags, opt ); + TQWindowsStyle::drawPrimitive( pe, p, r, cg, flags, opt ); break; } } -void MetalStyle::drawControl( ControlElement element, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, +void MetalStyle::drawControl( ControlElement element, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQColorGroup &cg, SFlags how, const TQStyleOption& opt ) const @@ -1834,102 +1834,102 @@ void MetalStyle::unPolish( TQPushButton *btn; - btn = (const TQPushButton*)widget; + const TQPushButton *btn; + btn = (const TQPushButton*)widget; int x1, y1, x2, y2; - r.coords( &x1, &y1, &x2, &y2 ); + 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; - if ( btn->isDown() ) + TQBrush fill; + if ( btn->isDown() ) fill = cg.brush( TQColorGroup::Mid ); - else if ( btn->isOn() ) + else if ( btn->isOn() ) fill = TQBrush( cg.mid(), Dense4Pattern ); else fill = cg.brush( TQColorGroup::Button ); - if ( btn->isDefault() ) { - TQPointArray a; + 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; y2 -= 2; } SFlags flags = Style_Default; - if ( btn->isOn() ) + if ( btn->isOn() ) flags |= Style_On; - if ( btn->isDown() ) + if ( btn->isDown() ) flags |= Style_Down; - if ( !btn->isFlat() && !btn->isDown() ) + if ( !btn->isFlat() && !btn->isDown() ) flags |= Style_Raised; - drawPrimitive( PE_ButtonCommand, p, + drawPrimitive( PE_ButtonCommand, p, TQRect( x1, y1, x2 - x1 + 1, y2 - y1 + 1), cg, flags, opt ); - if ( btn->isMenuButton() ) { + if ( btn->isMenuButton() ) { flags = Style_Default; - if ( btn->isEnabled() ) + if ( btn->isEnabled() ) flags |= Style_Enabled; int dx = ( y1 - y2 - 4 ) / 3; - drawPrimitive( PE_ArrowDown, p, + drawPrimitive( PE_ArrowDown, p, TQRect(x2 - dx, dx, y1, y2 - y1), cg, flags, opt ); } - if ( p->brush().style() != NoBrush ) - p->setBrush( NoBrush ); + if ( p->brush().style() != NoBrush ) + p->setBrush( NoBrush ); break; } case CE_PushButtonLabel: { - const TQPushButton *btn; - btn = (const TQPushButton*)widget; + const TQPushButton *btn; + btn = (const TQPushButton*)widget; int x, y, w, h; - r.rect( &x, &y, &w, &h ); + r.rect( &x, &y, &w, &h ); int x1, y1, x2, y2; - r.coords( &x1, &y1, &x2, &y2 ); + r.coords( &x1, &y1, &x2, &y2 ); int dx = 0; int dy = 0; - if ( btn->isMenuButton() ) + if ( btn->isMenuButton() ) dx = ( y2 - y1 ) / 3; - if ( btn->isOn() || btn->isDown() ) { + if ( btn->isOn() || btn->isDown() ) { dx--; dy--; } if ( dx || dy ) - p->translate( dx, dy ); + p->translate( dx, dy ); x += 2; y += 2; w -= 4; h -= 4; - drawItem( p, TQRect( x, y, w, h ), + drawItem( p, TQRect( x, y, w, h ), AlignCenter|ShowPrefix, - cg, btn->isEnabled(), - btn->pixmap(), btn->text(), -1, - (btn->isDown() || btn->isOn())? &cg.brightText() : &cg.buttonText() ); + cg, btn->isEnabled(), + btn->pixmap(), btn->text(), -1, + (btn->isDown() || btn->isOn())? &cg.brightText() : &cg.buttonText() ); if ( dx || dy ) - p->translate( -dx, -dy ); + p->translate( -dx, -dy ); break; } default: - TQWindowsStyle::drawControl( element, p, widget, r, cg, how, opt ); + TQWindowsStyle::drawControl( element, p, widget, r, cg, how, opt ); break; } } -void MetalStyle::drawComplexControl( ComplexControl cc, - TQPainter *p, - const TQWidget *widget, - const TQRect &r, +void MetalStyle::drawComplexControl( ComplexControl cc, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, const TQColorGroup &cg, SFlags how, SCFlags sub, @@ -1939,38 +1939,38 @@ void MetalStyle::unPolish( TQSlider *slider = ( const TQSlider* ) widget; - TQRect handle = querySubControlMetrics( CC_Slider, widget, + const TQSlider *slider = ( const TQSlider* ) widget; + TQRect handle = querySubControlMetrics( CC_Slider, widget, SC_SliderHandle, opt); if ( sub & SC_SliderGroove ) - TQWindowsStyle::drawComplexControl( cc, p, widget, r, cg, how, + TQWindowsStyle::drawComplexControl( cc, p, widget, r, cg, how, SC_SliderGroove, subActive, opt ); - if ( (sub & SC_SliderHandle) && handle.isValid() ) - drawMetalButton( p, handle.x(), handle.y(), handle.width(), - handle.height(), FALSE, - slider->orientation() == TQSlider::Horizontal); + if ( (sub & SC_SliderHandle) && handle.isValid() ) + drawMetalButton( p, handle.x(), handle.y(), handle.width(), + handle.height(), FALSE, + slider->orientation() == TQSlider::Horizontal); break; } case CC_ComboBox: { // not exactly correct... - const TQComboBox *cmb = ( const TQComboBox* ) widget; + const TQComboBox *cmb = ( const TQComboBox* ) widget; - qDrawWinPanel( p, r.x(), r.y(), r.width(), r.height(), cg, TRUE, - cmb->isEnabled() ? &cg.brush( TQColorGroup::Base ) : + 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, + drawMetalButton( p, r.x() + r.width() - 2 - 16, r.y() + 2, 16, r.height() - 4, how & Style_Sunken, TRUE ); - drawPrimitive( PE_ArrowDown, p, - TQRect( r.x() + r.width() - 2 - 16 + 2, - r.y() + 2 + 2, 16 - 4, r.height() - 4 -4 ), + drawPrimitive( PE_ArrowDown, p, + TQRect( r.x() + r.width() - 2 - 16 + 2, + r.y() + 2 + 2, 16 - 4, r.height() - 4 -4 ), cg, - cmb->isEnabled() ? Style_Enabled : Style_Default, + cmb->isEnabled() ? Style_Enabled : Style_Default, opt ); break; } default: - TQWindowsStyle::drawComplexControl( cc, p, widget, r, cg, how, sub, subActive, + TQWindowsStyle::drawComplexControl( cc, p, widget, r, cg, how, sub, subActive, opt ); break; } @@ -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( TQP -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( TQPa //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( T y2 = y2 - 2; #define DRAWLINE if (horz) \ - p->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( T int h1, h2, s1, s2, v1, v2; if ( !sunken ) { - 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; } @@ -2106,7 +2106,7 @@ void MetalStyle::drawMetalGradient( T -int MetalStyle::pixelMetric( PixelMetric metric, const TQWidget *w ) const +int MetalStyle::pixelMetric( PixelMetric metric, const TQWidget *w ) const { switch ( metric ) { case PM_MenuBarFrameWidth: @@ -2134,28 +2134,28 @@ void MetalStyle::drawMetalGradient( T #ifndef THEMES_H #define THEMES_H -#include <qmainwindow.h> -#include <qfont.h> +#include <ntqmainwindow.h> +#include <ntqfont.h> class TQTabWidget; -class Themes: public TQMainWindow +class Themes: public TQMainWindow { Q_OBJECT public: - Themes( TQWidget *parent = 0, const char *name = 0, WFlags f = WType_TopLevel ); + Themes( TQWidget *parent = 0, const char *name = 0, WFlags f = WType_TopLevel ); protected: - TQTabWidget *tabwidget; + TQTabWidget *tabwidget; protected slots: - void makeStyle(const TQString &); + void makeStyle(const TQString &); void about(); void aboutTQt(); private: - TQFont appFont; + TQFont appFont; }; @@ -2186,137 +2186,137 @@ private: #include "../rangecontrols/rangecontrols.h" #include "../richtext/richtext.h" -#include <qtabwidget.h> -#include <qapplication.h> -#include <qpopupmenu.h> -#include <qmenubar.h> -#include <qmessagebox.h> -#include <qfont.h> -#include <qstylefactory.h> -#include <qaction.h> -#include <qsignalmapper.h> -#include <qdict.h> - -Themes::Themes( TQWidget *parent, const char *name, WFlags f ) - : TQMainWindow( parent, name, f ) +#include <ntqtabwidget.h> +#include <ntqapplication.h> +#include <ntqpopupmenu.h> +#include <ntqmenubar.h> +#include <ntqmessagebox.h> +#include <ntqfont.h> +#include <ntqstylefactory.h> +#include <ntqaction.h> +#include <ntqsignalmapper.h> +#include <ntqdict.h> + +Themes::Themes( TQWidget *parent, const char *name, WFlags f ) + : TQMainWindow( parent, name, f ) { - appFont = TQApplication::font(); - tabwidget = new TQTabWidget( this ); + appFont = TQApplication::font(); + tabwidget = new TQTabWidget( this ); - tabwidget->addTab( new ButtonsGroups( tabwidget ), "Buttons/Groups" ); - TQHBox *hbox = new TQHBox( tabwidget ); - hbox->setMargin( 5 ); + tabwidget->addTab( new ButtonsGroups( tabwidget ), "Buttons/Groups" ); + TQHBox *hbox = new TQHBox( tabwidget ); + hbox->setMargin( 5 ); (void)new LineEdits( hbox ); (void)new ProgressBar( hbox ); - tabwidget->addTab( hbox, "Lineedits/Progressbar" ); - tabwidget->addTab( new ListBoxCombo( tabwidget ), "Listboxes/Comboboxes" ); - tabwidget->addTab( new CheckLists( tabwidget ), "Listviews" ); - tabwidget->addTab( new RangeControls( tabwidget ), "Rangecontrols" ); - tabwidget->addTab( new MyRichText( tabwidget ), "Fortune" ); + tabwidget->addTab( hbox, "Lineedits/Progressbar" ); + tabwidget->addTab( new ListBoxCombo( tabwidget ), "Listboxes/Comboboxes" ); + tabwidget->addTab( new CheckLists( tabwidget ), "Listviews" ); + tabwidget->addTab( new RangeControls( tabwidget ), "Rangecontrols" ); + tabwidget->addTab( new MyRichText( tabwidget ), "Fortune" ); - setCentralWidget( tabwidget ); + setCentralWidget( tabwidget ); - TQPopupMenu *style = new TQPopupMenu( this ); - style->setCheckable( TRUE ); - menuBar()->insertItem( "&Style" , style ); + TQPopupMenu *style = new TQPopupMenu( this ); + style->setCheckable( TRUE ); + menuBar()->insertItem( "&Style" , style ); - style->setCheckable( TRUE ); + style->setCheckable( TRUE ); TQActionGroup *ag = new TQActionGroup( this, 0 ); ag->setExclusive( TRUE ); - TQSignalMapper *styleMapper = new TQSignalMapper( this ); - connect( styleMapper, SIGNAL( mapped( const TQString& ) ), this, SLOT( makeStyle( const TQString& ) ) ); - TQStringList list = TQStyleFactory::keys(); - list.sort(); + TQSignalMapper *styleMapper = new TQSignalMapper( this ); + connect( styleMapper, SIGNAL( mapped( const TQString& ) ), this, SLOT( makeStyle( const TQString& ) ) ); + TQStringList list = TQStyleFactory::keys(); + list.sort(); #ifndef QT_NO_STYLE_WINDOWS - list.insert(list.begin(), "Norwegian Wood"); - list.insert(list.begin(), "Metal"); + list.insert(list.begin(), "Norwegian Wood"); + list.insert(list.begin(), "Metal"); #endif - TQDict<int> stylesDict( 17, FALSE ); - for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { - TQString styleStr = *it; - TQString styleAccel = styleStr; - if ( stylesDict[styleAccel.left(1)] ) { - for ( uint i = 0; i < styleAccel.length(); i++ ) { - if ( !stylesDict[styleAccel.mid( i, 1 )] ) { - stylesDict.insert(styleAccel.mid( i, 1 ), (const int *)1); - styleAccel = styleAccel.insert( i, '&' ); + TQDict<int> stylesDict( 17, FALSE ); + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + TQString styleStr = *it; + TQString styleAccel = styleStr; + if ( stylesDict[styleAccel.left(1)] ) { + for ( uint i = 0; i < styleAccel.length(); i++ ) { + if ( !stylesDict[styleAccel.mid( i, 1 )] ) { + stylesDict.insert(styleAccel.mid( i, 1 ), (const int *)1); + styleAccel = styleAccel.insert( i, '&' ); break; } } } else { - stylesDict.insert(styleAccel.left(1), (const int *)1); + stylesDict.insert(styleAccel.left(1), (const int *)1); styleAccel = "&"+styleAccel; } - TQAction *a = new TQAction( styleStr, TQIconSet(), styleAccel, 0, ag, 0, ag->isExclusive() ); - connect( a, SIGNAL( activated() ), styleMapper, SLOT(map()) ); - styleMapper->setMapping( a, a->text() ); + TQAction *a = new TQAction( styleStr, TQIconSet(), styleAccel, 0, ag, 0, ag->isExclusive() ); + connect( a, SIGNAL( activated() ), styleMapper, SLOT(map()) ); + styleMapper->setMapping( a, a->text() ); } ag->addTo(style); - style->insertSeparator(); - style->insertItem("&Quit", qApp, SLOT( quit() ), CTRL | Key_Q ); + style->insertSeparator(); + style->insertItem("&Quit", qApp, SLOT( quit() ), CTRL | Key_Q ); - TQPopupMenu * help = new TQPopupMenu( this ); - menuBar()->insertSeparator(); - menuBar()->insertItem( "&Help", help ); - help->insertItem( "&About", this, SLOT(about()), Key_F1); - help->insertItem( "About &TQt", this, SLOT(aboutTQt())); + TQPopupMenu * help = new TQPopupMenu( this ); + menuBar()->insertSeparator(); + menuBar()->insertItem( "&Help", help ); + help->insertItem( "&About", this, SLOT(about()), Key_F1); + help->insertItem( "About &TQt", this, SLOT(aboutTQt())); #ifndef QT_NO_STYLE_WINDOWS - qApp->setStyle( new NorwegianWoodStyle ); + qApp->setStyle( new NorwegianWoodStyle ); #endif } -void Themes::makeStyle(const TQString &style) +void Themes::makeStyle(const TQString &style) { if(style == "Norwegian Wood") { #ifndef QT_NO_STYLE_WINDOWS - qApp->setStyle( new NorwegianWoodStyle ); + qApp->setStyle( new NorwegianWoodStyle ); #endif } else if( style == "Metal" ) { #ifndef QT_NO_STYLE_WINDOWS - qApp->setStyle( new MetalStyle ); + qApp->setStyle( new MetalStyle ); #endif } else { - qApp->setStyle(style); + qApp->setStyle(style); if(style == "Platinum") { - TQPalette p( TQColor( 239, 239, 239 ) ); - qApp->setPalette( p, TRUE ); - qApp->setFont( appFont, TRUE ); + TQPalette p( TQColor( 239, 239, 239 ) ); + qApp->setPalette( p, TRUE ); + qApp->setFont( appFont, TRUE ); } else if(style == "Windows") { - qApp->setFont( appFont, TRUE ); + qApp->setFont( appFont, TRUE ); } else if(style == "CDE") { - TQPalette p( TQColor( 75, 123, 130 ) ); - p.setColor( TQPalette::Active, TQColorGroup::Base, TQColor( 55, 77, 78 ) ); - p.setColor( TQPalette::Inactive, TQColorGroup::Base, TQColor( 55, 77, 78 ) ); - p.setColor( TQPalette::Disabled, TQColorGroup::Base, TQColor( 55, 77, 78 ) ); - p.setColor( TQPalette::Active, TQColorGroup::Highlight, TQt::white ); - p.setColor( TQPalette::Active, TQColorGroup::HighlightedText, TQColor( 55, 77, 78 ) ); - p.setColor( TQPalette::Inactive, TQColorGroup::Highlight, TQt::white ); - p.setColor( TQPalette::Inactive, TQColorGroup::HighlightedText, TQColor( 55, 77, 78 ) ); - p.setColor( TQPalette::Disabled, TQColorGroup::Highlight, TQt::white ); - p.setColor( TQPalette::Disabled, TQColorGroup::HighlightedText, TQColor( 55, 77, 78 ) ); - p.setColor( TQPalette::Active, TQColorGroup::Foreground, TQt::white ); - p.setColor( TQPalette::Active, TQColorGroup::Text, TQt::white ); - p.setColor( TQPalette::Active, TQColorGroup::ButtonText, TQt::white ); - p.setColor( TQPalette::Inactive, TQColorGroup::Foreground, TQt::white ); - p.setColor( TQPalette::Inactive, TQColorGroup::Text, TQt::white ); - p.setColor( TQPalette::Inactive, TQColorGroup::ButtonText, TQt::white ); - p.setColor( TQPalette::Disabled, TQColorGroup::Foreground, TQt::lightGray ); - p.setColor( TQPalette::Disabled, TQColorGroup::Text, TQt::lightGray ); - p.setColor( TQPalette::Disabled, TQColorGroup::ButtonText, TQt::lightGray ); - qApp->setPalette( p, TRUE ); - qApp->setFont( TQFont( "times", appFont.pointSize() ), TRUE ); + TQPalette p( TQColor( 75, 123, 130 ) ); + p.setColor( TQPalette::Active, TQColorGroup::Base, TQColor( 55, 77, 78 ) ); + p.setColor( TQPalette::Inactive, TQColorGroup::Base, TQColor( 55, 77, 78 ) ); + p.setColor( TQPalette::Disabled, TQColorGroup::Base, TQColor( 55, 77, 78 ) ); + p.setColor( TQPalette::Active, TQColorGroup::Highlight, TQt::white ); + p.setColor( TQPalette::Active, TQColorGroup::HighlightedText, TQColor( 55, 77, 78 ) ); + p.setColor( TQPalette::Inactive, TQColorGroup::Highlight, TQt::white ); + p.setColor( TQPalette::Inactive, TQColorGroup::HighlightedText, TQColor( 55, 77, 78 ) ); + p.setColor( TQPalette::Disabled, TQColorGroup::Highlight, TQt::white ); + p.setColor( TQPalette::Disabled, TQColorGroup::HighlightedText, TQColor( 55, 77, 78 ) ); + p.setColor( TQPalette::Active, TQColorGroup::Foreground, TQt::white ); + p.setColor( TQPalette::Active, TQColorGroup::Text, TQt::white ); + p.setColor( TQPalette::Active, TQColorGroup::ButtonText, TQt::white ); + p.setColor( TQPalette::Inactive, TQColorGroup::Foreground, TQt::white ); + p.setColor( TQPalette::Inactive, TQColorGroup::Text, TQt::white ); + p.setColor( TQPalette::Inactive, TQColorGroup::ButtonText, TQt::white ); + p.setColor( TQPalette::Disabled, TQColorGroup::Foreground, TQt::lightGray ); + p.setColor( TQPalette::Disabled, TQColorGroup::Text, TQt::lightGray ); + p.setColor( TQPalette::Disabled, TQColorGroup::ButtonText, TQt::lightGray ); + qApp->setPalette( p, TRUE ); + qApp->setFont( TQFont( "times", appFont.pointSize() ), TRUE ); } else if(style == "Motif" || style == "MotifPlus") { - TQPalette p( TQColor( 192, 192, 192 ) ); - qApp->setPalette( p, TRUE ); - qApp->setFont( appFont, TRUE ); + TQPalette p( TQColor( 192, 192, 192 ) ); + qApp->setPalette( p, TRUE ); + qApp->setFont( appFont, TRUE ); } } } void Themes::about() { - TQMessageBox::about( this, "TQt Themes Example", + TQMessageBox::about( this, "TQt Themes Example", "<p>This example demonstrates the concept of " "<b>generalized GUI styles </b> first introduced " " with the 2.0 release of TQt.</p>" ); @@ -2325,7 +2325,7 @@ void Themes::about() void Themes::aboutTQt() { - TQMessageBox::aboutTQt( this, "TQt Themes Example" ); + TQMessageBox::aboutTQt( this, "TQt Themes Example" ); } @@ -2343,24 +2343,24 @@ void Themes::aboutTQt() ** *****************************************************************************/ -#include <qapplication.h> -#include <qwindowsstyle.h> +#include <ntqapplication.h> +#include <ntqwindowsstyle.h> #include "themes.h" #include "metal.h" int main( int argc, char ** argv ) { - TQApplication::setColorSpec( TQApplication::ManyColor ); - TQApplication a( argc, argv ); + TQApplication::setColorSpec( TQApplication::ManyColor ); + TQApplication a( argc, argv ); Themes themes; - themes.setCaption( "TQt Example - Themes (TQStyle)" ); - themes.resize( 640, 400 ); - a.setMainWidget( &themes ); - themes.show(); + themes.setCaption( "TQt Example - Themes (TQStyle)" ); + themes.resize( 640, 400 ); + a.setMainWidget( &themes ); + themes.show(); - return a.exec(); + return a.exec(); } -- cgit v1.2.1