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