summaryrefslogtreecommitdiffstats
path: root/examples/showimg
diff options
context:
space:
mode:
Diffstat (limited to 'examples/showimg')
-rw-r--r--examples/showimg/imagetexteditor.cpp4
-rw-r--r--examples/showimg/showimg.cpp36
2 files changed, 20 insertions, 20 deletions
diff --git a/examples/showimg/imagetexteditor.cpp b/examples/showimg/imagetexteditor.cpp
index c007b3cb3..5c2beb59a 100644
--- a/examples/showimg/imagetexteditor.cpp
+++ b/examples/showimg/imagetexteditor.cpp
@@ -22,11 +22,11 @@
ImageTextEditor::ImageTextEditor( TQImage& i, TQWidget *parent, const char *name, WFlags f ) :
- TQDialog(parent,name,TRUE,f),
+ TQDialog(parent,name,true,f),
image(i)
{
TQVBoxLayout* vbox = new TQVBoxLayout(this,8);
- vbox->setAutoAdd(TRUE);
+ vbox->setAutoAdd(true);
TQGrid* controls = new TQGrid(3,TQGrid::Horizontal,this);
controls->setSpacing(8);
diff --git a/examples/showimg/showimg.cpp b/examples/showimg/showimg.cpp
index 09baf5c9f..a7288d68d 100644
--- a/examples/showimg/showimg.cpp
+++ b/examples/showimg/showimg.cpp
@@ -94,8 +94,8 @@ ImageViewer::ImageViewer( TQWidget *parent, const char *name, int wFlags )
ss = options->insertItem( "Smooth scaling" );
cc = options->insertItem( "Use color context" );
if ( TQApplication::colorSpec() == TQApplication::ManyColor )
- options->setItemEnabled( cc, FALSE );
- options->setCheckable( TRUE );
+ options->setItemEnabled( cc, false );
+ options->setCheckable( true );
setMenuItemFlags();
menubar->insertSeparator();
@@ -110,7 +110,7 @@ ImageViewer::ImageViewer( TQWidget *parent, const char *name, int wFlags )
status->setFrameStyle( TQFrame::WinPanel | TQFrame::Sunken );
status->setFixedHeight( fontMetrics().height() + 4 );
- setMouseTracking( TRUE );
+ setMouseTracking( true );
}
ImageViewer::~ImageViewer()
@@ -262,12 +262,12 @@ void ImageViewer::updateStatus()
int nalpha=0;
for (i=0; i<256; i++)
- alpha[i] = FALSE;
+ alpha[i] = false;
for (i=0; i<image.numColors(); i++) {
int alevel = image.color(i) >> 24;
if (!alpha[alevel]) {
- alpha[alevel] = TRUE;
+ alpha[alevel] = true;
nalpha++;
}
}
@@ -336,13 +336,13 @@ void ImageViewer::openFile()
format was unknown it will resize the widget to fit the errorText
message (see above) displayed in the current font.
- Returns TRUE if the image was successfully loaded.
+ Returns true if the image was successfully loaded.
*/
bool ImageViewer::loadImage( const TQString& fileName )
{
filename = fileName;
- bool ok = FALSE;
+ bool ok = false;
if ( !filename.isEmpty() ) {
TQApplication::setOverrideCursor( waitCursor ); // this might take time
ok = image.load(filename, 0);
@@ -378,9 +378,9 @@ bool ImageViewer::loadImage( const TQString& fileName )
bool ImageViewer::reconvertImage()
{
- bool success = FALSE;
+ bool success = false;
- if ( image.isNull() ) return FALSE;
+ if ( image.isNull() ) return false;
if ( alloc_context ) {
TQColor::destroyAllocContext( alloc_context );
@@ -399,7 +399,7 @@ bool ImageViewer::reconvertImage()
pmScaled = TQPixmap();
scale();
resize( width(), height() );
- success = TRUE; // load successful
+ success = true; // load successful
} else {
pm.resize(0,0); // couldn't load image
}
@@ -410,7 +410,7 @@ bool ImageViewer::reconvertImage()
if ( useColorContext() )
TQColor::leaveAllocContext();
- return success; // TRUE if loaded OK
+ return success; // true if loaded OK
}
bool ImageViewer::smooth() const
@@ -485,10 +485,10 @@ bool ImageViewer::convertEvent( TQMouseEvent* e, int& x, int& y)
x = nx;
y = ny;
updateStatus();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void ImageViewer::mousePressEvent( TQMouseEvent *e )
@@ -510,7 +510,7 @@ void ImageViewer::mouseMoveEvent( TQMouseEvent *e )
if (convertEvent(e,pickx,picky)) {
updateStatus();
if ((e->state()&LeftButton)) {
- may_be_other = FALSE;
+ may_be_other = false;
if ( clickx >= 0 && other) {
copyFrom(other);
}
@@ -550,7 +550,7 @@ void ImageViewer::giveHelp()
helptext += "</blockquote>";
helpmsg = new TQMessageBox( "Help", helptext,
- TQMessageBox::Information, TQMessageBox::Ok, 0, 0, 0, 0, FALSE );
+ TQMessageBox::Information, TQMessageBox::Ok, 0, 0, 0, 0, false );
}
helpmsg->show();
helpmsg->raise();
@@ -582,17 +582,17 @@ ImageViewer* ImageViewer::other = 0;
void ImageViewer::hFlip()
{
- setImage(image.mirror(TRUE,FALSE));
+ setImage(image.mirror(true,false));
}
void ImageViewer::vFlip()
{
- setImage(image.mirror(FALSE,TRUE));
+ setImage(image.mirror(false,true));
}
void ImageViewer::rot180()
{
- setImage(image.mirror(TRUE,TRUE));
+ setImage(image.mirror(true,true));
}
void ImageViewer::copy()