moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / timestepbox.h
blob37e2c2735979c3ac4e530982337516487edb24af
1 /***************************************************************************
2 timestepbox.h - description
3 -------------------
4 begin : Sat Apr 13 2002
5 copyright : (C) 2002 by Jason Harris
6 email : kstars@30doradus.org
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #ifndef TIMESTEPBOX_H
19 #define TIMESTEPBOX_H
21 #include <qframe.h>
22 #include <qlayout.h>
23 #include "timespinbox.h"
24 #include "timeunitbox.h"
26 /**@class TimeStepBox
27 *This composite widget consists of a TimeSpinBox (a QSpinBox), coupled with a
28 *TimeUnitBox (a second pair of up/down buttons).
29 *The second set of buttons makes larger steps through the 82 possible
30 *time-step values, skipping to the next even unit of time.
31 *@short Composite spinbox for specifying a time step.
32 *@author Jason Harris
33 *@version 1.0
36 class TimeStepBox : public QFrame {
37 Q_OBJECT
38 public:
39 /**Constructor. */
40 TimeStepBox( QWidget *parent=0, const char* name=0 );
41 /**Destructor. (empty)*/
42 ~TimeStepBox() {}
44 /**@return a pointer to the child TimeSpinBox */
45 TimeSpinBox* tsbox() const { return timeBox; }
47 /**@return a pointer to the child TimeUnitBox*/
48 TimeUnitBox* unitbox() const { return unitBox; }
49 signals:
50 void scaleChanged( float );
51 private slots:
52 /**Set the TimeSpinBox value according to the current UnitBox value.
53 *This is connected to the UnitBox valueChanged() Signal. */
54 void changeUnits( void );
56 /**Make sure the current UnitBox value represents the correct units for the
57 *current TimeBox value. This slot is connected to the TimeBox valueChanged() Slot. */
58 void syncUnits( int );
59 private:
60 int UnitStep[NUNITS];
61 QHBoxLayout *hlay;
62 TimeSpinBox *timeBox;
63 TimeUnitBox *unitBox;
66 #endif