|
|
|
@ -32,12 +32,12 @@
|
|
|
|
|
KGameProgress::KGameProgress(TQWidget *parent, const char *name)
|
|
|
|
|
: TQFrame(parent, name),
|
|
|
|
|
TQRangeControl(0, 100, 1, 10, 0),
|
|
|
|
|
orient(Qt::Horizontal)
|
|
|
|
|
orient(TQt::Horizontal)
|
|
|
|
|
{
|
|
|
|
|
initialize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KGameProgress::KGameProgress(Qt::Orientation orientation, TQWidget *parent, const char *name)
|
|
|
|
|
KGameProgress::KGameProgress(TQt::Orientation orientation, TQWidget *parent, const char *name)
|
|
|
|
|
: TQFrame(parent, name),
|
|
|
|
|
TQRangeControl(0, 100, 1, 10, 0),
|
|
|
|
|
orient(orientation)
|
|
|
|
@ -46,7 +46,7 @@ KGameProgress::KGameProgress(Qt::Orientation orientation, TQWidget *parent, cons
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KGameProgress::KGameProgress(int minValue, int maxValue, int value,
|
|
|
|
|
Qt::Orientation orientation, TQWidget *parent, const char *name)
|
|
|
|
|
TQt::Orientation orientation, TQWidget *parent, const char *name)
|
|
|
|
|
: TQFrame(parent, name),
|
|
|
|
|
TQRangeControl(minValue, maxValue, 1, 10, value),
|
|
|
|
|
orient(orientation)
|
|
|
|
@ -118,7 +118,7 @@ void KGameProgress::setBarStyle(BarStyle style)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KGameProgress::setOrientation(Qt::Orientation orientation)
|
|
|
|
|
void KGameProgress::setOrientation(TQt::Orientation orientation)
|
|
|
|
|
{
|
|
|
|
|
if (orient != orientation) {
|
|
|
|
|
orient = orientation;
|
|
|
|
@ -155,7 +155,7 @@ TQSize KGameProgress::sizeHint() const
|
|
|
|
|
{
|
|
|
|
|
TQSize s( size() );
|
|
|
|
|
|
|
|
|
|
if(orientation() == Qt::Vertical) {
|
|
|
|
|
if(orientation() == TQt::Vertical) {
|
|
|
|
|
s.setWidth(24);
|
|
|
|
|
} else {
|
|
|
|
|
s.setHeight(24);
|
|
|
|
@ -171,7 +171,7 @@ TQSize KGameProgress::minimumSizeHint() const
|
|
|
|
|
|
|
|
|
|
TQSizePolicy KGameProgress::sizePolicy() const
|
|
|
|
|
{
|
|
|
|
|
if ( orientation()==Qt::Vertical )
|
|
|
|
|
if ( orientation()==TQt::Vertical )
|
|
|
|
|
return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding );
|
|
|
|
|
else
|
|
|
|
|
return TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed );
|
|
|
|
@ -271,7 +271,7 @@ void KGameProgress::drawContents(TQPainter *p)
|
|
|
|
|
|
|
|
|
|
switch (bar_style) {
|
|
|
|
|
case Solid:
|
|
|
|
|
if (orient ==Qt::Horizontal) {
|
|
|
|
|
if (orient ==TQt::Horizontal) {
|
|
|
|
|
fr.setWidth(recalcValue(cr.width()));
|
|
|
|
|
er.setLeft(fr.right() + 1);
|
|
|
|
|
} else {
|
|
|
|
@ -289,7 +289,7 @@ void KGameProgress::drawContents(TQPainter *p)
|
|
|
|
|
case Blocked:
|
|
|
|
|
const int margin = 2;
|
|
|
|
|
int max, num, dx, dy;
|
|
|
|
|
if (orient ==Qt::Horizontal) {
|
|
|
|
|
if (orient ==TQt::Horizontal) {
|
|
|
|
|
fr.setHeight(cr.height() - 2 * margin);
|
|
|
|
|
fr.setWidth((int)(0.67 * fr.height()));
|
|
|
|
|
fr.moveTopLeft(TQPoint(cr.left() + margin, cr.top() + margin));
|
|
|
|
@ -315,7 +315,7 @@ void KGameProgress::drawContents(TQPainter *p)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (num != max) {
|
|
|
|
|
if (orient ==Qt::Horizontal)
|
|
|
|
|
if (orient ==TQt::Horizontal)
|
|
|
|
|
er.setLeft(fr.right() + 1);
|
|
|
|
|
else
|
|
|
|
|
er.setBottom(fr.bottom() + 1);
|
|
|
|
|