int ShowEditor::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: actRemove(); break;
        case 1: actPopTop(); break;
        case 2: actPopDown(); break;
        case 3: actSizeOrig(); break;
        case 4: actSizeHalf(); break;
        case 5: actSizeAuto(); break;
        case 6: actNew(); break;
        case 7: actOpen(); break;
        case 8: actSave(); break;
        case 9: actRun(); break;
        case 10: actExit(); break;
        case 11: actSceSet(); break;
        case 12: actLineCheck(); break;
        case 13: actHelixSqrCheck(); break;
        case 14: actHelixCirCheck(); break;
        case 15: actSqrCheck(); break;
        case 16: actCubicCheck(); break;
        case 17: actCircleCheck(); break;
        case 18: actCylinderCheck(); break;
        case 19: actHalfCirCheck(); break;
        case 20: actAlbumACheck(); break;
        case 21: actArrayEditorCheck(); break;
        case 22: actTextPix((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 23: actPage(); break;
        case 24: actJpge(); break;
        case 25: actText(); break;
        case 26: actMusic(); break;
        case 27: actBuildAlbum(); break;
        case 28: actFont(); break;
        case 29: actColor(); break;
        case 30: actSetting(); break;
        case 31: actAbout(); break;
        case 32: fontChange((*reinterpret_cast< QFont(*)>(_a[1]))); break;
        case 33: activetext((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 34: itemChange((*reinterpret_cast< QListWidgetItem*(*)>(_a[1])),(*reinterpret_cast< QListWidgetItem*(*)>(_a[2]))); break;
        case 35: pageItemRemove(); break;
        default: ;
        }
        _id -= 36;
    }
    return _id;
}
示例#2
0
WndSets::WndSets(QWidget *parent)
    : QMainWindow(parent)
{
    model = new SetsModel(db, this);
    proxyModel = new SetsProxyModel(this);
    proxyModel->setSourceModel(model);
    proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
    view = new QTreeView;
    view->setModel(proxyModel);
    view->setAlternatingRowColors(true);
    view->setUniformRowHeights(true);
    view->setAllColumnsShowFocus(true);
    view->setSortingEnabled(true);
    view->sortByColumn(SetsModel::SortKeyCol, Qt::AscendingOrder);

    view->setDragEnabled(true);
    view->setAcceptDrops(true);
    view->setDropIndicatorShown(true);
    view->setDragDropMode(QAbstractItemView::InternalMove);
#if QT_VERSION < 0x050000
    view->header()->setResizeMode(SetsModel::LongNameCol, QHeaderView::ResizeToContents);
#else
    view->header()->setSectionResizeMode(SetsModel::LongNameCol, QHeaderView::ResizeToContents);
#endif

    saveButton = new QPushButton(tr("Save set ordering"));
    connect(saveButton, SIGNAL(clicked()), this, SLOT(actSave()));
    restoreButton = new QPushButton(tr("Restore saved set ordering"));
    connect(restoreButton, SIGNAL(clicked()), this, SLOT(actRestore()));

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(view, 0, 0, 1, 2);
    mainLayout->addWidget(saveButton, 1, 0, 1, 1);
    mainLayout->addWidget(restoreButton, 1, 1, 1, 1);

    QWidget *centralWidget = new QWidget;
    centralWidget->setLayout(mainLayout);
    setCentralWidget(centralWidget);

    setWindowTitle(tr("Edit sets"));
    resize(700, 400);
}
示例#3
0
WndSets::WndSets(QWidget *parent)
    : QMainWindow(parent)
{
    model = new SetsModel(db, this);
    view = new QTreeView;
    view->setModel(model);

    view->setAlternatingRowColors(true);
    view->setUniformRowHeights(true);
    view->setAllColumnsShowFocus(true);
    view->setSortingEnabled(true);
    view->setSelectionMode(QAbstractItemView::SingleSelection);
    view->setSelectionBehavior(QAbstractItemView::SelectRows);

    view->setDragEnabled(true);
    view->setAcceptDrops(true);
    view->setDropIndicatorShown(true);
    view->setDragDropMode(QAbstractItemView::InternalMove);

#if QT_VERSION < 0x050000
    view->header()->setResizeMode(QHeaderView::Stretch);
    view->header()->setResizeMode(SetsModel::LongNameCol, QHeaderView::ResizeToContents);
#else
    view->header()->setSectionResizeMode(QHeaderView::Stretch);
    view->header()->setSectionResizeMode(SetsModel::LongNameCol, QHeaderView::ResizeToContents);
#endif

    view->sortByColumn(SetsModel::SortKeyCol, Qt::AscendingOrder);
    view->setColumnHidden(SetsModel::SortKeyCol, true);

    saveButton = new QPushButton(tr("Save set ordering"));
    connect(saveButton, SIGNAL(clicked()), this, SLOT(actSave()));
    restoreButton = new QPushButton(tr("Restore saved set ordering"));
    connect(restoreButton, SIGNAL(clicked()), this, SLOT(actRestore()));
    upButton = new QPushButton(tr("Move selected set up"));
    connect(upButton, SIGNAL(clicked()), this, SLOT(actUp()));
    downButton = new QPushButton(tr("Move selected set down"));
    connect(downButton, SIGNAL(clicked()), this, SLOT(actDown()));
    topButton = new QPushButton(tr("Move selected set to top"));
    connect(topButton, SIGNAL(clicked()), this, SLOT(actTop()));
    bottomButton = new QPushButton(tr("Move selected set to bottom"));
    connect(bottomButton, SIGNAL(clicked()), this, SLOT(actBottom()));

    upButton->setDisabled(true);
    downButton->setDisabled(true);
    topButton->setDisabled(true);
    bottomButton->setDisabled(true);

    connect(view->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
        this, SLOT(actToggleButtons(const QItemSelection &, const QItemSelection &)));

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(view, 0, 0, 1, 2);

    mainLayout->addWidget(upButton, 1, 0, 1, 1);
    mainLayout->addWidget(downButton, 2, 0, 1, 1);

    mainLayout->addWidget(topButton, 1, 1, 1, 1);
    mainLayout->addWidget(bottomButton, 2, 1, 1, 1);

    mainLayout->addWidget(saveButton, 3, 0, 1, 1);
    mainLayout->addWidget(restoreButton, 3, 1, 1, 1);

    QWidget *centralWidget = new QWidget;
    centralWidget->setLayout(mainLayout);
    setCentralWidget(centralWidget);

    setWindowTitle(tr("Edit sets"));
    resize(700, 400);
}
示例#4
0
editor::editor(QWidget *parent)
    : QMainWindow(parent),
      ui(new Ui::editor)
{
    ui->setupUi(this);

    ui->toolBar->addAction(QIcon(":resources/tileAir.png"), "Air", this, SLOT(actTileAir()));
    ui->toolBar->addAction(QIcon(":resources/tileNormal.png"), "Normal tile", this, SLOT(actTileNormal()));
    ui->toolBar->addAction(QIcon(":resources/tileAdamantine.png"), "Adamantine tile", this, SLOT(actTileAdamantine()));
    ui->toolBar->addSeparator();
    ui->toolBar->addAction(QIcon(":resources/colorPicker.png"), "Select color", this, SLOT(actColor()));
    ui->toolBar->addSeparator();
    ui->toolBar->addAction(QIcon(), "Smoother", this, SLOT(actSmoother()));
    QSlider *slider;
    slider = new QSlider(Horizontal);
    slider->setMaximumWidth(100);
    slider->setMinimum(15);
    slider->setMaximum(250);
    slider->setValue(70);
    QAction *actSlider = ui->toolBar->addWidget(slider);
    actSlider->setVisible(true);

    connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(actNew()));
    connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(actOpen()));
    connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(actSave()));
    connect(ui->actionSave_as, SIGNAL(triggered()), this, SLOT(actSaveAs()));

    connect(ui->actionAir, SIGNAL(triggered()), this, SLOT(actTileAir()));
    connect(ui->actionNormal_tile, SIGNAL(triggered()), this, SLOT(actTileNormal()));
    connect(ui->actionAdamantine, SIGNAL(triggered()), this, SLOT(actTileAdamantine()));
    connect(ui->actionColor, SIGNAL(triggered()), this, SLOT(actColor()));

    sprite_tile = QPixmap();
    sprite_tile.load(":resources/tile.png");
    sprite_border = QPixmap();
    sprite_border.load(":resources/border.png");

    levelLoaded = false;
    pressedL = false;
    pressedR = false;
    mode = 1;
    qstrcpy(selectedColor, "#0000ff");
    selectedDurability = 70;

    xCorner = yCorner = 0;
    xMouseReal = yMouseReal = 0;

    show();

    /*// ~~~ generating flat map ~~~
    QFile f("maps/fall.snsmap");
    f.open(QIODevice::WriteOnly);
    QDataStream out(&f);
    _map tmp;
    tmp.w=150;
    tmp.h=60;
    tmp.allocate();
    for (int i=0; i<tmp.w; i++)
        for (int j=0; j<tmp.h; j++)
            if (j<25) {
                tmp[i][j].type = 1;
                qstrcpy(tmp[i][j].color, "#cccccc");
                tmp[i][j].durability = 70;
            } else if (j==25) {
                tmp[i][j].type = 1;
                qstrcpy(tmp[i][j].color, "#00a000");
                tmp[i][j].durability = 50;
            } else {
                tmp[i][j].type = 0;
                qstrcpy(tmp[i][j].color, "#ffffff");
                tmp[i][j].durability = 0;
            }
    out << tmp;*/
}
示例#5
0
WndSets::WndSets(QWidget *parent)
    : QMainWindow(parent)
{
    // left toolbar
    QToolBar *setsEditToolBar = new QToolBar;
    setsEditToolBar->setOrientation(Qt::Vertical);
    setsEditToolBar->setIconSize(QSize(24, 24));
    setsEditToolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

    aTop = new QAction(QString(), this);
    aTop->setIcon(QPixmap("theme:icons/arrow_top_green"));
    aTop->setToolTip(tr("Move selected set to the top"));
    aTop->setEnabled(false);
    connect(aTop, SIGNAL(triggered()), this, SLOT(actTop()));
    setsEditToolBar->addAction(aTop);

    aUp = new QAction(QString(), this);
    aUp->setIcon(QPixmap("theme:icons/arrow_up_green"));
    aUp->setToolTip(tr("Move selected set up"));
    aUp->setEnabled(false);
    connect(aUp, SIGNAL(triggered()), this, SLOT(actUp()));
    setsEditToolBar->addAction(aUp);

    aDown = new QAction(QString(), this);
    aDown->setIcon(QPixmap("theme:icons/arrow_down_green"));
    aDown->setToolTip(tr("Move selected set down"));
    aDown->setEnabled(false);
    connect(aDown, SIGNAL(triggered()), this, SLOT(actDown()));
    setsEditToolBar->addAction(aDown);

    aBottom = new QAction(QString(), this);
    aBottom->setIcon(QPixmap("theme:icons/arrow_bottom_green"));
    aBottom->setToolTip(tr("Move selected set to the bottom"));
    aBottom->setEnabled(false);
    connect(aBottom, SIGNAL(triggered()), this, SLOT(actBottom()));
    setsEditToolBar->addAction(aBottom);

    // view 
    model = new SetsModel(db, this);
    view = new QTreeView;
    view->setModel(model);

    view->setAlternatingRowColors(true);
    view->setUniformRowHeights(true);
    view->setAllColumnsShowFocus(true);
    view->setSortingEnabled(true);
    view->setSelectionMode(QAbstractItemView::SingleSelection);
    view->setSelectionBehavior(QAbstractItemView::SelectRows);

    view->setDragEnabled(true);
    view->setAcceptDrops(true);
    view->setDropIndicatorShown(true);
    view->setDragDropMode(QAbstractItemView::InternalMove);

    view->header()->setSectionResizeMode(QHeaderView::Stretch);
    view->header()->setSectionResizeMode(SetsModel::LongNameCol, QHeaderView::ResizeToContents);

    view->sortByColumn(SetsModel::SortKeyCol, Qt::AscendingOrder);
    view->setColumnHidden(SetsModel::SortKeyCol, true);
    view->setColumnHidden(SetsModel::IsKnownCol, true);
    view->setRootIsDecorated(false);

    connect(view->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
        this, SLOT(actToggleButtons(const QItemSelection &, const QItemSelection &)));

    // bottom buttons
    enableAllButton = new QPushButton(tr("Enable all sets"));
    connect(enableAllButton, SIGNAL(clicked()), this, SLOT(actEnableAll()));
    disableAllButton = new QPushButton(tr("Disable all sets"));
    connect(disableAllButton, SIGNAL(clicked()), this, SLOT(actDisableAll()));


    QLabel *labNotes = new QLabel;
    labNotes->setText("<b>" + tr("hints:") + "</b>" + "<ul><li>" + tr("Enable the sets that you want to have available in the deck editor") + "</li><li>" + tr("Move sets around to change their order, or click on a column header to sort sets on that field") + "</li><li>" + tr("Sets order decides the source that will be used when loading images for a specific card") + "</li><li>" + tr("Disabled sets will be used for loading images only if all the enabled sets failed") + "</li></ul>");

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(actSave()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(actRestore()));

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(setsEditToolBar, 0, 0, 1, 1);
    mainLayout->addWidget(view, 0, 1, 1, 2);
    mainLayout->addWidget(enableAllButton, 1, 1, 1, 1);
    mainLayout->addWidget(disableAllButton, 1, 2, 1, 1);
    mainLayout->addWidget(labNotes, 2, 1, 1, 2);
    mainLayout->addWidget(buttonBox, 3, 1, 1, 2);
    mainLayout->setColumnStretch(1, 1);
    mainLayout->setColumnStretch(2, 1);

    QWidget *centralWidget = new QWidget;
    centralWidget->setLayout(mainLayout);
    setCentralWidget(centralWidget);

    setWindowTitle(tr("Edit sets"));
    resize(700, 400);
}
示例#6
0
void Action::save(wxFileConfig& fileConfig)const
{
	actSave(fileConfig);
}