|
@@ -15,6 +15,8 @@
|
15
|
15
|
#include <QSpacerItem>
|
16
|
16
|
#include <QFont>
|
17
|
17
|
#include <QScrollBar>
|
|
18
|
+#include <QMessageBox>
|
|
19
|
+#include <QDialogButtonBox>
|
18
|
20
|
|
19
|
21
|
MainWindow::MainWindow(QWidget *parent) :
|
20
|
22
|
QMainWindow(parent),
|
|
@@ -838,3 +840,32 @@ void MainWindow::on_comboBox_SecondaryTileset_activated(const QString &tilesetLa
|
838
|
840
|
{
|
839
|
841
|
editor->updateSecondaryTileset(tilesetLabel);
|
840
|
842
|
}
|
|
843
|
+
|
|
844
|
+void MainWindow::on_pushButton_clicked()
|
|
845
|
+{
|
|
846
|
+ QDialog dialog(this, Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
|
|
847
|
+ dialog.setWindowTitle("Change Map Dimensions");
|
|
848
|
+ dialog.setWindowModality(Qt::NonModal);
|
|
849
|
+
|
|
850
|
+ QFormLayout form(&dialog);
|
|
851
|
+
|
|
852
|
+ QSpinBox *widthSpinBox = new QSpinBox();
|
|
853
|
+ QSpinBox *heightSpinBox = new QSpinBox();
|
|
854
|
+ widthSpinBox->setValue(editor->map->getWidth());
|
|
855
|
+ heightSpinBox->setValue(editor->map->getHeight());
|
|
856
|
+ widthSpinBox->setMinimum(1);
|
|
857
|
+ heightSpinBox->setMinimum(1);
|
|
858
|
+ widthSpinBox->setMaximum(255);
|
|
859
|
+ heightSpinBox->setMaximum(255);
|
|
860
|
+ form.addRow(new QLabel("Width"), widthSpinBox);
|
|
861
|
+ form.addRow(new QLabel("Height"), heightSpinBox);
|
|
862
|
+
|
|
863
|
+ QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog);
|
|
864
|
+ form.addRow(&buttonBox);
|
|
865
|
+ connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
|
|
866
|
+ connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
|
|
867
|
+
|
|
868
|
+ if (dialog.exec() == QDialog::Accepted) {
|
|
869
|
+ qDebug() << "Change width";
|
|
870
|
+ }
|
|
871
|
+}
|