Use QListWidget instead of comboboxes
[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   bool validate(void);
33
34   QLineEdit    *lineEditClub;
35   QLineEdit    *lineEditCourse;
36   QLabel       *labelClub;
37   QLabel       *labelCourse;
38   QPushButton  *pushButtonNext;
39
40   // Layouts
41   QVBoxLayout *leftLayout;
42   QVBoxLayout *rightLayout;
43 };
44
45 class CourseDialog: public QDialog
46 {
47   Q_OBJECT
48
49  public:
50   CourseDialog(QWidget *w);
51   void results(QVector<QString> &, QVector<QString> &, QVector<QString> &);
52   bool validate();
53
54  public slots:
55   void finish(void);
56
57  private:
58   enum { ROW_HOLE = 0, ROW_PAR = 1, ROW_HCP = 2, ROW_LEN = 3, 
59          ROW_HOLE_2 = 4, ROW_PAR_2 = 5, ROW_HCP_2 = 6, ROW_LEN_2 = 7};
60   enum { rows = 8, cols = 9, separator_row = 3 };
61
62   void createTable(QWidget *parent = 0);
63   void createLabel(QWidget *parent = 0);
64   void createLayout(QWidget *parent = 0);
65
66   // Widgets
67   QTableWidget *table;
68   QLabel *clubLabel;
69   QLabel *courseLabel;
70   QLineEdit *clubEdit;
71   QLineEdit *courseEdit;
72   QPushButton *pushButtonFinish;
73
74   // Layouts
75   QVBoxLayout *rightLayout;
76   QVBoxLayout *leftLayout;
77 };
78
79 #endif