src/inputcombo.h
changeset 0 04114bce8fd0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/inputcombo.h	Thu May 18 23:05:01 2006 +0200
@@ -0,0 +1,70 @@
+#ifndef INPUTCOMBO_H
+#define INPUTCOMBO_H
+
+#include <qhbox.h>
+
+class QString;
+class QStringList;
+class QLabel;
+class QComboBox;
+
+/*!
+ * A class for making input fields of type "Label: ComboBox"
+*/
+class InputCombo : public QHBox
+{
+	Q_OBJECT
+
+private:
+	QLabel *labelbox;
+	QComboBox *combobox;
+	
+	void initWidget();
+
+public slots:
+	/*!
+	 * Sets the label of the input field
+	 */
+	void setLabel(QString &str);
+
+public:
+	/*!
+	 * Constructs an InputCombo with no label or combobox content
+	 */
+	InputCombo(QWidget *parent=0, const char *name=0);
+	/*!
+	 * Constructs an InputCombo with label \param mylabel and
+	 * void combobox
+	 * \param mylabel Label of the InputCombo
+	 */
+	InputCombo(const QString &mylabel, QWidget *parent=0,
+			const char *name=0);
+	/*!
+	 * Constructs an InputCombo with label \param mylabel and
+	 * an initialized combobox
+	 * \param mylabel Label of the InputCombo
+	 * \param mystrings  Content of the combobox
+	 */
+	InputCombo(const QString &mylabel, const QStringList &mystrings,
+			QWidget *parent=0, const char *name=0);
+
+	/*!
+	 * Returns the contents of the textbox
+	 */
+	QString text() const;
+	/*!
+	 * Returns the label of the input field
+	 */
+	QString label() const;
+
+	/*!
+	 * Returns the QLabel
+	 */
+	QLabel* qLabel();
+	/*!
+	 * Returns the QComboBox
+	 */
+	QComboBox* qComboBox();
+};
+
+#endif // INPUTCOMBO_H