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

libtdegames

  • libtdegames
kgameprogress.h
1/* This file is part of the TDE libraries
2 Copyright (C) 1996 Martynas Kunigelis
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18/*****************************************************************************
19* *
20* KGameProgress -- progress indicator widget for TDE by Martynas Kunigelis *
21* *
22*****************************************************************************/
23
24#ifndef _KPROGRES_H
25#define _KPROGRES_H "$Id$"
26
27#include <tqframe.h>
28#include <tqrangecontrol.h>
29#include <tdemacros.h>
50class TDE_EXPORT KGameProgress : public TQFrame, public TQRangeControl
51{
52 TQ_OBJECT
53
54 TQ_ENUMS( BarStyle )
55 TQ_PROPERTY( int value READ value WRITE setValue)
56 TQ_PROPERTY( BarStyle barStyle READ barStyle WRITE setBarStyle )
57 TQ_PROPERTY( TQColor barColor READ barColor WRITE setBarColor )
58 TQ_PROPERTY( TQPixmap barPixmap READ barPixmap WRITE setBarPixmap )
59 TQ_PROPERTY( Orientation orientation READ orientation WRITE setOrientation )
60 TQ_PROPERTY( bool textEnabled READ textEnabled WRITE setTextEnabled )
61
62public:
69 enum BarStyle { Solid, Blocked };
70
74 KGameProgress(TQWidget *parent=0, const char *name=0);
75
79 KGameProgress(Orientation orient, TQWidget *parent=0, const char *name=0);
80
84 KGameProgress(int minValue, int maxValue, int value, Orientation,
85 TQWidget *parent=0, const char *name=0);
86
90 ~KGameProgress();
91
97 void setBarStyle(BarStyle style);
98
102 void setBarColor(const TQColor &);
103
107 void setBarPixmap(const TQPixmap &);
108
114 void setOrientation(Orientation);
115
120 void setTextEnabled(bool);
121
127 BarStyle barStyle() const;
128
133 const TQColor &barColor() const;
134
140 const TQPixmap *barPixmap() const;
141
147 int value() const { return TQRangeControl::value(); }
153 Orientation orientation() const;
154
161 bool textEnabled() const;
162
165 virtual TQSize sizeHint() const;
166
169 virtual TQSize minimumSizeHint() const;
170
173 virtual TQSizePolicy sizePolicy() const;
174
179 TQString format() const;
180
181public slots:
182
191 void setFormat(const TQString & format);
192
198 void setValue(int value);
199
207 void advance(int prog);
208
209signals:
213 void percentageChanged(int);
214
215protected:
218 void valueChange();
221 void rangeChange();
224 void styleChange( TQStyle& );
227 void paletteChange( const TQPalette & );
230 void drawContents( TQPainter * );
231
232private slots:
233 void paletteChange();
234
235private:
236 TQPixmap *bar_pixmap;
237 bool use_supplied_bar_color;
238 TQColor bar_color;
239 TQColor bar_text_color;
240 TQColor text_color;
241 TQRect fr;
242 BarStyle bar_style;
243 Orientation orient;
244 bool text_enabled;
245 TQString format_;
246 void initialize();
247 int recalcValue(int);
248 void drawText(TQPainter *);
249 void adjustStyle();
250
251 class KGameProgressPrivate;
252 KGameProgressPrivate *d;
253};
254
255
256#endif
KGameProgress
A progress indicator widget.
Definition: kgameprogress.h:51
KGameProgress::percentageChanged
void percentageChanged(int)
Emitted when the state of the progress bar changes.
KGameProgress::KGameProgress
KGameProgress(Orientation orient, TQWidget *parent=0, const char *name=0)
Construct a progress bar with orientation orient.
KGameProgress::BarStyle
BarStyle
Possible values for bar style.
Definition: kgameprogress.h:69
KGameProgress::value
int value() const
Retrive the current status.
Definition: kgameprogress.h:147
KGameProgress::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.

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.9.4
This website is maintained by Timothy Pearson.