void FftWaveUi::OnDisplayStyleChanged() { if (xyz_rbtn_->isChecked()) { fft_para_.wave_style.style = SHOW_XYZ; } if (x_rbtn_->isChecked()) { fft_para_.wave_style.style = SHOW_X; } if (y_rbtn_->isChecked()) { fft_para_.wave_style.style = SHOW_Y; } if (z_rbtn_->isChecked()) { fft_para_.wave_style.style = SHOW_Z; } DataProcessCenter::GetInstance()->ReleaseWaveSet(fft_data_); UpdateUi(fft_para_); }
/** * Sets the current {@link CScene} to the default "new" scene */ void CFortEdit::NewMap() { bool New = true; if (DScene) { QMessageBox* Alert = new QMessageBox; Alert->setText("A map is already open"); Alert->setInformativeText("Do you want to close the current map and create a new one?"); Alert->setStandardButtons(QMessageBox::Yes | QMessageBox::No); Alert->setDefaultButton(QMessageBox::No); int Response = Alert->exec(); New = Response == QMessageBox::Yes; } if (New) { if (DScene) { delete DScene; } DSoundHandler.LoadDefaultFiles(); DScene = new CScene(":/default-maps/res/new.map", DGraphicsScene, &DSoundHandler); UpdateUi(); DLuaEditor.clear(); DUi->ActionSave->setEnabled(false); DMapFilePath = ""; } }
void ImageObjectVolumeSettingsWidget::SetImageObject( ImageObject * img ) { m_imageObject = img; Q_ASSERT( m_imageObject ); vtkVolumeProperty * prop = m_imageObject->GetVolumeProperty(); ui->scalarOpacityFunctionWidget->SetFunction( prop->GetScalarOpacity() ); ui->scalarOpacityFunctionWidget->SetYRange( 0.0, 1.0 ); ui->colorFunctionWidget->SetColorTransferFunction( prop->GetRGBTransferFunction() ); ui->colorFunctionWidget->SetXRange( 0.0, 255.0 ); UpdateUi(); }
void QmitkTensorModelParametersWidget::CreateQtPartControl(QWidget *parent) { if (!m_Controls) { // create GUI widgets m_Controls = new Ui::QmitkTensorModelParametersWidgetControls; m_Controls->setupUi(parent); connect((QObject*) m_Controls->m_D1box, SIGNAL(valueChanged(double)), (QObject*) this, SLOT(DChanged(double))); connect((QObject*) m_Controls->m_D2box, SIGNAL(valueChanged(double)), (QObject*) this, SLOT(DChanged(double))); connect((QObject*) m_Controls->m_D3box, SIGNAL(valueChanged(double)), (QObject*) this, SLOT(DChanged(double))); UpdateUi(); }
/** * Opens a file dialog requesting a .map path from the user, and subsequently loads it into a {@link CScene} */ void CFortEdit::OpenMap() { DMapFilePath = QFileDialog::getOpenFileName(0, "Choose a map file", QDir::currentPath(), "FortNitta Map Files (*.map)"); if (DMapFilePath.length() > 0) { if (DScene) { delete DScene; } DScene = new CScene(DMapFilePath, DGraphicsScene, &DSoundHandler); DLuaEditor.LoadFile(DScene->GetAiPath()); UpdateUi(); DScene->Invalidate(); DUi->ActionSave->setEnabled(true); } }
SettingsGroupBox::SettingsGroupBox(PluginSettings* settings, QWidget *parent) : QGroupBox(parent), ui(new Ui::SettingsGroupBox) { ui->setupUi(this); connect(ui->smoothing_spinBox, SIGNAL(valueChanged(int)), ui->smoothing_slider, SLOT(setValue(int))); connect(ui->smoothing_slider, SIGNAL(valueChanged(int)), ui->smoothing_spinBox, SLOT(setValue(int))); ui->smoothing_spinBox->setToolTip(ui->smoothing_slider->toolTip()); this->settings = settings; category = "General"; UpdateUiComponents(); QTimer* timer = new QTimer(); timer->setInterval(1000); timer->start(); connect(timer, SIGNAL(timeout()), this, SLOT(UpdateUi())); }
smeMainWindow::smeMainWindow(QWidget *pParent) : QMainWindow(pParent) { setupUi(this); UpdateUi(); }
void CHistoryDlg::OnUnlimited(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/) { CButton unlimited(GetDlgItem(IDC_UNLIMITED)); m_unlimited = unlimited.GetCheck() == BST_CHECKED; UpdateUi(); }
/** * Constructs and displays the main UI for FortEdit * @param parent QWidget parent, typically null */ CFortEdit::CFortEdit(QWidget *parent) : QMainWindow(parent), DUi(new Ui::FortEdit), DActiveTool(0), DTerrainTool(0), DTerritoryTool(0), DObjectTool(0), DSelectTool(0), DSoundHandler(this), DLuaEditor(0) { DUi->setupUi(this); DGraphicsScene = new QGraphicsScene(); DUi->GraphicsView->setMouseTracking(true); DUi->GraphicsView->setScene(DGraphicsScene); DUi->GraphicsView->setUpdatesEnabled(true); // Ui connectivity / setup QObject::connect(DUi->ActionOpen, SIGNAL(triggered()), this, SLOT(OpenMap())); QObject::connect(DUi->ActionSaveAs, SIGNAL(triggered()), this, SLOT(SaveMapAs())); QObject::connect(DUi->ActionSave, SIGNAL(triggered()), this, SLOT(SaveMap())); QObject::connect(DUi->ActionNew, SIGNAL(triggered()), this, SLOT(NewMap())); QObject::connect(DUi->MapNameLineEdit, SIGNAL(textChanged(QString)), this, SLOT(UpdateSceneTitle(QString))); QObject::connect(DUi->MapWidthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(UpdateSceneWidth(int))); QObject::connect(DUi->MapHeightSpinBox, SIGNAL(valueChanged(int)), this, SLOT(UpdateSceneHeight(int))); QObject::connect(DUi->ObjectVisibilityToggle, SIGNAL(toggled(bool)), this, SLOT(UpdateSceneObjectVisibility(bool))); QObject::connect(DUi->GridCheckBox, SIGNAL(toggled(bool)), this, SLOT(UpdateSceneGridVisibility(bool))); QObject::connect(DUi->DisplayModeCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(UpdateSceneDisplayMode(QString))); QObject::connect(DUi->ToolTerrain, SIGNAL(clicked()), this, SLOT(UpdateActiveTool())); QObject::connect(DUi->ToolTerritory, SIGNAL(clicked()), this, SLOT(UpdateActiveTool())); QObject::connect(DUi->ToolObject, SIGNAL(clicked()), this, SLOT(UpdateActiveTool())); QObject::connect(DUi->ToolSelect, SIGNAL(clicked()), this, SLOT(UpdateActiveTool())); QObject::connect(DUi->AudioOptions, SIGNAL(clicked()), this, SLOT(UpdateActiveTool())); QObject::connect(DUi->ActionSaveSoundSet, SIGNAL(triggered()), this, SLOT(SaveSoundSet())); QObject::connect(DUi->ActionLoadSoundSet, SIGNAL(triggered()), &DSoundHandler, SLOT(LoadSoundSet())); QObject::connect(DUi->LuaEditorButton, SIGNAL(clicked()), this, SLOT(ToggleLuaEditor())); QObject::connect(DUi->PlayButton, SIGNAL(clicked()), this, SLOT(InvokeEngineDialog())); // Invocation dialog connectivity DInvocationDialog = new QDialog; DInvocationUi.setupUi(DInvocationDialog); LoadSettings(); DInvocationUi.executablePath->setText(DEnginePath); DInvocationUi.modeCombo->setCurrentIndex(DInvocationMode); DInvocationUi.aiCombo->setCurrentIndex(DInvocationDifficulty); DInvocationUi.castleIndexCombo->setCurrentIndex(DInvocationIndex); DInvocationUi.windCheck->setChecked(DInvocationWind); QObject::connect(DInvocationUi.locateButton, SIGNAL(clicked()), this, SLOT(LocateEngine())); QObject::connect(DInvocationUi.modeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateInvocationConfig())); QObject::connect(DInvocationUi.aiCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateInvocationConfig())); QObject::connect(DInvocationUi.castleIndexCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateInvocationConfig())); QObject::connect(DInvocationUi.windCheck, SIGNAL(stateChanged(int)), this, SLOT(UpdateInvocationConfig())); QObject::connect(DInvocationUi.buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(InvokeEngine(QAbstractButton*))); // TODO: Make sure this order is consistent... This is pretty bad as it stands DUi->PropertyPageStack->addWidget(DTerrainTool.GetPropertiesWidget()); DUi->PropertyPageStack->addWidget(DTerritoryTool.GetPropertiesWidget()); DUi->PropertyPageStack->addWidget(DSelectTool.GetPropertiesWidget()); DUi->PropertyPageStack->addWidget(DSoundHandler.GetPropertiesWidget()); DUi->PropertyPageStack->addWidget(DObjectTool.GetPropertiesWidget()); DScene = new CScene(":/default-maps/res/new.map", DGraphicsScene, &DSoundHandler); DUi->ActionSave->setEnabled(false); UpdateUi(); }