• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdegames
 

libtdegames

KGameProgress Class Reference

A progress indicator widget. More...

#include <kgameprogress.h>

Inherits TQFrame, and TQRangeControl.

List of all members.

Public Types

enum  BarStyle { Solid, Blocked }

Public Slots

void setFormat (const TQString &format)
void setValue (int value)
void advance (int prog)

Signals

void percentageChanged (int)

Public Member Functions

 KGameProgress (TQWidget *parent=0, const char *name=0)
 KGameProgress (Orientation orient, TQWidget *parent=0, const char *name=0)
 KGameProgress (int minValue, int maxValue, int value, Orientation, TQWidget *parent=0, const char *name=0)
 ~KGameProgress ()
void setBarStyle (BarStyle style)
void setBarColor (const TQColor &)
void setBarPixmap (const TQPixmap &)
void setOrientation (Orientation)
void setTextEnabled (bool)
BarStyle barStyle () const
const TQColor & barColor () const
const TQPixmap * barPixmap () const
int value () const
Orientation orientation () const
bool textEnabled () const
virtual TQSize sizeHint () const
virtual TQSize minimumSizeHint () const
virtual TQSizePolicy sizePolicy () const
TQString format () const

Protected Member Functions

void valueChange ()
void rangeChange ()
void styleChange (TQStyle &)
void paletteChange (const TQPalette &)
void drawContents (TQPainter *)

Detailed Description

A progress indicator widget.

KGameProgress is derived from TQFrame and TQRangeControl, so you can use all the methods from those classes. The only difference is that setValue() is now made a slot, so you can connect stuff to it.

None of the constructors take line step and page step as arguments, so by default they're set to 1 and 10 respectively.

The Blocked style ignores the textEnabled() setting and displays no text, since it looks truly ugly (and for other reasons). Signal percentageChanged() is emitted whenever the value changes so you can set up a different widget to display the current percentage complete and connect the signal to it.

Author:
Martynas Kunigelis
Version:
$Id$

Definition at line 50 of file kgameprogress.h.


Member Enumeration Documentation

enum KGameProgress::BarStyle

Possible values for bar style.

Solid means one continuous progress bar, Blocked means a progress bar made up of several blocks.

Definition at line 69 of file kgameprogress.h.


Constructor & Destructor Documentation

KGameProgress::KGameProgress ( TQWidget *  parent = 0,
const char *  name = 0 
)

Construct a horizontal progress bar.

KGameProgress -- a progress indicator widget for TDE.

Definition at line 32 of file kgameprogress.cpp.

KGameProgress::KGameProgress ( Orientation  orient,
TQWidget *  parent = 0,
const char *  name = 0 
)

Construct a progress bar with orientation orient.

KGameProgress::KGameProgress ( int  minValue,
int  maxValue,
int  value,
Orientation  ,
TQWidget *  parent = 0,
const char *  name = 0 
)

Construct a progress bar with minimum, maximum and initial values.

KGameProgress::~KGameProgress (  ) 

Destruct the progress bar.

Definition at line 57 of file kgameprogress.cpp.


Member Function Documentation

void KGameProgress::advance ( int  prog  )  [slot]

Advance the progress bar by prog.

This method is provided for convenience and is equivalent with setValue(value()+prog).

Definition at line 62 of file kgameprogress.cpp.

const TQColor & KGameProgress::barColor (  )  const

Retrieve the bar color.

See also:
setBarColor()

Definition at line 139 of file kgameprogress.cpp.

const TQPixmap * KGameProgress::barPixmap (  )  const

Retrieve the bar pixmap.

See also:
setBarPixmap()

Definition at line 144 of file kgameprogress.cpp.

KGameProgress::BarStyle KGameProgress::barStyle (  )  const

Retrieve the bar style.

See also:
setBarStyle()

Definition at line 185 of file kgameprogress.cpp.

TQString KGameProgress::format (  )  const

Retrieve the current format for printing status text.

See also:
setFormat()

Definition at line 340 of file kgameprogress.cpp.

KGameProgress::Orientation KGameProgress::orientation (  )  const

Retrive the orientation of the progress bar.

See also:
setOrientation()

Definition at line 180 of file kgameprogress.cpp.

void KGameProgress::percentageChanged ( int   )  [signal]

Emitted when the state of the progress bar changes.

void KGameProgress::setBarColor ( const TQColor &  color  ) 

Set the color of the progress bar.

Definition at line 103 of file kgameprogress.cpp.

void KGameProgress::setBarPixmap ( const TQPixmap &  pixmap  ) 

Set a pixmap to be shown in the progress bar.

Definition at line 93 of file kgameprogress.cpp.

void KGameProgress::setBarStyle ( BarStyle  style  ) 

Set the progress bar style.

Allowed values are Solid and Blocked.

Definition at line 113 of file kgameprogress.cpp.

void KGameProgress::setFormat ( const TQString &  format  )  [slot]

Set the format of the text to use to display status.

The default format is "%p%" (which looks like "42%".)

Parameters:
format p is replaced by percentage done, v is replaced by actual value, m is replaced by the maximum value.

Definition at line 335 of file kgameprogress.cpp.

void KGameProgress::setOrientation ( Orientation   ) 

Set the orientation of the progress bar.

Allowed values are Qt::Horizontal and Qt::Vertical.

void KGameProgress::setTextEnabled ( bool  enable  ) 

If this is set to true, the progress text will be displayed.

Definition at line 134 of file kgameprogress.cpp.

void KGameProgress::setValue ( int  value  )  [slot]

Set the current value of the progress bar to value.

This must be a number in the range 0..100.

Definition at line 129 of file kgameprogress.cpp.

bool KGameProgress::textEnabled (  )  const

Returns true if progress text will be displayed, false otherwise.

See also:
setFormat()

Definition at line 149 of file kgameprogress.cpp.

int KGameProgress::value (  )  const [inline]

Retrive the current status.

See also:
setValue()

Definition at line 147 of file kgameprogress.h.


The documentation for this class was generated from the following files:
  • kgameprogress.h
  • kgameprogress.cpp

libtdegames

Skip menu "libtdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.6.3
This website is maintained by Timothy Pearson.