void MapPropertiesDialog::OnDefChoiceSelected(wxCommandEvent& event) { int index = event.GetSelection(); if (index < 0 || index >= static_cast<int>(m_defChoice->GetCount())) return; StringList builtinDefs = Model::EntityDefinitionManager::builtinDefinitionFiles(); Utility::sort(builtinDefs); if (index < static_cast<int>(builtinDefs.size())) { const String defPath = "builtin:" + builtinDefs[static_cast<size_t>(index)]; Controller::EntityPropertyCommand* command = Controller::EntityPropertyCommand::setEntityPropertyValue(*m_document, m_document->worldspawn(), Model::Entity::DefKey, defPath, true); m_document->GetCommandProcessor()->Submit(command); } else if (index == static_cast<int>(builtinDefs.size())) { wxFileDialog openDefinitionDialog(NULL, wxT("Choose entity definition file"), wxT(""), wxT(""), wxT("DEF files (*.def)|*.def|FGD files (*.fgd)|*.fgd"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (openDefinitionDialog.ShowModal() == wxID_OK) { PathDialog pathDialog(this, openDefinitionDialog.GetPath().ToStdString(), m_document->GetFilename().ToStdString()); if (pathDialog.ShowModal() == wxID_OK) { const String defPath = "external:" + pathDialog.path(); Controller::EntityPropertyCommand* command = Controller::EntityPropertyCommand::setEntityPropertyValue(*m_document, m_document->worldspawn(), Model::Entity::DefKey, defPath, true); m_document->GetCommandProcessor()->Submit(command); init(); } } } init(); }
void CdbOptionsPageWidget::showSourcePathDialog() { CdbPathDialog pathDialog(this, CdbPathDialog::SourcePaths); pathDialog.setPaths(m_sourcePaths); if (pathDialog.exec() == QDialog::Accepted) setSourcePaths(pathDialog.paths()); }
void MapPropertiesDialog::OnAddWadClicked(wxCommandEvent& event) { wxFileDialog openFileDialog(NULL, wxT("Choose texture wad"), wxT(""), wxT(""), wxT("*.wad"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (openFileDialog.ShowModal() == wxID_OK) { PathDialog pathDialog(this, openFileDialog.GetPath().ToStdString(), m_document->GetFilename().ToStdString()); if (pathDialog.ShowModal() == wxID_OK) { m_wadList->addWad(pathDialog.path()); updateWadProperty(); } } }
formularioMaq::formularioMaq(QWidget *parent) : QWidget(parent) { ui.setupUi(this); QImage formula("costo_maq.png"); ui.label_17->setPixmap(QPixmap::fromImage(formula)); ui.label_17->setScaledContents(true); connect(ui.pushButton,SIGNAL(clicked()),this,SLOT(pathDialog())); connect(ui.doubleSpinBox_2,SIGNAL(valueChanged(double)),this,SLOT(calcularDepre(double))); connect(ui.spinBox,SIGNAL(valueChanged(int)),this,SLOT(calcularDepre2(int))); connect(ui.doubleSpinBox_2,SIGNAL(valueChanged(double)),this,SLOT(costo_hora(double))); connect(ui.spinBox_2,SIGNAL(valueChanged(int)),this,SLOT(costo_hora2(int))); connect(ui.spinBox,SIGNAL(valueChanged(int)),this,SLOT(costo_hora3(int))); connect(ui.pushButton_4,SIGNAL(clicked()),this,SLOT(ayuda())); }
void MainWindow::onPieceClicked(int row, int col) { if(_isNeedSelectFigure) { PiecePathTracer pathTracer; vector<ChessPosition> path = pathTracer.path( _player->getMoves(), _player->getCurrentPos(), ChessPosition(row, col)); _isNeedSelectFigure = false; PiecePathDialog pathDialog( _player->chessBoard().getPiece(row, col), path, this); pathDialog.exec(); } }