コード例 #1
0
WorldSettingsBox::WorldSettingsBox(QWidget *parent) :
    QDockWidget(parent),
    MWDock_Base(parent),
    ui(new Ui::WorldSettingsBox)
{
    setVisible(false);
    setAttribute(Qt::WA_ShowWithoutActivating);
    ui->setupUi(this);

    world_settings_lock_fields=false;

    QRect mwg = mw()->geometry();
    int GOffset=240;
    mw()->addDockWidget(Qt::RightDockWidgetArea, this);
    connect(mw(), SIGNAL(languageSwitched()), this, SLOT(re_translate()));
    #ifdef Q_OS_WIN
    setFloating(true);
    #endif
    setGeometry(
                mwg.x()+mwg.width()-width()-GOffset,
                mwg.y()+120,
                width(),
                height()
                );

    mw()->docks_world.
          addState(this, &GlobalSettings::WorldSettingsToolboxVis);
}
コード例 #2
0
TilesetItemBox::TilesetItemBox(QWidget *parent) :
    QDockWidget(parent),
    MWDock_Base(parent),
    ui(new Ui::TilesetItemBox)
{
    setVisible(false);
    setAttribute(Qt::WA_ShowWithoutActivating);
    ui->setupUi(this);
    connect(ui->customTilesetSearchEdit, SIGNAL(textChanged(QString)), this, SLOT(makeCurrentTileset()));
    ui->TileSetsCategories->setTabPosition(GlobalSettings::TSTToolboxPos);

    this->setFocusPolicy(Qt::ClickFocus);

    lockTilesetBox = false;

    QRect dg = qApp->desktop()->availableGeometry(qApp->desktop()->primaryScreen());
    int GOffset = 240;

    mw()->addDockWidget(Qt::BottomDockWidgetArea, this);
    connect(mw(), SIGNAL(languageSwitched()), this, SLOT(re_translate()));
    setFloating(true);
    setGeometry(
        dg.x() + GOffset,
        dg.bottom() - height() - 5,
        800,
        250
    );

    m_lastVisibilityState = isVisible();
    mw()->docks_level_and_world.
    addState(this, &m_lastVisibilityState);
}
コード例 #3
0
WorldItemBox::WorldItemBox(QWidget *parent) :
    QDockWidget(parent),
    MWDock_Base(parent),
    ui(new Ui::WorldItemBox)
{
    setVisible(false);
    setAttribute(Qt::WA_ShowWithoutActivating);
    ui->setupUi(this);
    this->setAttribute(Qt::WA_X11DoNotAcceptFocus, true);

    m_terrainModel = new ItemBoxListModel(this);
    ui->WLD_TilesList->setModel(m_terrainModel);
    connect(ui->WLD_TilesList, &QTableView::clicked, this, &WorldItemBox::TerrainTilesTable_itemClicked);
    ui->WLD_TilesList->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
    ui->WLD_TilesList->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);

    m_sceneryModel = new ItemBoxListModel(this);
    ui->WLD_SceneList->setModel(m_sceneryModel);
    connect(ui->WLD_SceneList, &QListView::clicked, this, &WorldItemBox::SceneList_itemClicked);
    m_sceneryModel->setSort(ItemBoxListModel::Sort_ById, false);

    m_pathsModel = new ItemBoxListModel(this);
    ui->WLD_PathsList->setModel(m_pathsModel);
    connect(ui->WLD_PathsList, &QTableView::clicked, this, &WorldItemBox::PathsTable_itemClicked);
    ui->WLD_PathsList->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
    ui->WLD_PathsList->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);

    m_levelsModel = new ItemBoxListModel(this);
    ui->WLD_LevelList->setModel(m_levelsModel);
    connect(ui->WLD_LevelList, &QListView::clicked, this, &WorldItemBox::LevelList_itemClicked);
    m_levelsModel->setSort(ItemBoxListModel::Sort_ById, false);

    m_musicboxModel = new ItemBoxListModel(this);
    ui->WLD_MusicList->setModel(m_musicboxModel);
    connect(ui->WLD_MusicList, &QListView::clicked, this, &WorldItemBox::MusicList_itemClicked);
    m_musicboxModel->setSort(ItemBoxListModel::Sort_ById, false);

    mw()->addDockWidget(Qt::LeftDockWidgetArea, this);
    connect(mw(), SIGNAL(languageSwitched()), this, SLOT(re_translate()));
    connect(this, SIGNAL(visibilityChanged(bool)), mw()->ui->actionWLDToolBox, SLOT(setChecked(bool)));

    m_lastVisibilityState = isVisible();
    mw()->docks_world.
          addState(this, &m_lastVisibilityState);
}
コード例 #4
0
WLD_ItemProps::WLD_ItemProps(QWidget *parent) :
    QDockWidget(parent),
    MWDock_Base(parent),
    ui(new Ui::WLD_ItemProps)
{
    setVisible(false);
    setAttribute(Qt::WA_ShowWithoutActivating);
    ui->setupUi(this);
    wld_tools_lock=false;

    QRect mwg = mw()->geometry();
    int GOffset=240;
    mw()->addDockWidget(Qt::RightDockWidgetArea, this);
    connect(mw(), SIGNAL(languageSwitched()), this, SLOT(re_translate()));
    #ifdef Q_OS_WIN
    setFloating(true);
    #endif
    setGeometry(
                mwg.x()+mwg.width()-width()-GOffset,
                mwg.y()+120,
                width(),
                height()
                );
}
コード例 #5
0
WLD_ItemProps::WLD_ItemProps(QWidget *parent) :
    QDockWidget(parent),
    MWDock_Base(parent),
    ui(new Ui::WLD_ItemProps)
{
    setVisible(false);
    //setAttribute(Qt::WA_ShowWithoutActivating);
    ui->setupUi(this);
    wld_tools_lock=false;

    QRect mwg = mw()->geometry();
    int GOffset=10;
    mw()->addDockWidget(Qt::RightDockWidgetArea, this);
    connect(mw(), SIGNAL(languageSwitched()), this, SLOT(re_translate()));
    connect(this, &QDockWidget::visibilityChanged, mw()->ui->action_Placing_ShowProperties, &QAction::setChecked);
    mw()->ui->action_Placing_ShowProperties->setChecked(isVisible());
    setFloating(true);
    setGeometry(
                mwg.right() - width() - GOffset,
                mwg.y()+120,
                width(),
                height()
                );
}