diff options
Diffstat (limited to 'muse2/muse/arranger/arranger.cpp')
-rw-r--r-- | muse2/muse/arranger/arranger.cpp | 86 |
1 files changed, 61 insertions, 25 deletions
diff --git a/muse2/muse/arranger/arranger.cpp b/muse2/muse/arranger/arranger.cpp index d25911cd..386267e2 100644 --- a/muse2/muse/arranger/arranger.cpp +++ b/muse2/muse/arranger/arranger.cpp @@ -13,12 +13,13 @@ #include <qlayout.h> #include <qcombobox.h> #include <qtoolbutton.h> -#include <q3buttongroup.h> +#include <QButtonGroup> #include <qlabel.h> -#include <q3accel.h> +//#include <q3accel.h> #include <qcombobox.h> -#include <q3whatsthis.h> -#include <q3toolbar.h> +//#include <q3whatsthis.h> +//#include <q3toolbar.h> +#include <QToolBar> #include <qtooltip.h> #include <q3popupmenu.h> #include <q3hbox.h> @@ -26,15 +27,16 @@ #include <q3filedialog.h> #include <qcheckbox.h> #include <qpushbutton.h> -#include <q3mainwindow.h> +//#include <q3mainwindow.h> +#include <QMainWindow> #include <q3widgetstack.h> #include <qscrollbar.h> //Added by qt3to4: #include <QKeyEvent> #include <Q3ValueList> -#include <Q3GridLayout> +#include <QGridLayout> #include <QPixmap> -#include <Q3VBoxLayout> +#include <QVBoxLayout> #include <QWheelEvent> #include "arranger.h" @@ -92,7 +94,7 @@ QString TWhatsThis::text(const QPoint& pos) // is the central widget in app //--------------------------------------------------------- -Arranger::Arranger(Q3MainWindow* parent, const char* name) +Arranger::Arranger(QMainWindow* parent, const char* name) : QWidget(parent, name) { _raster = 0; // measure @@ -111,42 +113,59 @@ Arranger::Arranger(Q3MainWindow* parent, const char* name) // create toolbar in toplevel widget //--------------------------------------------------- - Q3ToolBar* toolbar = new Q3ToolBar(tr("Arranger"), parent); - - QLabel* label = new QLabel(tr("Cursor"), toolbar, "Cursor"); + // FIXME - Orcan: This toolbar needs a hand + //QToolBar* toolbar = new QToolBar(tr("Arranger"), parent); + parent->addToolBarBreak(); + QToolBar* toolbar = parent->addToolBar(tr("Arranger")); + + //QLabel* label = new QLabel(tr("Cursor"), toolbar, "Cursor"); + QLabel* label = new QLabel(tr("Cursor")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - cursorPos = new PosLabel(toolbar); + toolbar->addWidget(label); + //cursorPos = new PosLabel(toolbar); + cursorPos = new PosLabel(0); cursorPos->setEnabled(false); + cursorPos->setFixedHeight(22); + toolbar->addWidget(cursorPos); const char* rastval[] = { QT_TR_NOOP("Off"), QT_TR_NOOP("Bar"), "1/2", "1/4", "1/8", "1/16" }; - label = new QLabel(tr("Snap"), toolbar, "Snap"); + //label = new QLabel(tr("Snap"), toolbar, "Snap"); + label = new QLabel(tr("Snap")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - QComboBox* raster = new QComboBox(toolbar); + toolbar->addWidget(label); + //QComboBox* raster = new QComboBox(toolbar); + QComboBox* raster = new QComboBox(); for (int i = 0; i < 6; i++) raster->insertItem(tr(rastval[i]), i); raster->setCurrentItem(1); connect(raster, SIGNAL(activated(int)), SLOT(_setRaster(int))); raster->setFocusPolicy(Qt::NoFocus); + toolbar->addWidget(raster); // Song len - label = new QLabel(tr("Len"), toolbar, "Len"); + //label = new QLabel(tr("Len"), toolbar, "Len"); + label = new QLabel(tr("Len")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); + toolbar->addWidget(label); // song length is limited to 10000 bars; the real song len is limited // by overflows in tick computations // - lenEntry = new SpinBox(1, 10000, 1, toolbar); + //lenEntry = new SpinBox(1, 10000, 1, toolbar); + lenEntry = new SpinBox(1, 10000, 1); lenEntry->setValue(song->len()); connect(lenEntry, SIGNAL(valueChanged(int)), SLOT(songlenChanged(int))); QToolTip::add(lenEntry, tr("song length - bars")); Q3WhatsThis::add(lenEntry, tr("song length - bars")); + toolbar->addWidget(lenEntry); - typeBox = new LabelCombo(tr("Type"), toolbar); + //typeBox = new LabelCombo(tr("Type"), toolbar); + typeBox = new LabelCombo(tr("Type"), 0); typeBox->insertItem(tr("NO"), 0); typeBox->insertItem(tr("GM"), 1); typeBox->insertItem(tr("GS"), 2); @@ -156,35 +175,52 @@ Arranger::Arranger(Q3MainWindow* parent, const char* name) QToolTip::add(typeBox, tr("midi song type")); Q3WhatsThis::add(typeBox, tr("midi song type")); typeBox->setFocusPolicy(Qt::NoFocus); + toolbar->addWidget(typeBox); - label = new QLabel(tr("Pitch"), toolbar, "Pitch"); + //label = new QLabel(tr("Pitch"), toolbar, "Pitch"); + label = new QLabel(tr("Pitch")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - globalPitchSpinBox = new SpinBox(-127, 127, 1, toolbar); + toolbar->addWidget(label); + //globalPitchSpinBox = new SpinBox(-127, 127, 1, toolbar); + globalPitchSpinBox = new SpinBox(-127, 127, 1); globalPitchSpinBox->setValue(song->globalPitchShift()); QToolTip::add(globalPitchSpinBox, tr("midi pitch")); Q3WhatsThis::add(globalPitchSpinBox, tr("global midi pitch shift")); connect(globalPitchSpinBox, SIGNAL(valueChanged(int)), SLOT(globalPitchChanged(int))); - label = new QLabel(tr("Tempo"), toolbar, "Tempo"); + toolbar->addWidget(globalPitchSpinBox); + //label = new QLabel(tr("Tempo"), toolbar, "Tempo"); + label = new QLabel(tr("Tempo")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); + toolbar->addWidget(label); + globalTempoSpinBox = new SpinBox(50, 200, 1, toolbar); globalTempoSpinBox->setSuffix(QString("%")); globalTempoSpinBox->setValue(tempomap.globalTempo()); QToolTip::add(globalTempoSpinBox, tr("midi tempo")); Q3WhatsThis::add(globalTempoSpinBox, tr("midi tempo")); connect(globalTempoSpinBox, SIGNAL(valueChanged(int)), SLOT(globalTempoChanged(int))); - QToolButton* tempo50 = new QToolButton(toolbar, "tempo50"); + toolbar->addWidget(globalTempoSpinBox); + + //QToolButton* tempo50 = new QToolButton(toolbar, "tempo50"); + QToolButton* tempo50 = new QToolButton(); tempo50->setText(QString("50%")); connect(tempo50, SIGNAL(clicked()), SLOT(setTempo50())); - QToolButton* tempo100 = new QToolButton(toolbar, "tempo100"); + toolbar->addWidget(tempo50); + //QToolButton* tempo100 = new QToolButton(toolbar, "tempo100"); + QToolButton* tempo100 = new QToolButton(); tempo100->setText(tr("N")); connect(tempo100, SIGNAL(clicked()), SLOT(setTempo100())); - QToolButton* tempo200 = new QToolButton(toolbar, "tempo200"); + toolbar->addWidget(tempo100); + //QToolButton* tempo200 = new QToolButton(toolbar, "tempo200"); + QToolButton* tempo200 = new QToolButton(); tempo200->setText(QString("200%")); connect(tempo200, SIGNAL(clicked()), SLOT(setTempo200())); + toolbar->addWidget(tempo200); + //parent->addToolBar(toolbar); - Q3VBoxLayout* box = new Q3VBoxLayout(this); + QVBoxLayout* box = new QVBoxLayout(this); box->addWidget(hLine(this), Qt::AlignTop); //--------------------------------------------------- @@ -307,7 +343,7 @@ Arranger::Arranger(Q3MainWindow* parent, const char* name) vallist.append(tgrid->maximumSize().width()); split->setSizes(vallist); - Q3GridLayout* egrid = new Q3GridLayout(editor); + QGridLayout* egrid = new QGridLayout(editor); egrid->setColStretch(0, 50); egrid->setRowStretch(2, 50); |