|
|
|
@ -36,7 +36,7 @@
|
|
|
|
|
#include <tqevent.h>
|
|
|
|
|
#include <tqtimer.h>
|
|
|
|
|
#include <tqcolor.h>
|
|
|
|
|
#include <tqbrush.h>
|
|
|
|
|
#include <brush.h>
|
|
|
|
|
#include <tqrect.h>
|
|
|
|
|
#include <tqfont.h>
|
|
|
|
|
#include <tqfontmetrics.h>
|
|
|
|
@ -192,13 +192,13 @@ void HistogramWidget::setHistogramGuideByColor(const DColor& color)
|
|
|
|
|
{
|
|
|
|
|
d->guideVisible = true;
|
|
|
|
|
d->colorGuide = color;
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HistogramWidget::reset()
|
|
|
|
|
{
|
|
|
|
|
d->guideVisible = false;
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HistogramWidget::customEvent(TQCustomEvent *event)
|
|
|
|
@ -220,15 +220,15 @@ void HistogramWidget::customEvent(TQCustomEvent *event)
|
|
|
|
|
{
|
|
|
|
|
if (d->clearFlag != HistogramWidgetPriv::HistogramDataLoading)
|
|
|
|
|
{
|
|
|
|
|
// enter initial tqrepaint wait, tqrepaint only after waiting
|
|
|
|
|
// enter initial repaint wait, repaint only after waiting
|
|
|
|
|
// a short time so that very fast computation does not create flicker
|
|
|
|
|
d->inInitialRepaintWait = true;
|
|
|
|
|
d->blinkTimer->start( 100 );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// after the initial tqrepaint, we can tqrepaint immediately
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
// after the initial repaint, we can repaint immediately
|
|
|
|
|
repaint(false);
|
|
|
|
|
d->blinkTimer->start( 200 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -245,21 +245,21 @@ void HistogramWidget::customEvent(TQCustomEvent *event)
|
|
|
|
|
|
|
|
|
|
// Send signals to refresh information if necessary.
|
|
|
|
|
// The signals may trigger multiple repaints, avoid this,
|
|
|
|
|
// we tqrepaint once afterwards.
|
|
|
|
|
// we repaint once afterwards.
|
|
|
|
|
setUpdatesEnabled(false);
|
|
|
|
|
|
|
|
|
|
notifyValuesChanged();
|
|
|
|
|
emit signalHistogramComputationDone(d->sixteenBits);
|
|
|
|
|
|
|
|
|
|
setUpdatesEnabled(true);
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
repaint(false);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
d->clearFlag = HistogramWidgetPriv::HistogramFailed;
|
|
|
|
|
d->blinkTimer->stop();
|
|
|
|
|
d->inInitialRepaintWait = false;
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
repaint(false);
|
|
|
|
|
setCursor( KCursor::arrowCursor() );
|
|
|
|
|
// Remove old histogram data from memory.
|
|
|
|
|
if (m_imageHistogram)
|
|
|
|
@ -285,7 +285,7 @@ void HistogramWidget::setDataLoading()
|
|
|
|
|
{
|
|
|
|
|
setCursor( KCursor::waitCursor() );
|
|
|
|
|
d->clearFlag = HistogramWidgetPriv::HistogramDataLoading;
|
|
|
|
|
// enter initial tqrepaint wait, tqrepaint only after waiting
|
|
|
|
|
// enter initial repaint wait, repaint only after waiting
|
|
|
|
|
// a short time so that very fast computation does not create flicker
|
|
|
|
|
d->inInitialRepaintWait = true;
|
|
|
|
|
d->pos = 0;
|
|
|
|
@ -299,7 +299,7 @@ void HistogramWidget::setLoadingFailed()
|
|
|
|
|
d->pos = 0;
|
|
|
|
|
d->blinkTimer->stop();
|
|
|
|
|
d->inInitialRepaintWait = false;
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
repaint(false);
|
|
|
|
|
setCursor( KCursor::arrowCursor() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -366,7 +366,7 @@ void HistogramWidget::updateSelectionData(uchar *s_data, uint s_w, uint s_h,
|
|
|
|
|
void HistogramWidget::slotBlinkTimerDone()
|
|
|
|
|
{
|
|
|
|
|
d->inInitialRepaintWait = false;
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
repaint(false);
|
|
|
|
|
d->blinkTimer->start( 200 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -383,11 +383,11 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
{
|
|
|
|
|
TQPixmap pm(size());
|
|
|
|
|
TQPainter p1;
|
|
|
|
|
p1.tqbegin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
|
|
|
|
|
p1.fillRect(0, 0, size().width(), size().height(), tqpalette().disabled().background());
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.begin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
|
|
|
|
|
p1.fillRect(0, 0, size().width(), size().height(), palette().disabled().background());
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawRect(0, 0, width(), height());
|
|
|
|
|
p1.setPen(TQPen(tqpalette().disabled().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().disabled().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawRect(0, 0, width(), height());
|
|
|
|
|
p1.end();
|
|
|
|
|
bitBlt(this, 0, 0, &pm);
|
|
|
|
@ -405,12 +405,12 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
int asize = 24;
|
|
|
|
|
TQPixmap anim(asize, asize);
|
|
|
|
|
TQPainter p2;
|
|
|
|
|
p2.tqbegin(TQT_TQPAINTDEVICE(&anim), TQT_TQOBJECT(this));
|
|
|
|
|
p2.fillRect(0, 0, asize, asize, tqpalette().active().background());
|
|
|
|
|
p2.begin(TQT_TQPAINTDEVICE(&anim), TQT_TQOBJECT(this));
|
|
|
|
|
p2.fillRect(0, 0, asize, asize, palette().active().background());
|
|
|
|
|
p2.translate(asize/2, asize/2);
|
|
|
|
|
|
|
|
|
|
d->pos = (d->pos + 10) % 360;
|
|
|
|
|
p2.setPen(TQPen(tqpalette().active().text()));
|
|
|
|
|
p2.setPen(TQPen(palette().active().text()));
|
|
|
|
|
p2.rotate(d->pos);
|
|
|
|
|
for ( int i=0 ; i<12 ; i++ )
|
|
|
|
|
{
|
|
|
|
@ -423,12 +423,12 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
|
|
|
|
|
TQPixmap pm(size());
|
|
|
|
|
TQPainter p1;
|
|
|
|
|
p1.tqbegin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
|
|
|
|
|
p1.fillRect(0, 0, width(), height(), tqpalette().active().background());
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.begin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
|
|
|
|
|
p1.fillRect(0, 0, width(), height(), palette().active().background());
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawRect(0, 0, width(), height());
|
|
|
|
|
p1.drawPixmap(width()/2 - asize /2, asize, anim);
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().text()));
|
|
|
|
|
p1.setPen(TQPen(palette().active().text()));
|
|
|
|
|
|
|
|
|
|
if (d->clearFlag == HistogramWidgetPriv::HistogramDataLoading)
|
|
|
|
|
p1.drawText(0, 0, width(), height(), TQt::AlignCenter,
|
|
|
|
@ -447,11 +447,11 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
{
|
|
|
|
|
TQPixmap pm(size());
|
|
|
|
|
TQPainter p1;
|
|
|
|
|
p1.tqbegin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
|
|
|
|
|
p1.fillRect(0, 0, width(), height(), tqpalette().active().background());
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.begin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
|
|
|
|
|
p1.fillRect(0, 0, width(), height(), palette().active().background());
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawRect(0, 0, width(), height());
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().text()));
|
|
|
|
|
p1.setPen(TQPen(palette().active().text()));
|
|
|
|
|
p1.drawText(0, 0, width(), height(), TQt::AlignCenter,
|
|
|
|
|
i18n("Histogram\ncalculation\nfailed."));
|
|
|
|
|
p1.end();
|
|
|
|
@ -524,8 +524,8 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
|
|
|
|
|
TQPixmap pm(size());
|
|
|
|
|
TQPainter p1;
|
|
|
|
|
p1.tqbegin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
|
|
|
|
|
p1.fillRect(0, 0, width(), height(), tqpalette().active().background());
|
|
|
|
|
p1.begin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
|
|
|
|
|
p1.fillRect(0, 0, width(), height(), palette().active().background());
|
|
|
|
|
|
|
|
|
|
// Drawing selection or all histogram values.
|
|
|
|
|
|
|
|
|
@ -645,35 +645,35 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
{
|
|
|
|
|
if ( x >= (int)(d->xmin * wWidth) && x <= (int)(d->xmax * wWidth) )
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, 0);
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, wHeight - y);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, wHeight - y);
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - y, x, 0);
|
|
|
|
|
|
|
|
|
|
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, wHeight - y);
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - y, x, 0);
|
|
|
|
|
|
|
|
|
|
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -684,9 +684,9 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
{
|
|
|
|
|
if ( x >= (int)(d->xmin * wWidth) && x <= (int)(d->xmax * wWidth) )
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, 0);
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
|
|
|
|
|
// Witch color must be used on the foreground with all colors channel mode?
|
|
|
|
|
switch (m_colorType)
|
|
|
|
@ -717,16 +717,16 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
p1.setPen(TQPen(TQt::red, 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, wHeight - yr);
|
|
|
|
|
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
|
|
|
|
|
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
|
|
|
|
|
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
|
|
|
|
|
|
|
|
|
|
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -740,16 +740,16 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
p1.setPen(TQPen(TQt::green, 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, wHeight - yg);
|
|
|
|
|
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
|
|
|
|
|
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
|
|
|
|
|
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
|
|
|
|
|
|
|
|
|
|
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -763,16 +763,16 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
p1.setPen(TQPen(TQt::blue, 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, wHeight - yb);
|
|
|
|
|
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
|
|
|
|
|
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
|
|
|
|
|
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
|
|
|
|
|
|
|
|
|
|
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -793,16 +793,16 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
p1.setPen(TQPen(TQt::red, 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, wHeight - yr);
|
|
|
|
|
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
|
|
|
|
|
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
|
|
|
|
|
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
|
|
|
|
|
|
|
|
|
|
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -816,16 +816,16 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
p1.setPen(TQPen(TQt::green, 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, wHeight - yg);
|
|
|
|
|
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
|
|
|
|
|
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
|
|
|
|
|
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
|
|
|
|
|
|
|
|
|
|
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -839,16 +839,16 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
p1.setPen(TQPen(TQt::blue, 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, wHeight - yb);
|
|
|
|
|
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().background(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
|
|
|
|
|
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
|
|
|
|
|
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
|
|
|
|
|
|
|
|
|
|
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
|
|
|
|
|
{
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().base(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawLine(x, wHeight, x, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -911,7 +911,7 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
int xGuide = (guidePos * wWidth) / histogram->getHistogramSegment();
|
|
|
|
|
p1.drawLine(xGuide, 0, xGuide, wHeight);
|
|
|
|
|
|
|
|
|
|
TQString string = i18n("x:%1").tqarg(guidePos);
|
|
|
|
|
TQString string = i18n("x:%1").arg(guidePos);
|
|
|
|
|
TQFontMetrics fontMt( string );
|
|
|
|
|
TQRect rect = fontMt.boundingRect(0, 0, wWidth, wHeight, 0, string);
|
|
|
|
|
p1.setPen(TQPen(TQt::red, 1, TQt::SolidLine));
|
|
|
|
@ -973,7 +973,7 @@ void HistogramWidget::paintEvent(TQPaintEvent*)
|
|
|
|
|
TQToolTip::add( this, tipText);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.setPen(TQPen(palette().active().foreground(), 1, TQt::SolidLine));
|
|
|
|
|
p1.drawRect(0, 0, width(), height());
|
|
|
|
|
p1.end();
|
|
|
|
|
bitBlt(this, 0, 0, &pm);
|
|
|
|
@ -986,7 +986,7 @@ void HistogramWidget::mousePressEvent(TQMouseEvent* e)
|
|
|
|
|
if (!d->inSelected)
|
|
|
|
|
{
|
|
|
|
|
d->inSelected = true;
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
d->xmin = ((double)e->pos().x()) / ((double)width());
|
|
|
|
@ -1009,7 +1009,7 @@ void HistogramWidget::mouseReleaseEvent(TQMouseEvent*)
|
|
|
|
|
//emit signalMinValueChanged( 0 );
|
|
|
|
|
//emit signalMaxValueChanged( d->range );
|
|
|
|
|
notifyValuesChanged();
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
repaint(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1040,7 +1040,7 @@ void HistogramWidget::mouseMoveEvent(TQMouseEvent *e)
|
|
|
|
|
notifyValuesChanged();
|
|
|
|
|
//emit signalMaxValueChanged( d->xmax == 0.0 ? d->range : (int)(d->xmax * d->range) );
|
|
|
|
|
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
repaint(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1064,7 +1064,7 @@ void HistogramWidget::slotMinValueChanged( int min )
|
|
|
|
|
{
|
|
|
|
|
d->xmin = ((double)min)/d->range;
|
|
|
|
|
}
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
repaint(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1082,7 +1082,7 @@ void HistogramWidget::slotMaxValueChanged(int max)
|
|
|
|
|
{
|
|
|
|
|
d->xmax = ((double)max)/d->range;
|
|
|
|
|
}
|
|
|
|
|
tqrepaint(false);
|
|
|
|
|
repaint(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|