- Added course selection dialog
[scorecard] / src / course-dialog.h
1 #ifndef COURSE_DIALOG_H
2 #define COURSE_DIALOG_H
3
4 #include <QtGui>
5 #include <QDialog>
6 #include <QLabel>
7 #include <QGroupBox>
8 #include <QDialogButtonBox>
9 #include <QLineEdit>
10 #include <QDebug>
11
12 QT_BEGIN_NAMESPACE
13 class QTableWidget;
14 class QTableWidgetItem;
15 QT_END_NAMESPACE
16
17 class CourseSelectDialog: public QDialog
18 {
19   Q_OBJECT
20
21  public:
22   CourseSelectDialog(QWidget *parent = 0);
23
24   void results(QString &club, QString &course);
25
26 private slots:
27   void next(void);
28
29  private:
30
31   void createLayout(QWidget *parent);
32
33   QLineEdit    *lineEditClub;
34   QLineEdit    *lineEditCourse;
35   QLabel       *labelClub;
36   QLabel       *labelCourse;
37   QPushButton  *pushButtonNext;
38
39   // Layouts
40   QVBoxLayout *leftLayout;
41   QVBoxLayout *rightLayout;
42 };
43
44 class CourseDialog: public QDialog
45 {
46   Q_OBJECT
47
48  public:
49   CourseDialog(QWidget *w);
50   void results(QVector<QString> &, QVector<QString> &, QVector<QString> &);
51   bool validate();
52
53  public slots:
54   void itemChanged(QTableWidgetItem *item);
55   void nextCell(QObject *);
56   void finnish(void);
57
58  private:
59   enum { ROW_HOLE = 0, ROW_PAR = 1, ROW_HCP = 2, ROW_LEN = 3, 
60          ROW_HOLE_2 = 4, ROW_PAR_2 = 5, ROW_HCP_2 = 6, ROW_LEN_2 = 7};
61   enum { rows = 8, cols = 9, separator_row = 3 };
62
63   void createTable(QWidget *parent = 0);
64   void createLabel(QWidget *parent = 0);
65   void createLayout(QWidget *parent = 0);
66
67   // Widgets
68   //ScoreTable *table;
69   QTableWidget *table;
70   QLabel *clubLabel;
71   QLabel *courseLabel;
72   QLineEdit *clubEdit;
73   QLineEdit *courseEdit;
74   QPushButton *pushButtonFinnish;
75
76   // Layouts
77   QVBoxLayout *rightLayout;
78   QVBoxLayout *leftLayout;
79 };
80
81 #endif