// ----------------------------------------------------------------------------- // Called when the panel is shown or hidden // ----------------------------------------------------------------------------- void TextureXEditor::onShow(wxShowEvent& e) { if (!e.IsShown()) { showTextureMenu(false); return; } else theMainWindow->undoHistoryPanel()->setManager(undo_manager_.get()); updateMenuStatus(); }
void MapEditorWindow::showOpenDialog() { if(checkCurrentMapSaved()) { QString filename = QFileDialog::getOpenFileName(this, tr("Open file"), preferredMapPath, "XML file (*.xml)", nullptr, QFileDialog::DontUseNativeDialog); if(!filename.isNull()) { MapHandler *mapHandler = sceneDisplayerWidget->openMap(filename.toUtf8().constData()); sceneControllerWidget->openMap(mapHandler); updateMapFilename(filename); updateMenuStatus(); } } }
bool MapEditorWindow::executeCloseAction() { bool canProceed = false; if(checkCurrentMapSaved()) { sceneDisplayerWidget->closeMap(); sceneControllerWidget->closeMap(); updateMapFilename(""); updateMenuStatus(); canProceed = true; } return canProceed; }
void MapEditorWindow::showNewDialog() { if(checkCurrentMapSaved()) { NewDialog newDialog(this); newDialog.exec(); if(newDialog.result()==QDialog::Accepted) { MapHandler *mapHandler = sceneDisplayerWidget->newMap(newDialog.getFilename(), newDialog.getRelativeWorkingDirectory()); sceneControllerWidget->newMap(mapHandler, newDialog.getRelativeWorkingDirectory()); updateMapFilename(QString::fromStdString(newDialog.getFilename())); updateMenuStatus(); } } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), m_bEdit(false) { ui->setupUi(this); ui->splitter->setStretchFactor(0, 15); ui->splitter->setStretchFactor(1, 65); ui->splitter->setStretchFactor(2, 20); ui->grouplistWidget->setCurrentRow(1); ui->findWidget->hide(); initStatusbar(); /*connect all signals and slots*/ setActions(); updateMenuStatus(); int r = Global::g_preferences->m_rgbFontColor.at(0).toInt(); int g = Global::g_preferences->m_rgbFontColor.at(1).toInt(); int b = Global::g_preferences->m_rgbFontColor.at(2).toInt(); updateFontColor(r, g, b); }