void MessageBox::createConfig(std::ostream& config) { config << ",title:" << windowTitle().jsStringLiteral(); if (!text_.empty()) config << ",msg:" << text_.jsStringLiteral(); if (prompt_) config << ",prompt:true"; if (textArea_) config << ",multiline:true"; if (prompt_ || textArea_) config << ",value:" << value_.jsStringLiteral(); if (progress_) config << ",progress:true"; if (buttons_ != NoButton) { config << ",buttons:{a:0"; if (buttons_ & Ok) config << ",ok:" + jsStringLiteral(buttonText(0), '\''); if (buttons_ & Cancel) config << ",cancel:" + jsStringLiteral(buttonText(3), '\''); if (buttons_ & Yes) config << ",yes:" + jsStringLiteral(buttonText(1), '\''); if (buttons_ & No) config << ",no:" + jsStringLiteral(buttonText(2), '\''); config << "}"; } config << ",fn:function(b,v){" << extButtonClicked_.createCall("b","v") << "}"; }
void SetupWizard::createPages() { setPage(PAGE_START, new StartPage(this)); setPage(PAGE_UPDATE, new AutoUpdatePage(this)); setPage(PAGE_CONTROLLER, new ControllerPage(this)); setPage(PAGE_VEHICLES, new VehiclePage(this)); setPage(PAGE_MULTI, new MultiPage(this)); setPage(PAGE_FIXEDWING, new FixedWingPage(this)); setPage(PAGE_HELI, new HeliPage(this)); setPage(PAGE_SURFACE, new SurfacePage(this)); setPage(PAGE_INPUT, new InputPage(this)); setPage(PAGE_OUTPUT, new OutputPage(this)); setPage(PAGE_LEVELLING, new LevellingPage(this)); setPage(PAGE_CALIBRATION, new OutputCalibrationPage(this)); setPage(PAGE_SUMMARY, new SummaryPage(this)); setPage(PAGE_SAVE, new SavePage(this)); setPage(PAGE_REBOOT, new RebootPage(this)); setPage(PAGE_NOTYETIMPLEMENTED, new NotYetImplementedPage(this)); setPage(PAGE_END, new EndPage(this)); setStartId(PAGE_START); connect(button(QWizard::CustomButton1), SIGNAL(clicked()), this, SLOT(customBackClicked())); setButtonText(QWizard::CustomButton1, buttonText(QWizard::BackButton)); QList<QWizard::WizardButton> button_layout; button_layout << QWizard::Stretch << QWizard::CustomButton1 << QWizard::NextButton << QWizard::CancelButton << QWizard::FinishButton; setButtonLayout(button_layout); connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(pageChanged(int))); }
Login::Login(QWidget *parent): QDialog(parent) { QString labelString("Twitch User Name:"); twitchNameLabel = new QLabel(this); assert(twitchNameLabel != NULL); twitchNameLabel->setText(labelString); twitchNameLabel->setGeometry(QRect(50,30,120,15)); twitchNameLabel->show(); loginButton = new QPushButton(this); assert(loginButton != NULL); QString buttonText("Login"); loginButton->setText(buttonText); loginButton->setGeometry(QRect(50,90,90,25)); connect(loginButton, SIGNAL( released()),this, SLOT(GetFollowingList())); loginButton->show(); edit = new QTextEdit(this); assert(edit != NULL); edit->setGeometry(QRect(50,50,140,20)); edit->show(); }
void SetupWizard::createPages() { setPage(PAGE_START, new OPStartPage(this)); setPage(PAGE_UPDATE, new AutoUpdatePage(this)); setPage(PAGE_CONTROLLER, new ControllerPage(this)); setPage(PAGE_VEHICLES, new VehiclePage(this)); setPage(PAGE_MULTI, new MultiPage(this)); setPage(PAGE_FIXEDWING, new FixedWingPage(this)); setPage(PAGE_AIRSPEED, new AirSpeedPage(this)); setPage(PAGE_GPS, new GpsPage(this)); setPage(PAGE_HELI, new HeliPage(this)); setPage(PAGE_SURFACE, new SurfacePage(this)); setPage(PAGE_INPUT, new InputPage(this)); setPage(PAGE_ESC, new EscPage(this)); setPage(PAGE_SERVO, new ServoPage(this)); setPage(PAGE_BIAS_CALIBRATION, new BiasCalibrationPage(this)); setPage(PAGE_ESC_CALIBRATION, new EscCalibrationPage(this)); setPage(PAGE_OUTPUT_CALIBRATION, new OutputCalibrationPage(this)); setPage(PAGE_SUMMARY, new SummaryPage(this)); setPage(PAGE_SAVE, new SavePage(this)); setPage(PAGE_NOTYETIMPLEMENTED, new NotYetImplementedPage(this)); setPage(PAGE_AIRFRAME_INITIAL_TUNING, new AirframeInitialTuningPage(this)); setPage(PAGE_END, new OPEndPage(this)); setStartId(PAGE_START); connect(button(QWizard::CustomButton1), SIGNAL(clicked()), this, SLOT(customBackClicked())); setButtonText(QWizard::CustomButton1, buttonText(QWizard::BackButton)); QList<QWizard::WizardButton> button_layout; button_layout << QWizard::Stretch << QWizard::CustomButton1 << QWizard::NextButton << QWizard::CancelButton << QWizard::FinishButton; setButtonLayout(button_layout); connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(pageChanged(int))); }
bool Game::showMainMenu() { Graphics::Aurora::GUIQuad top("introscr_top" , 0.0f, 0.0f, kScreenWidth, kScreenHeight, 0.0f, 1.0f, 1.0f, 0.0f); Graphics::Aurora::GUIQuad bot("startupscrbot", 0.0f, 0.0f, kScreenWidth, kScreenHeight, 0.0f, 1.0f, 1.0f, 0.0f); top.setPosition(kTopScreenX , kTopScreenY , 0.0f); bot.setPosition(kBottomScreenX, kBottomScreenY, 0.0f); top.show(); bot.show(); Graphics::Aurora::TextureHandle buttonTexture = loadNCGR("main_pnl_off", "gui_main_pnl", 8, 2, "00", "01", "02", "03", "04", (const char *) 0, (const char *) 0, (const char *) 0, "10", "11", "12", "13", "14", "15", "16", "17"); Graphics::Aurora::GUIQuad button(buttonTexture, 0.0f, 0.0f, 240.0f, 48.0f, 0.0f, 1.0f, 1.0f, 0.0f); button.setPosition(-120.0f, -120.0f, -1.0f); button.show(); Graphics::Aurora::Text buttonText(_guiFont, TalkMan.getString(15860)); float buttonX, buttonY, buttonZ; button.getPosition(buttonX, buttonY, buttonZ); const float buttonTextX = buttonX + ((button.getWidth() - buttonText.getWidth()) / 2.0f); const float buttonTextY = buttonY + ((button.getHeight() - buttonText.getHeight()) / 2.0f); buttonText.setPosition(buttonTextX, buttonTextY, -2.0f); buttonText.show(); Graphics::Aurora::Text helpText(_guiFont, TalkMan.getString(18707)); const float helpTextX = kBottomScreenX + ((kScreenWidth - helpText.getWidth()) / 2.0f); const float helpTextY = kBottomScreenY; helpText.setPosition(helpTextX, helpTextY, -2.0f); helpText.show(); GfxMan.unlockFrame(); if (!waitClick()) return false; GfxMan.lockFrame(); helpText.hide(); buttonText.hide(); button.hide(); top.hide(); bot.hide(); return true; }
bool Game::showMainMenu() { Graphics::Aurora::GUIQuad top("introscr_top" , 0.0f, 0.0f, kScreenWidth, kScreenHeight, 0.0f, 1.0f, 1.0f, 0.0f); Graphics::Aurora::GUIQuad bot("startupscrbot", 0.0f, 0.0f, kScreenWidth, kScreenHeight, 0.0f, 1.0f, 1.0f, 0.0f); top.setPosition(kTopScreenX , kTopScreenY , 0.0f); bot.setPosition(kBottomScreenX, kBottomScreenY, 0.0f); top.show(); bot.show(); Graphics::Aurora::TextureHandle buttonTexture = loadNCGR("main_pnl_off", "gui_main_pnl", 8, 2, "00", "01", "02", "03", "04", (const char *) 0, (const char *) 0, (const char *) 0, "10", "11", "12", "13", "14", "15", "16", "17"); Graphics::Aurora::GUIQuad button(buttonTexture, 0.0f, 0.0f, 240.0f, 48.0f, 0.0f, 1.0f, 1.0f, 0.0f); button.setPosition(-120.0f, -120.0f, -1.0f); button.show(); Graphics::Aurora::Text buttonText(_guiFont, 240.0f, 48.0f, TalkMan.getString(15860), 1.0f, 1.0f, 1.0f, 1.0f, Graphics::Aurora::kHAlignCenter, Graphics::Aurora::kVAlignMiddle); buttonText.setPosition(-120.0f, -120.0f, -2.0f); buttonText.show(); Graphics::Aurora::Text helpText(_guiFont, kScreenWidth, kScreenHeight, TalkMan.getString(18707), 1.0f, 1.0f, 1.0f, 1.0f, Graphics::Aurora::kHAlignCenter, Graphics::Aurora::kVAlignBottom); helpText.setPosition(kBottomScreenX, kBottomScreenY, -2.0f); helpText.show(); GfxMan.unlockFrame(); if (!waitClick()) return false; GfxMan.lockFrame(); helpText.hide(); buttonText.hide(); button.hide(); top.hide(); bot.hide(); return true; }
QWidget * QDialogButtons::createButton(Button b) { QPushButton *ret = new QPushButton(this, "qdialog_button"); QObject::connect(ret, SIGNAL(clicked()), this, SLOT(handleClicked())); if(d->text.contains(b)) { ret->setText(d->text[b]); } else { switch(b) { case All: { QString txt = buttonText(defaultButton()); if(txt.isNull()) { if(defaultButton() == Accept) { if(questionMode()) txt = tr("Yes to All"); else txt = tr("OK to All"); } else { if(questionMode()) txt = tr("No to All"); else txt = tr("Cancel All"); } } else { txt += tr(" to All"); //ick, I can't really do this!! } ret->setText(txt); break; } case Accept: if(questionMode()) ret->setText(tr("Yes")); else ret->setText(tr("OK")); break; case Reject: if(questionMode()) ret->setText(tr("No")); else ret->setText(tr("Cancel")); break; case Apply: ret->setText(tr("Apply")); break; case Ignore: ret->setText(tr("Ignore")); break; case Retry: ret->setText(tr("Retry")); break; case Abort: ret->setText(tr("Abort")); break; case Help: ret->setText(tr("Help")); break; default: break; } } return ret; }
void ExportWizard::accept() { QString finishText = buttonText(QWizard::FinishButton); if (finishText == tr("Finish")) { QDialog::accept(); return; } QString key = exportInfo->getSource(); QSqlDatabase source = QSqlDatabase::database(strMap.value(key)); if (field("txtRadio").toBool()) { QString directory = field("txtName").toString(); exportTxt(source, directory); } else if (field("accessRadio").toBool()) { QString accessName = field("accessName").toString(); QSqlDatabase target = QSqlDatabase::addDatabase("QODBC", "QODBCTempConnect"); target.setDatabaseName("DRIVER={Microsoft Access driver (*.mdb, *.accdb)};FIL={MS Access};DBQ=" + accessName); if (!target.open()) return; exportData(source, target); } else if (field("sqlserverRadio").toBool()) { QString databaseName = field("sqlserverDatabaseName").toString(); QString hostName = field("sqlserverHostName").toString(); QString dsn = "Driver={sql server};server=" + hostName + ";database=" + databaseName; QSqlDatabase target = QSqlDatabase::addDatabase("QODBC", "QODBCTempConnect"); target.setDatabaseName(dsn); QString userName = field("sqlserverUserName").toString(); if (!userName.isEmpty()) target.setUserName(userName); QString password = field("sqlserverPassword").toString(); if (!password.isEmpty()) target.setPassword(password); QString port = field("sqlserverPort").toString(); if (!port.isEmpty()) { bool ok; int i = port.toInt(&ok); if (ok) target.setPort(i); } if (target.open()) { exportData(source, target); } } else if (field("excelRadio").toBool()) { QString excelName = field("excelName").toString(); exportExcel(source, excelName); } else { QString directory = field("xmlName").toString(); exportXml(source, directory); } }