summaryrefslogtreecommitdiffstats
path: root/src/dialogs/tqcolordialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogs/tqcolordialog.cpp')
-rw-r--r--src/dialogs/tqcolordialog.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/src/dialogs/tqcolordialog.cpp b/src/dialogs/tqcolordialog.cpp
index 43e77866f..a80b63bc1 100644
--- a/src/dialogs/tqcolordialog.cpp
+++ b/src/dialogs/tqcolordialog.cpp
@@ -78,7 +78,7 @@ class TQWellArray : public TQGridView
TQ_PROPERTY( int selectedRow READ selectedRow )
public:
- TQWellArray( TQWidget* parent=0, const char* name=0, bool popup = FALSE );
+ TQWellArray( TQWidget* parent=0, const char* name=0, bool popup = false );
~TQWellArray() {}
TQString cellContent( int row, int col ) const;
@@ -175,7 +175,7 @@ TQWellArray::TQWellArray( TQWidget *parent, const char * name, bool popup )
selRow = -1;
if ( smallStyle )
- setMouseTracking( TRUE );
+ setMouseTracking( true );
}
@@ -411,13 +411,13 @@ void TQWellArray::keyPressEvent( TQKeyEvent* e )
if( curRow > 0 )
setCurrent( curRow - 1, curCol);
else if ( smallStyle )
- focusNextPrevChild( FALSE );
+ focusNextPrevChild( false );
break;
case Key_Down:
if( curRow < numRows()-1 )
setCurrent( curRow + 1, curCol);
else if ( smallStyle )
- focusNextPrevChild( TRUE );
+ focusNextPrevChild( true );
break;
case Key_Space:
case Key_Return:
@@ -433,17 +433,17 @@ void TQWellArray::keyPressEvent( TQKeyEvent* e )
//////////// TQWellArray END
-static bool initrgb = FALSE;
+static bool initrgb = false;
static TQRgb stdrgb[6*8];
static TQRgb cusrgb[2*8];
-static bool customSet = FALSE;
+static bool customSet = false;
static void initRGB()
{
if ( initrgb )
return;
- initrgb = TRUE;
+ initrgb = true;
int i = 0;
for ( int g = 0; g < 4; g++ )
for ( int r = 0; r < 4; r++ )
@@ -490,7 +490,7 @@ void TQColorDialog::setCustomColor( int i, TQRgb c )
#endif
return;
}
- customSet = TRUE;
+ customSet = true;
cusrgb[i] = c;
}
@@ -521,7 +521,7 @@ class TQColorWell : public TQWellArray
{
public:
TQColorWell( TQWidget *parent, int r, int c, TQRgb *vals )
- :TQWellArray( parent, "" ), values( vals ), mousePressed( FALSE ), oldCurrent( -1, -1 )
+ :TQWellArray( parent, "" ), values( vals ), mousePressed( false ), oldCurrent( -1, -1 )
{ setNumRows(r), setNumCols(c); setSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum) ); }
protected:
@@ -554,7 +554,7 @@ void TQColorWell::mousePressEvent( TQMouseEvent *e )
{
oldCurrent = TQPoint( selectedRow(), selectedColumn() );
TQWellArray::mousePressEvent( e );
- mousePressed = TRUE;
+ mousePressed = true;
pressPos = e->pos();
}
@@ -575,7 +575,7 @@ void TQColorWell::mouseMoveEvent( TQMouseEvent *e )
p.drawRect( 0, 0, pix.width(), pix.height() );
p.end();
drg->setPixmap( pix );
- mousePressed = FALSE;
+ mousePressed = false;
drg->dragCopy();
}
#endif
@@ -613,7 +613,7 @@ void TQColorWell::dropEvent( TQDropEvent *e )
TQColor col;
TQColorDrag::decode( e, col );
values[ i ] = col.rgb();
- repaintContents( FALSE );
+ repaintContents( false );
e->accept();
} else {
e->ignore();
@@ -627,7 +627,7 @@ void TQColorWell::mouseReleaseEvent( TQMouseEvent *e )
if ( !mousePressed )
return;
TQWellArray::mouseReleaseEvent( e );
- mousePressed = FALSE;
+ mousePressed = false;
}
class TQColorPicker : public TQFrame
@@ -738,7 +738,7 @@ void TQColorLuminancePicker::setVal( int v )
return;
val = TQMAX( 0, TQMIN(v,255));
delete pix; pix=0;
- repaint( FALSE ); //###
+ repaint( false ); //###
emit newHsv( hue, sat, val );
}
@@ -773,7 +773,7 @@ void TQColorLuminancePicker::paintEvent( TQPaintEvent * )
TQPainter p(this);
p.drawPixmap( 1, coff, *pix );
const TQColorGroup &g = colorGroup();
- qDrawShadePanel( &p, r, g, TRUE );
+ qDrawShadePanel( &p, r, g, true );
p.setPen( g.foreground() );
p.setBrush( g.foreground() );
TQPointArray a;
@@ -789,7 +789,7 @@ void TQColorLuminancePicker::setCol( int h, int s , int v )
hue = h;
sat = s;
delete pix; pix=0;
- repaint( FALSE );//####
+ repaint( false );//####
}
TQPoint TQColorPicker::colPt()
@@ -842,7 +842,7 @@ void TQColorPicker::setCol( int h, int s )
r = r.unite( TQRect( colPt(), TQSize(20,20) ) );
r.moveBy( contentsRect().x()-9, contentsRect().y()-9 );
// update( r );
- repaint( r, FALSE );
+ repaint( r, false );
}
void TQColorPicker::mouseMoveEvent( TQMouseEvent *m )
@@ -918,7 +918,7 @@ public:
TQString s;
s.setNum(i);
bool block = signalsBlocked();
- blockSignals(TRUE);
+ blockSignals(true);
setText( s );
blockSignals(block);
}
@@ -974,8 +974,8 @@ public:
TQColorShowLabel( TQWidget *parent ) : TQFrame( parent, "qt_colorshow_lbl" ) {
setFrameStyle( TQFrame::Panel|TQFrame::Sunken );
setBackgroundMode( PaletteBackground );
- setAcceptDrops( TRUE );
- mousePressed = FALSE;
+ setAcceptDrops( true );
+ mousePressed = false;
}
void setColor( TQColor c ) { col = c; }
@@ -1018,7 +1018,7 @@ void TQColorShower::showAlpha( bool b )
void TQColorShowLabel::mousePressEvent( TQMouseEvent *e )
{
- mousePressed = TRUE;
+ mousePressed = true;
pressPos = e->pos();
}
@@ -1035,7 +1035,7 @@ void TQColorShowLabel::mouseMoveEvent( TQMouseEvent *e )
p.drawRect( 0, 0, pix.width(), pix.height() );
p.end();
drg->setPixmap( pix );
- mousePressed = FALSE;
+ mousePressed = false;
drg->dragCopy();
}
#endif
@@ -1058,7 +1058,7 @@ void TQColorShowLabel::dropEvent( TQDropEvent *e )
{
if ( TQColorDrag::canDecode( e ) ) {
TQColorDrag::decode( e, col );
- repaint( FALSE );
+ repaint( false );
emit colorDropped( col.rgb() );
e->accept();
} else {
@@ -1071,7 +1071,7 @@ void TQColorShowLabel::mouseReleaseEvent( TQMouseEvent * )
{
if ( !mousePressed )
return;
- mousePressed = FALSE;
+ mousePressed = false;
}
TQColorShower::TQColorShower( TQWidget *parent, const char *name )
@@ -1154,12 +1154,12 @@ TQColorShower::TQColorShower( TQWidget *parent, const char *name )
void TQColorShower::showCurrentColor()
{
lab->setColor( currentColor() );
- lab->repaint(FALSE); //###
+ lab->repaint(false); //###
}
void TQColorShower::rgbEd()
{
- rgbOriginal = TRUE;
+ rgbOriginal = true;
if ( alphaEd->isVisible() )
curCol = tqRgba( rEd->val(), gEd->val(), bEd->val(), currentAlpha() );
else
@@ -1177,7 +1177,7 @@ void TQColorShower::rgbEd()
void TQColorShower::hsvEd()
{
- rgbOriginal = FALSE;
+ rgbOriginal = false;
hue = hEd->val();
sat = sEd->val();
val = vEd->val();
@@ -1194,7 +1194,7 @@ void TQColorShower::hsvEd()
void TQColorShower::setRgb( TQRgb rgb )
{
- rgbOriginal = TRUE;
+ rgbOriginal = true;
curCol = rgb;
rgb2hsv( currentColor(), hue, sat, val );
@@ -1212,7 +1212,7 @@ void TQColorShower::setRgb( TQRgb rgb )
void TQColorShower::setHsv( int h, int s, int v )
{
- rgbOriginal = FALSE;
+ rgbOriginal = false;
hue = h; val = v; sat = s; //Range check###
curCol = TQColor( hue, sat, val, TQColor::Hsv ).rgb();
@@ -1300,11 +1300,11 @@ void TQColorDialogPrivate::newStandard( int r, int c )
TQColorDialogPrivate::TQColorDialogPrivate( TQColorDialog *dialog ) :
TQObject(dialog)
{
- compact = FALSE;
+ compact = false;
// small displays (e.g. PDAs cannot fit the full color dialog,
// so just use the color picker.
if ( tqApp->desktop()->width() < 480 || tqApp->desktop()->height() < 350 )
- compact = TRUE;
+ compact = true;
nextCust = 0;
const int lumSpace = 3;
@@ -1335,7 +1335,7 @@ TQColorDialogPrivate::TQColorDialogPrivate( TQColorDialog *dialog ) :
custom = new TQColorWell( dialog, 2, 8, cusrgb );
custom->setCellWidth( 28 );
custom->setCellHeight( 24 );
- custom->setAcceptDrops( TRUE );
+ custom->setAcceptDrops( true );
connect( custom, TQ_SIGNAL(selected(int,int)), TQ_SLOT(newCustom(int,int)));
lab = new TQLabel( custom, TQColorDialog::tr( "&Custom colors") , dialog, "qt_custcolors_lbl" );
@@ -1345,7 +1345,7 @@ TQColorDialogPrivate::TQColorDialogPrivate( TQColorDialog *dialog ) :
TQPushButton *custbut =
new TQPushButton( TQColorDialog::tr("&Define Custom Colors >>"),
dialog, "qt_def_custcolors_lbl" );
- custbut->setEnabled( FALSE );
+ custbut->setEnabled( false );
leftLay->addWidget( custbut );
} else {
// better color picker size for small displays
@@ -1390,7 +1390,7 @@ TQColorDialogPrivate::TQColorDialogPrivate( TQColorDialog *dialog ) :
TQPushButton *ok, *cancel;
ok = new TQPushButton( TQColorDialog::tr("OK"), dialog, "qt_ok_btn" );
connect( ok, TQ_SIGNAL(clicked()), dialog, TQ_SLOT(accept()) );
- ok->setDefault(TRUE);
+ ok->setDefault(true);
cancel = new TQPushButton( TQColorDialog::tr("Cancel"), dialog, "qt_cancel_btn" );
connect( cancel, TQ_SIGNAL(clicked()), dialog, TQ_SLOT(reject()) );
buttons->addWidget( ok );
@@ -1410,7 +1410,7 @@ void TQColorDialogPrivate::addCustom()
{
cusrgb[nextCust] = cs->currentColor();
if (custom)
- custom->repaintContents( FALSE );
+ custom->repaintContents( false );
nextCust = (nextCust+1) % 16;
}
@@ -1446,7 +1446,7 @@ void TQColorDialogPrivate::addCustom()
/*!
Constructs a default color dialog with parent \a parent and called
- \a name. If \a modal is TRUE the dialog will be modal. Use
+ \a name. If \a modal is true the dialog will be modal. Use
setColor() to set an initial value.
\sa getColor()
@@ -1456,7 +1456,7 @@ TQColorDialog::TQColorDialog(TQWidget* parent, const char* name, bool modal) :
TQDialog(parent, name, modal, ( WType_Dialog | WStyle_Customize | WStyle_Title |
WStyle_DialogBorder | WStyle_SysMenu ) )
{
- setSizeGripEnabled( FALSE );
+ setSizeGripEnabled( false );
d = new TQColorDialogPrivate( this );
#ifndef TQT_NO_SETTINGS
@@ -1464,7 +1464,7 @@ TQColorDialog::TQColorDialog(TQWidget* parent, const char* name, bool modal) :
TQSettings settings;
settings.insertSearchPath( TQSettings::Windows, "/Trolltech" );
for ( int i = 0; i < 2*8; ++i ) {
- bool ok = FALSE;
+ bool ok = false;
TQRgb rgb = (TQRgb)settings.readNumEntry( "/TQt/customColors/" + TQString::number( i ), 0, &ok );
if ( ok )
cusrgb[i] = rgb;
@@ -1493,7 +1493,7 @@ TQColor TQColorDialog::getColor( const TQColor& initial, TQWidget *parent,
#endif
int allocContext = TQColor::enterAllocContext();
- TQColorDialog *dlg = new TQColorDialog( parent, name, TRUE ); //modal
+ TQColorDialog *dlg = new TQColorDialog( parent, name, true ); //modal
#ifndef TQT_NO_WIDGET_TOPEXTRA
dlg->setCaption( TQColorDialog::tr( "Select color" ) );
#endif
@@ -1516,8 +1516,8 @@ TQColor TQColorDialog::getColor( const TQColor& initial, TQWidget *parent,
initially set to \a initial. The dialog is a child of \a parent
and called \a name.
- If \a ok is non-null, \e *\a ok is set to TRUE if the user clicked
- OK, and to FALSE if the user clicked Cancel.
+ If \a ok is non-null, \e *\a ok is set to true if the user clicked
+ OK, and to false if the user clicked Cancel.
If the user clicks Cancel, the \a initial value is returned.
*/
@@ -1537,7 +1537,7 @@ TQRgb TQColorDialog::getRgba( TQRgb initial, bool *ok,
#endif
int allocContext = TQColor::enterAllocContext();
- TQColorDialog *dlg = new TQColorDialog( parent, name, TRUE ); //modal
+ TQColorDialog *dlg = new TQColorDialog( parent, name, true ); //modal
TQ_CHECK_PTR( dlg );
#ifndef TQT_NO_WIDGET_TOPEXTRA
@@ -1616,7 +1616,7 @@ void TQColorDialog::setColor( const TQColor& c )
void TQColorDialog::setSelectedAlpha( int a )
{
- d->showAlpha( TRUE );
+ d->showAlpha( true );
d->setCurrentAlpha( a );
}
@@ -1646,7 +1646,7 @@ bool TQColorDialog::selectColor( const TQColor& col )
d->standard->setCurrent( i, j );
d->standard->setSelected( i, j );
d->standard->setFocus();
- return TRUE;
+ return true;
}
}
}
@@ -1660,12 +1660,12 @@ bool TQColorDialog::selectColor( const TQColor& col )
d->custom->setCurrent( i, j );
d->custom->setSelected( i, j );
d->custom->setFocus();
- return TRUE;
+ return true;
}
}
}
}
- return FALSE;
+ return false;
}
#include "tqcolordialog.moc"