annotate widgets/ListInputDialog.h @ 420:f8e04ad8e7b1

* More transform finder fiddling
author Chris Cannam
date Thu, 25 Sep 2008 13:47:40 +0000
parents 512ead25e842
children d632a1e87018
rev   line source
Chris@126 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@126 2
Chris@126 3 /*
Chris@126 4 Sonic Visualiser
Chris@126 5 An audio file viewer and annotation editor.
Chris@126 6 Centre for Digital Music, Queen Mary, University of London.
Chris@229 7 This file copyright 2006 Chris Cannam.
Chris@126 8
Chris@126 9 This program is free software; you can redistribute it and/or
Chris@126 10 modify it under the terms of the GNU General Public License as
Chris@126 11 published by the Free Software Foundation; either version 2 of the
Chris@126 12 License, or (at your option) any later version. See the file
Chris@126 13 COPYING included with this distribution for more information.
Chris@126 14 */
Chris@126 15
Chris@126 16 #ifndef _LIST_INPUT_DIALOG_H_
Chris@126 17 #define _LIST_INPUT_DIALOG_H_
Chris@126 18
Chris@126 19 #include <QDialog>
Chris@126 20 #include <QString>
Chris@126 21 #include <QStringList>
Chris@126 22
Chris@126 23 #include <vector>
Chris@126 24
Chris@126 25 class QRadioButton;
Chris@231 26 class QLabel;
Chris@126 27
Chris@126 28 /**
Chris@126 29 * Like QInputDialog::getItem(), except that it offers the items as a
Chris@126 30 * set of radio buttons instead of in a single combo box.
Chris@126 31 */
Chris@126 32
Chris@126 33 class ListInputDialog : public QDialog
Chris@126 34 {
Chris@222 35 Q_OBJECT
Chris@222 36
Chris@126 37 public:
Chris@231 38 ListInputDialog(QWidget *parent, const QString &title,
Chris@231 39 const QString &label, const QStringList &list,
Chris@231 40 int current = 0, Qt::WFlags f = 0);
Chris@126 41 virtual ~ListInputDialog();
Chris@126 42
Chris@231 43 void setItemAvailability(int item, bool available);
Chris@231 44 void setFootnote(QString footnote);
Chris@231 45
Chris@231 46 QString getCurrentString() const;
Chris@231 47
Chris@126 48 static QString getItem(QWidget *parent, const QString &title,
Chris@126 49 const QString &label, const QStringList &list,
Chris@126 50 int current = 0, bool *ok = 0, Qt::WFlags f = 0);
Chris@126 51
Chris@126 52 protected:
Chris@126 53 QStringList m_strings;
Chris@126 54 std::vector<QRadioButton *> m_radioButtons;
Chris@231 55 QLabel *m_footnote;
Chris@126 56 };
Chris@126 57
Chris@126 58 #endif