ExportAccessInfoPage::ExportAccessInfoPage(QWidget *parent) : QWizardPage(parent) { setTitle(tr("Access Information")); setSubTitle(tr("Specify Target Access Information.")); targetLabel = new QLabel(tr("Target:")); targetLineEdit = new QLineEdit; registerField("accessName*", targetLineEdit); targetLabel->setBuddy(targetLineEdit); targetButton = new QPushButton("Select"); QHBoxLayout *topLayout = new QHBoxLayout; topLayout->addWidget(targetLabel); topLayout->addWidget(targetLineEdit); topLayout->addWidget(targetButton); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(topLayout); mainLayout->addStretch(); setLayout(mainLayout); connect(targetButton, SIGNAL(clicked()), this, SLOT(selectPath())); }
PathSettingWidget::PathSettingWidget(string &pathValue_, const char *labelText, const char *pathDefaultLabel_, const char *pathBrowseLabel_, const char *pathDefaultValue_) : pathValue(pathValue_) { pathDefaultLabel = pathDefaultLabel_; pathBrowseLabel = pathBrowseLabel_; pathDefaultValue = pathDefaultValue_; layout = new QVBoxLayout; layout->setMargin(0); layout->setSpacing(0); setLayout(layout); label = new QLabel(labelText); layout->addWidget(label); controlLayout = new QHBoxLayout; controlLayout->setSpacing(Style::WidgetSpacing); layout->addLayout(controlLayout); path = new QLineEdit; path->setReadOnly(true); controlLayout->addWidget(path); pathSelect = new QPushButton("Select ..."); controlLayout->addWidget(pathSelect); pathDefault = new QPushButton("Default"); controlLayout->addWidget(pathDefault); connect(pathSelect, SIGNAL(released()), this, SLOT(selectPath())); connect(pathDefault, SIGNAL(released()), this, SLOT(defaultPath())); updatePath(); }
///-----------------重建-------------------/// void MainWindow::reconstruct() { ui->progressBar->reset(); nowProgress = 0; ui->tabWidget->setCurrentIndex(2); selectPath(PATHRECON);//set current path to :/reconstruct }
MainWindow::MainWindow(QWidget *parent) : QDialog(parent) { createWidgets(); connect(buttonBox, SIGNAL(accepted()), this, SLOT(writeSettings())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(browse, SIGNAL(clicked()), this, SLOT(selectPath())); QVBoxLayout *groupBoxLayout = new QVBoxLayout; groupBoxLayout->addSpacing(10); groupBoxLayout->addWidget(new QLabel("Default filename:")); groupBoxLayout->addWidget(nameEdit); groupBoxLayout->addSpacing(20); groupBoxLayout->addWidget(new QLabel("Image format:")); groupBoxLayout->addWidget(fileExtDropdown); groupBoxLayout->addSpacing(25); groupBoxLayout->addWidget(new QLabel("Destination folder:")); groupBoxLayout->addWidget(pathViewer); groupBoxLayout->addWidget(browse); groupBoxLayout->addSpacing(25); QGroupBox *groupBox = new QGroupBox("ScreenShot Settings"); groupBox->setLayout(groupBoxLayout); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(groupBox); mainLayout->addWidget(buttonBox); setLayout(mainLayout); loadSettings(); }
ExportTxtInfoPage::ExportTxtInfoPage(QWidget *parent) : QWizardPage(parent) { setTitle(tr("Txt Information")); setSubTitle(tr("Please Select Target Txt Information.")); targetLabel = new QLabel(tr("Target:")); targetLineEdit = new QLineEdit; registerField("txtName*", targetLineEdit); targetLabel->setBuddy(targetLineEdit); targetButton = new QPushButton("Select"); QHBoxLayout *topLayout = new QHBoxLayout; topLayout->addWidget(targetLabel); topLayout->addWidget(targetLineEdit); topLayout->addWidget(targetButton); groupBox = new QGroupBox(tr("Column Separators")); commaRadioButton = new QRadioButton(tr("Comma")); commaRadioButton->setChecked(true); QGridLayout *gridLayout = new QGridLayout; gridLayout->addWidget(commaRadioButton, 0, 0); groupBox->setLayout(gridLayout); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(topLayout); mainLayout->addWidget(groupBox); // mainLayout->addStretch(); setLayout(mainLayout); connect(targetButton, SIGNAL(clicked()), this, SLOT(selectPath())); }
SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SettingsDialog) { ui->setupUi(this); connect(ui->debugLinkButton, SIGNAL(clicked()), this, SIGNAL(debugRequested()) ); connect(ui->dataPathButton, SIGNAL(clicked()), this, SLOT(selectPath()) ); }
LRESULT CMainDlg::OnBrowseButtonClicked(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { open_folder_dialog_->DoModal(m_hWnd); CEdit targetEdit = (CEdit)GetDlgItem(IDC_TARGET_EDIT); targetEdit.SetWindowText(open_folder_dialog_->GetFolderPath()); selectPath(); return 0; }
///-------------------标定-------------------/// void MainWindow::calib() { QMessageBox::information(NULL, tr("Calibration"), tr("Calibration Actived!")); selectPath(PATHCALIB); ui->tabWidget->setCurrentIndex(0);//go to calibration page ui->explainLabel->setPixmap(":/" + QString::number(saveCount) + ".png"); ui->captureButton->setEnabled(true); ui->redoButton->setEnabled(true); ui->calibButton->setEnabled(true); }
void MainWindow::generatePath(int type) { selectPath(type); QDir *addpath_1 = new QDir; QDir *addpath_2 = new QDir; if(type == 0 || type == 1){ addpath_1->mkpath(projChildPath + "/left/"); addpath_2->mkpath(projChildPath +"/right/"); } else addpath_1->mkpath(projChildPath); }
MapWizzard::MapWizzard(QWidget *parent) : QDialog(parent), ui(new Ui::MapWizzard) { ui->setupUi(this); m_preferences = PreferencesManager::getInstance(); connect(ui->m_browserPush,SIGNAL(clicked()),this,SLOT(selectPath())); QStringList data; data << tr("No Right") << tr("His character") << tr("All Permissions"); ui->m_permissionSelector->addItems(data); }
void JG_AttackWave_AllLinesTogether::initAttackWave(float attackDifficulty, int attackCount) { JG_AttackWave_Base::initAttackWave( attackDifficulty, attackCount); enemeyAddInterval = 0.3; pathCounter =0; int currentTotalPathExist = CALL_MEMBER_FN(listenerObj,getAvailablePathCountFunction)(); float totalDifficulty = 0.0; float currentEnemyDifficulty; while( totalDifficulty < attackDifficulty) { currentEnemy=addEnemy(); //CCLOG("enemy added"); currentEnemyDifficulty = currentEnemy->GetDifficulty(); //difficulty added because of path health currentEnemyDifficulty *= (1 + ( (100 - selectPath(pathCounter)->GetHealth() )/100 )); //defficulty added because of concurrent path attack currentEnemyDifficulty *= ( ( (pathCounter+1) > currentTotalPathExist ? currentTotalPathExist:(pathCounter+1)) *2 ); totalDifficulty += currentEnemyDifficulty; enemyCounter ++; pathCounter ++; //TODO pathcounter is redundant } //schedule(schedule_selector(JG_AttackWave_AllLinesSequential::initiateEnemyAttack),0,1,0.1); //this->schedule(schedule_selector(JG_AttackWave_AllLinesSequential::initiateEnemyAttack),0.5); //initiateEnemyAttack(2); //schedule(schedule_selector(JG_AttackWave_AllLinesSequential::initiateEnemyAttack),enemeyAddInterval,pathCo); schedule(schedule_selector(JG_AttackWave_AllLinesSequential::initiateEnemyAttack), enemeyAddInterval, pathCounter-1,0); }
UnitTester::UnitTester(ros::NodeHandle& node_handle) { path_size = 1000; path_type = 1; // Mimics other nodes state_publisher = node_handle.advertise<auro666_pilot::State>("vehicle_server/state", 20); pose_publisher = node_handle.advertise<geometry_msgs::Pose>("localization/pose", 100); path_publisher = node_handle.advertise<nav_msgs::Path>("local_planner/path", 10); // Observed stuff from simulator. Noise can be added later. state_subscriber = node_handle.subscribe("simulator/state", 2, &UnitTester::publishState, this); pose_subscriber = node_handle.subscribe("simulator/pose", 2, &UnitTester::publishPose, this); selectPath(); }
LRESULT CMainDlg::OnEnableSaveCheckboxClicked(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { CButton enableSaveCheckBox = (CButton)GetDlgItem(IDC_ENABLE_SAVE_CHECKBOX); CEdit targetEdit = (CEdit)GetDlgItem(IDC_TARGET_EDIT); CButton browseButton = (CButton)GetDlgItem(IDC_BROWSE_BUTTON); bool isChecked = enableSaveCheckBox.GetCheck(); targetEdit.EnableWindow(isChecked); browseButton.EnableWindow(isChecked); if (isChecked) { selectPath(); } else { callback_handler_->SetDownloadTarget(NULL); } return 0; }
FilePathWidget::FilePathWidget(QWidget *parent) : QWidget(parent), m_lineEdit(new QLineEdit(this)), m_completer(NULL), m_selectFile(true) { QPushButton *button = new QPushButton(tr("Browse…"), this); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(m_lineEdit); layout->addWidget(button); layout->setContentsMargins(0, 0, 0, 0); setLayout(layout); setFocusPolicy(Qt::StrongFocus); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); connect(m_lineEdit, SIGNAL(textEdited(QString)), this, SLOT(updateCompleter())); connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(pathChanged(QString))); connect(button, SIGNAL(clicked()), this, SLOT(selectPath())); }
///-----------------------扫描---------------------------/// void MainWindow::scan() { ui->progressBar->reset(); nowProgress = 0; if(!DHC->cameraOpened){ QMessageBox::warning(this, tr("Cameras are not Opened"), tr("Cameras are not opened.")); return; } if(projectPath==""){ QMessageBox::warning(this,tr("Save Path hasn't been Set"), tr("You need create a project first.")); return; } selectPath(PATHSCAN); ui->tabWidget->setCurrentIndex(PATHSCAN); ui->findPointButton->setEnabled(true); ui->reFindButton->setEnabled(true); ui->startScanButton->setEnabled(true); pj->setCrossVisable(false); }
void JG_AttackWave_AllLinesTogether::initiateEnemyAttack(float dt) { //CCLOG("start attack"); //unschedule(schedule_selector(JG_AttackWave_AllLinesSequential::initiateEnemyAttack)); //CCLOG(CCString::createWithFormat("enemy path count: %d", pathQueue.size())->getCString()); JG_Path * enemyPath = selectPath(pathQueue.front()); pathQueue.pop(); //CCLOG("moving new enemy"); if(CALL_MEMBER_FN(listenerObj,getHealthesToRewardCountFunction)() > 0 ) { //CCLOG(CCString::createWithFormat("healths to reward counter is: ", mainGame->getHealthsToRewardCount())->getCString()); enemyQueue.front()->SetEnemyBonus(EnemyBonus_PathHealth); CALL_MEMBER_FN(listenerObj,onHealthRewardedFunction)(); } else if(CALL_MEMBER_FN(listenerObj,getBallsToRewardCountFunction)()>0 ) { // CCLOG("enemy with ball bonus"); enemyQueue.front()->SetEnemyBonus(EnemyBonus_ExtraBall); CALL_MEMBER_FN(listenerObj,onBallRewardedFunction)(); } enemyQueue.front()->SetDestinationPath(enemyPath->GetPositionForLengthRatio(generateEnemyPositionRatio()),enemyPath); enemyQueue.pop(); //CCLOG("enemt queue ok"); //if more enemie(s) -> schedule next enemy attack if(enemyQueue.size()==0) { CALL_MEMBER_FN(listenerObj,onAttackWaveFinishedFunction)(); //CCLOG("enemy queue is ok"); //schedule(schedule_selector(JG_AttackWave_AllLinesSequential::initiateEnemyAttack),0,0,enemeyAddInterval); //scheduleOnce(schedule_selector(JG_AttackWave_AllLinesSequential::initiateEnemyAttack), enemeyAddInterval); // schedule(schedule_selector(JG_AttackWave_AllLinesSequential::initiateEnemyAttack),enemeyAddInterval); } //if no more enemies -> tell the main game that attack has finished //else //{ //} }
// Button add has been pressed; use file dialog and add path if it's a valid java.exe void CFindJava2Dlg::OnBnClickedButtonAdd() { CFileDialog fileDlg( TRUE, // true=open dialog, false=save-as dialog _T("exe"), // lpszDefExt _T("java.exe"), // lpszFileName OFN_FILEMUSTEXIST || OFN_PATHMUSTEXIST, NULL, // lpszFilter this); // pParentWnd if (fileDlg.DoModal() == IDOK) { CString path = fileDlg.GetPathName(); CJavaPath javaPath; if (!mJavaFinder->checkJavaPath(path, &javaPath)) { CString msg; if (javaPath.mVersion > 0) { msg.Format(_T("Insufficient Java Version found: expected %s, got %s"), CJavaPath(mJavaFinder->getMinVersion(), CPath()).getVersion(), javaPath.getVersion()); } else { msg.Format(_T("No valid Java Version found for %s"), path); } AfxMessageBox(msg, MB_OK); } else { if (mPaths.find(javaPath) == mPaths.end()) { // Path isn't known yet so add it and refresh the list. mPaths.insert(javaPath); fillPathsList(); } // Select item in list and set mSelectedIndex selectPath(-1 /*index*/, &javaPath); } } }
void placement::boxFormation() { for (partition* p : allPartitions) { moduleSet* seeds = selectBoxSeeds(p); if (seeds->empty()) throw std::runtime_error("No seeds"); while (!p->partitionModules.empty()) { if (seeds->empty()) { for (moduleImpl* m : p->partitionModules) { seeds->insert(m); } } box* longestPath = nullptr; for (moduleImpl* seed : *seeds) { box* path = new box(seed); path = selectPath(path, p->partitionModules); // Call by Value if (longestPath == nullptr || longestPath->length() < path->length()) { delete longestPath; longestPath = path; } else delete path; } for (auto&& m : longestPath->boxModules) { p->partitionModules.erase(m); m->setParentBox(longestPath); } for (moduleImpl* m : longestPath->boxModules) { seeds->erase(m); } p->add(longestPath); } delete seeds; } }
// An item in the list has been selected, select checkmark and set mSelectedIndex. void CFindJava2Dlg::OnNMClickPathList(NMHDR *pNMHDR, LRESULT *pResult) { LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR); int index = pNMItemActivate->iItem; selectPath(index, nullptr); *pResult = TRUE; }