/* ******************************************************************************** * * * Class ShortcutDialog * * * ******************************************************************************** */ ShortcutDialog::ShortcutDialog(QString key, QString shortcut, QWidget *parent) : DialogBase(parent) { m_key = key; m_old_shortcut = shortcut; //! ui this->setTitle(tr("Change shortcut")); this->resize(400, 170); QLabel * label= new QLabel(this); label->setAlignment(Qt::AlignCenter); label->setWordWrap(false); label->setText(tr("Press a keys that you want to set as a shortcut")); m_currentShortcut = new QLabel(this); m_currentShortcut->setAlignment(Qt::AlignCenter); m_currentShortcut->setText(m_old_shortcut); QVBoxLayout * layout = new QVBoxLayout(); layout->addWidget(label); layout->addWidget(m_currentShortcut); setContentLayout(layout); //! connection connect(buttonBox(), SIGNAL(rejected()),this, SLOT(close())); connect(buttonBox(), SIGNAL(accepted()),this, SLOT(accept())); //! List legal modifiers m_modifier_keys << Qt::ControlModifier << Qt::AltModifier << Qt::MetaModifier << Qt::ShiftModifier; }
/* ******************************************************************************** * * * Class AddStreamDialog * * * ******************************************************************************** */ AddStreamDialog::AddStreamDialog(QWidget *parent,bool active_category) : DialogBase(parent, tr("Add Stream")) { //create ui this->setFixedSize(480,160); ui_edit_url = new QLineEdit(); ui_edit_url->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); ui_edit_url->setText("http://"); ui_edit_name = new QLineEdit(); ui_edit_name->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); QGridLayout *ui_grid_layout = new QGridLayout(); ui_grid_layout->setContentsMargins(0, 0, 0, 0); ui_grid_layout->addWidget(new QLabel(tr("url")), 0, 0, 1, 1); ui_grid_layout->addWidget(ui_edit_url, 0, 1, 1, 1); ui_grid_layout->addWidget(new QLabel(tr("name")), 1, 0, 1, 1); ui_grid_layout->addWidget(ui_edit_name, 1, 1, 1, 1); ui_edit_category = 0; if(active_category) { ui_edit_category = new QLineEdit(); ui_grid_layout->addWidget(new QLabel(tr("category")), 2, 0, 1, 1); ui_grid_layout->addWidget(ui_edit_category, 2, 1, 1, 1); } /* layout content */ setContentLayout(ui_grid_layout); QObject::connect(buttonBox(), SIGNAL(accepted()), this, SLOT(on_buttonBox_accepted())); QObject::connect(buttonBox(), SIGNAL(rejected()), this, SLOT(on_buttonBox_rejected())); }
QuetzalChoiceDialog::QuetzalChoiceDialog(const char *title, const char *primary, const char *secondary, int default_value, const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, void *user_data, va_list choices, QWidget *parent) : QuetzalRequestDialog(title, primary, secondary, PURPLE_REQUEST_CHOICE, user_data, parent) { m_ok_cb = (PurpleRequestChoiceCb) ok_cb; m_cancel_cb = (PurpleRequestChoiceCb) cancel_cb; QPushButton *ok_button = buttonBox()->addButton(ok_text, QDialogButtonBox::AcceptRole); QPushButton *cancel_button = buttonBox()->addButton(cancel_text, QDialogButtonBox::RejectRole); connect(ok_button, SIGNAL(clicked()), this, SLOT(onOkClicked())); connect(cancel_button, SIGNAL(clicked()), this, SLOT(onCancelClicked())); const char *text; int id; int i = 1; // Label with description is situated at index 0 while (!!(text = va_arg(choices, gchararray))) { id = va_arg(choices, int); QRadioButton *button = new QRadioButton(text, this); m_radios << button; button->setProperty("choiceId", id); boxLayout()->insertWidget(i++, button); if (id == default_value) button->setChecked(true); } }
ConversationDialog::ConversationDialog(QWidget &parent, CaptureFile &cf, int cli_proto_id, const char *filter) : TrafficTableDialog(parent, cf, filter, table_name_) { follow_bt_ = buttonBox()->addButton(tr("Follow Stream..."), QDialogButtonBox::ActionRole); follow_bt_->setToolTip(tr("Follow a TCP or UDP stream.")); connect(follow_bt_, SIGNAL(clicked()), this, SLOT(followStream())); graph_bt_ = buttonBox()->addButton(tr("Graph..."), QDialogButtonBox::ActionRole); graph_bt_->setToolTip(tr("Graph a TCP conversation.")); connect(graph_bt_, SIGNAL(clicked()), this, SLOT(graphTcp())); QList<int> conv_protos; for (GList *conv_tab = recent.conversation_tabs; conv_tab; conv_tab = conv_tab->next) { int proto_id = proto_get_id_by_short_name((const char *)conv_tab->data); if (proto_id > -1 && !conv_protos.contains(proto_id)) { conv_protos.append(proto_id); } } if (conv_protos.isEmpty()) { conv_protos = defaultProtos(); } // Bring the command-line specified type to the front. if (get_conversation_by_proto_id(cli_proto_id)) { conv_protos.removeAll(cli_proto_id); conv_protos.prepend(cli_proto_id); } // QTabWidget selects the first item by default. foreach (int conv_proto, conv_protos) { addTrafficTable(get_conversation_by_proto_id(conv_proto)); }
KScanDialog::KScanDialog(int dialogFace, int buttonMask, QWidget *parent) : KPageDialog(parent), d(new KScanDialogPrivate) { setFaceType((KPageDialog::FaceType)dialogFace); setWindowTitle(i18n("Acquire Image")); buttonBox()->setStandardButtons((QDialogButtonBox::StandardButtons)buttonMask); buttonBox()->button(QDialogButtonBox::Close)->setDefault(true); }
KOCRDialog::KOCRDialog(int dialogFace, int buttonMask, QWidget *parent, bool modal) : KPageDialog(parent), d(new KOCRDialogPrivate) { setFaceType((KPageDialog::FaceType)dialogFace); setWindowTitle(i18n("OCR Image")); buttonBox()->setStandardButtons((QDialogButtonBox::StandardButtons)buttonMask); buttonBox()->button(QDialogButtonBox::Close)->setDefault(true); setModal(modal); }
void ReportAssistantDialog::currentPageChanged_slot(KPageWidgetItem * current , KPageWidgetItem * before) { //Page changed buttonBox()->button(QDialogButtonBox::Cancel)->setEnabled(true); m_canClose = false; //Save data of the previous page if (before) { ReportAssistantPage* beforePage = dynamic_cast<ReportAssistantPage*>(before->widget()); beforePage->aboutToHide(); } //Load data of the current(new) page if (current) { ReportAssistantPage* currentPage = dynamic_cast<ReportAssistantPage*>(current->widget()); nextButton()->setEnabled(currentPage->isComplete()); currentPage->aboutToShow(); } //If the current page is the last one, disable all the buttons until the bug is sent if (current->name() == QLatin1String(PAGE_BZSEND_ID)) { nextButton()->setEnabled(false); backButton()->setEnabled(false); finishButton()->setEnabled(false); } }
void AboutDialog::displayFile(const QString &fileName, const QString &title) { QDialog dialog(this); QVBoxLayout layout(&dialog); QTextEdit textEdit(&dialog); QDialogButtonBox buttonBox(QDialogButtonBox::Close, Qt::Horizontal, &dialog); textEdit.setLayoutDirection(Qt::LeftToRight); QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) return; QTextStream stream(&file); stream.setCodec("UTF-8"); QString text = stream.readAll(); // this is done to force the content of the text editor to be LTR, and monospaced. textEdit.setHtml(QString(QLatin1String("<pre>%1</pre>")).arg(text)); textEdit.setReadOnly(true); connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(close())); buttonBox.setCenterButtons(true); layout.addWidget(&textEdit); layout.addWidget(&buttonBox); layout.setMargin(6); dialog.setLayout(&layout); dialog.setWindowTitle(title); dialog.setWindowFlags(Qt::Sheet); dialog.resize(600, 350); dialog.exec(); }
EndpointDialog::EndpointDialog(QWidget &parent, CaptureFile &cf, int cli_proto_id, const char *filter) : TrafficTableDialog(parent, cf, filter, table_name_) { #ifdef HAVE_GEOIP map_bt_ = buttonBox()->addButton(tr("Map"), QDialogButtonBox::ActionRole); map_bt_->setToolTip(tr("Draw IPv4 or IPv6 endpoints on a map.")); connect(map_bt_, SIGNAL(clicked()), this, SLOT(createMap())); connect(trafficTableTabWidget(), SIGNAL(currentChanged(int)), this, SLOT(tabChanged())); #endif QList<int> endp_protos; for (GList *endp_tab = recent.endpoint_tabs; endp_tab; endp_tab = endp_tab->next) { int proto_id = proto_get_id_by_short_name((const char *)endp_tab->data); if (proto_id > -1 && !endp_protos.contains(proto_id)) { endp_protos.append(proto_id); } } if (endp_protos.isEmpty()) { endp_protos = defaultProtos(); } // Bring the command-line specified type to the front. if (get_conversation_by_proto_id(cli_proto_id)) { endp_protos.removeAll(cli_proto_id); endp_protos.prepend(cli_proto_id); } // QTabWidget selects the first item by default. foreach (int endp_proto, endp_protos) { addTrafficTable(get_conversation_by_proto_id(endp_proto)); }
void NewGeneMainWindow::on_actionDisplay_output_dataset_path_triggered() { if (outp == nullptr) { QMessageBox::information(nullptr, "NewGene", "No output project is currently open."); return; } std::string output = outp->backend().projectSettings().GetSettingsPath().string(); if (!output.empty()) { // From http://stackoverflow.com/a/17512615/368896 QDialog dialog(this); dialog.setWindowFlags(dialog.windowFlags() & ~(Qt::WindowContextHelpButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint)); QFormLayout form(&dialog); form.addRow(new QLabel("Output dataset path:")); QLineEdit * lineEdit = new QLineEdit(&dialog); setLineEditWidth(lineEdit); lineEdit->setText(output.c_str()); lineEdit->setReadOnly(true); lineEdit->setMinimumWidth(600); form.addRow(lineEdit); QDialogButtonBox buttonBox(QDialogButtonBox::Ok, Qt::Horizontal, &dialog); form.addRow(&buttonBox); QObject::connect(&buttonBox, &QDialogButtonBox::accepted, [&]() { dialog.close(); }); dialog.exec(); } }
void DataDialog::createGui() { if (_mode == New) { buttonBox()->button(QDialogButtonBox::Apply)->setVisible(false); } connect(this, SIGNAL(apply()), this, SLOT(slotApply())); QWidget *extension = extensionWidget(); QVBoxLayout *extensionLayout = new QVBoxLayout(extension); extensionLayout->setContentsMargins(0, -1, 0, -1); _editMultipleWidget = new EditMultipleWidget(); extensionLayout->addWidget(_editMultipleWidget); extension->setLayout(extensionLayout); QWidget *box = topCustomWidget(); QHBoxLayout *layout = new QHBoxLayout(box); _nameLabel = new QLabel(tr("&Name:"), box); _tagString = new QLineEdit(box); connect(_tagString, SIGNAL(textChanged(QString)), this, SLOT(modified())); _nameLabel->setBuddy(_tagString); _shortName = new QLabel(QString(), box); _tagStringAuto = new QCheckBox(tr("&Auto","automatic"), box); connect(_tagStringAuto, SIGNAL(toggled(bool)), _tagString, SLOT(setDisabled(bool))); _editMultipleButton = new QPushButton(tr("Edit Multiple >>")); _editMultipleButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); connect(_editMultipleButton, SIGNAL(clicked()), this, SLOT(slotEditMultiple())); QLabel *spacer = new QLabel(); if (_dataObject) { setTagString(_dataObject->descriptiveName()); setShortName(_dataObject->shortName()); _tagStringAuto->setChecked(!_dataObject->descriptiveNameIsManual()); } else { _tagStringAuto->setChecked(true); setTagString(QString()); _editMultipleButton->setVisible(false); } layout->addWidget(_nameLabel); layout->addWidget(_tagString); layout->addWidget(_shortName); layout->addWidget(_tagStringAuto); layout->addWidget(spacer); layout->addWidget(_editMultipleButton); box->setLayout(layout); }
QgsNewNameDialog::QgsNewNameDialog( const QString &source, const QString &initial, const QStringList &extensions, const QStringList &existing, const QRegExp ®exp, Qt::CaseSensitivity cs, QWidget *parent, Qt::WindowFlags flags ) : QgsDialog( parent, flags, QDialogButtonBox::Ok | QDialogButtonBox::Cancel ) , mExiting( existing ) , mExtensions( extensions ) , mCaseSensitivity( cs ) , mNamesLabel( nullptr ) , mRegexp( regexp ) , mOverwriteEnabled( true ) { setWindowTitle( tr( "New name" ) ); QDialog::layout()->setSizeConstraint( QLayout::SetMinimumSize ); layout()->setSizeConstraint( QLayout::SetMinimumSize ); layout()->setSpacing( 6 ); mOkString = buttonBox()->button( QDialogButtonBox::Ok )->text(); QString hintString; QString nameDesc = mExtensions.isEmpty() ? tr( "name" ) : tr( "base name" ); if ( source.isEmpty() ) { hintString = tr( "Enter new %1" ).arg( nameDesc ); } else { hintString = tr( "Enter new %1 for %2" ).arg( nameDesc, source ); } mHintLabel = new QLabel( hintString, this ); layout()->addWidget( mHintLabel ); mLineEdit = new QLineEdit( initial, this ); if ( !regexp.isEmpty() ) { QRegExpValidator *validator = new QRegExpValidator( regexp, this ); mLineEdit->setValidator( validator ); } mLineEdit->setMinimumWidth( mLineEdit->fontMetrics().width( QStringLiteral( "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ) ) ); connect( mLineEdit, &QLineEdit::textChanged, this, &QgsNewNameDialog::nameChanged ); layout()->addWidget( mLineEdit ); mNamesLabel = new QLabel( QStringLiteral( " " ), this ); mNamesLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); if ( !mExtensions.isEmpty() ) { mNamesLabel->setWordWrap( true ); layout()->addWidget( mNamesLabel ); } mErrorLabel = new QLabel( QStringLiteral( " " ), this ); mErrorLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); mErrorLabel->setWordWrap( true ); layout()->addWidget( mErrorLabel ); mLineEdit->setFocus(); mLineEdit->selectAll(); nameChanged(); }
// --- StyleSheetPropertyEditorDialog StyleSheetPropertyEditorDialog::StyleSheetPropertyEditorDialog(QWidget *parent, QDesignerFormWindowInterface *fw, QWidget *widget): StyleSheetEditorDialog(fw->core(), parent), m_fw(fw), m_widget(widget) { Q_ASSERT(m_fw != 0); QPushButton *apply = buttonBox()->addButton(QDialogButtonBox::Apply); QObject::connect(apply, SIGNAL(clicked()), this, SLOT(applyStyleSheet())); QObject::connect(buttonBox(), SIGNAL(accepted()), this, SLOT(applyStyleSheet())); QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(m_fw->core()->extensionManager(), m_widget); Q_ASSERT(sheet != 0); setText(sheet->property(sheet->indexOf(QLatin1String(styleSheetProperty))).toString()); }
KWPageSettingsDialog::KWPageSettingsDialog(QWidget *parent, KWDocument *document, const KWPage &page) : KoPageLayoutDialog(parent, page.pageStyle().pageLayout()), m_document(document), m_page(page), m_pageStyle(page.pageStyle()) { Q_ASSERT(document); setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel); connect(buttonBox(), SIGNAL(clicked(QAbstractButton*)), this, SLOT(slotButtonClicked(QAbstractButton*))); showUnitchooser(true); Q_ASSERT(page.isValid()); m_columns = new KWDocumentColumns(this, m_page.pageStyle().columns()); KPageWidgetItem *columnsPage = addPage(m_columns, i18n("Columns")); QWidget *pageStyleWidget = new QWidget(this); QHBoxLayout *pageStyleLayout = new QHBoxLayout(pageStyleWidget); pageStyleLayout->setMargin(0); KPageWidgetItem *stylePage = addPage(pageStyleWidget, i18n("Style")); m_pageStylesView = new QListWidget(this); pageStyleLayout->addWidget(m_pageStylesView, 1); connect(m_pageStylesView, SIGNAL(currentRowChanged(int)), this, SLOT(pageStyleCurrentRowChanged(int))); QVBoxLayout *pageStyleLayout2 = new QVBoxLayout(); pageStyleLayout->addLayout(pageStyleLayout2); m_clonePageStyleButton = new QPushButton(i18n("Clone"), pageStyleWidget); connect(m_clonePageStyleButton, SIGNAL(clicked()), this, SLOT(pageStyleCloneClicked())); pageStyleLayout2->addWidget(m_clonePageStyleButton); m_deletePageStyleButton = new QPushButton(i18n("Delete"), pageStyleWidget); connect(m_deletePageStyleButton, SIGNAL(clicked()), this, SLOT(pageStyleDeleteClicked())); pageStyleLayout2->addWidget(m_deletePageStyleButton); pageStyleLayout2->addStretch(); foreach(KPageWidgetItem *item, QList<KPageWidgetItem*>() << columnsPage << stylePage) m_pages[item->name()] = item; reloadPageStyles(); showPageSpread(false); //TODO better would be allow n pages to face rather then only 2 showTextDirection(true); // TODO can we hide this in selected usecases? Use the resource manager bidi-check maybe? //showApplyToDocument(true); // TODO uncommand when we can handle it. #if 0 bool simpleSetup = m_document->pageCount() == 1 || (m_document->pageCount() == 2 && page.pageSide() == KWPage::PageSpread); if (!simpleSetup) { // if there is one style, its still a simple doc bool onlyOneStyle = true; foreach (const KWPage &p, m_document->pageManager()->pages()) { if (p.pageStyle() != m_page.pageStyle()) { onlyOneStyle = false; break; } } if (onlyOneStyle) simpleSetup = true; }
uint8_t diaFactoryRun(const char *title,uint32_t nb,diaElem **elems) { factoryWindow dialog; ADM_assert(title); ADM_assert(nb); ADM_assert(elems); dialog.setWindowTitle(QString::fromUtf8(title)); QGridLayout layout(&dialog); /* First compute the size of our window */ int vsize=0; for(int i=0;i<nb;i++) { ADM_assert(elems[i]); vsize+=elems[i]->getSize(); } int v=0; for(int i=0;i<nb;i++) { ADM_assert(elems[i]); elems[i]->setMe( (void *)&dialog,&layout,v); v+=elems[i]->getSize(); } for(int i=0;i<nb;i++) { ADM_assert(elems[i]); elems[i]->finalize(); } // Add buttons QDialogButtonBox buttonBox((QWidget *)&dialog); buttonBox.setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QObject::connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); layout.addWidget(&buttonBox,vsize,0); // run dialog.setLayout(&layout); if(dialog.exec()==QDialog::Accepted) { for(int i=0;i<nb;i++) { ADM_assert(elems[i]); elems[i]->getMe(); } return 1; } return 0; }
void ReportAssistantDialog::assistantFinished(bool showBack) { //The assistant finished: allow the user to close the dialog normally nextButton()->setEnabled(false); backButton()->setEnabled(showBack); finishButton()->setEnabled(true); buttonBox()->button(QDialogButtonBox::Cancel)->setEnabled(false); m_canClose = true; }
void MultiInputDialog::exec() { // Add some standard buttons (Cancel/Ok) at the bottom of the dialog QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); form->addRow(&buttonBox); QObject::connect(&buttonBox, SIGNAL(accepted()), this, SLOT(close())); QObject::connect(&buttonBox, SIGNAL(accepted()), this, SIGNAL(accepted())); QObject::connect(&buttonBox, SIGNAL(rejected()), this, SLOT(close())); QDialog::exec(); }
uint8_t diaFactoryRunTabs(const char *title,uint32_t nb,diaElemTabs **tabs) { factoryWindow dialog; ADM_assert(title); ADM_assert(nb); ADM_assert(tabs); dialog.setWindowTitle(QString::fromUtf8(title)); QGridLayout layout(&dialog); // Add tabs QTabWidget wtabs((QWidget *)&dialog); // Add buttons QDialogButtonBox buttonBox((QWidget *)&dialog); buttonBox.setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QObject::connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); for(int i=0;i<nb;i++) { ADM_assert(tabs[i]); insertTab(i,tabs[i],&wtabs); } layout.addWidget(&wtabs,0,0); layout.addWidget(&buttonBox,1,0); // run dialog.setLayout(&layout); if(dialog.exec()==QDialog::Accepted) { // Read tabs for(int tab=0;tab<nb;tab++) { ADM_assert(tabs[tab]); diaElemTabs *myTab=tabs[tab]; for(int i=0;i<myTab->nbElems;i++) { myTab->dias[i]->getMe(); } } return 1; } return 0; }
void QPhotorec::qphotorec_formats() { file_enable_t *file_enable; QStringList list; formats=new QListWidget(); for(file_enable=list_file_enable; file_enable->file_hint!=NULL; file_enable++) { QListWidgetItem * item; char descr[128]; sprintf(descr, "%-4s %s", (file_enable->file_hint->extension!=NULL? file_enable->file_hint->extension:""), file_enable->file_hint->description); item = new QListWidgetItem(descr, formats); if(file_enable->enable) item->setCheckState (Qt::Checked); else item->setCheckState (Qt::Unchecked); } QDialog fenetre3; fenetre3.setWindowTitle("QPhotoRec: "+tr("File Formats")); QDialogButtonBox buttonBox(Qt::Horizontal); QPushButton *bt_reset= new QPushButton(tr("&Reset")); QPushButton *bt_restore= new QPushButton(tr("Res&tore")); buttonBox.addButton(bt_reset, QDialogButtonBox::ResetRole); buttonBox.addButton(bt_restore, QDialogButtonBox::ResetRole); buttonBox.addButton(QDialogButtonBox::Ok); QVBoxLayout vbox; vbox.addWidget(formats); vbox.addWidget(&buttonBox); fenetre3.setLayout(&vbox); connect(&buttonBox, SIGNAL(accepted()), &fenetre3, SLOT(accept())); connect(bt_reset, SIGNAL(clicked()), this, SLOT(formats_reset())); connect(bt_restore, SIGNAL(clicked()), this, SLOT(formats_restore())); fenetre3.exec(); int i; for (i = 0, file_enable=list_file_enable; i < formats->count() && file_enable->file_hint!=NULL; i++, file_enable++) { QListWidgetItem *item = formats->item(i); file_enable->enable=(item->checkState()==Qt::Checked?1:0); } }
FloatEnvironmentDialog::FloatEnvironmentDialog(KConfig *config, KileInfo *ki, QWidget *parent) : Wizard(config, parent), m_ki(ki) { QWidget *page = new QWidget(this); QVBoxLayout *mainLayout = new QVBoxLayout; setLayout(mainLayout); mainLayout->addWidget(page); m_FloatDialog.setupUi(page); m_prefix = "fig:"; m_FloatDialog.m_edLabel->setText(m_prefix); slotEnvironmentClicked(); setFocusProxy(m_FloatDialog.m_edCaption); mainLayout->addWidget(buttonBox()); connect(buttonBox(), &QDialogButtonBox::accepted, this, &QDialog::accept); connect(buttonBox(), &QDialogButtonBox::rejected, this, &QDialog::reject); connect(m_FloatDialog.m_rbFigure, &QRadioButton::clicked, this, &FloatEnvironmentDialog::slotEnvironmentClicked); connect(m_FloatDialog.m_rbTable, &QRadioButton::clicked, this, &FloatEnvironmentDialog::slotEnvironmentClicked); connect(this, &QDialog::accepted, this, &FloatEnvironmentDialog::slotAccepted); }
KexiStartupDialog::KexiStartupDialog( int dialogType, int dialogOptions, KexiDBConnectionSet& connSet, QWidget *parent) : KPageDialog(parent) , d(new Private()) { d->connSet = &connSet; d->dialogType = dialogType; d->dialogOptions = dialogOptions; d->singlePage = dialogType == KexiStartupDialog::Templates || dialogType == KexiStartupDialog::OpenExisting; setFaceType(d->singlePage ? Plain : Tabbed); setWindowTitle(captionForDialogType(dialogType)); // buttons QPushButton *okButton = buttonBox()->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); if (dialogType == OpenExisting) {//this dialog has "open" tab only! setWindowIcon(koIcon("document-open")); } else { setWindowIcon(d->kexi_sqlite_icon); } setSizeGripEnabled(true); KPageWidgetItem *firstPage = 0; if (d->dialogType & Templates) { setupPageTemplates(); //d->pageTemplatesID = id++; d->templatesWidget->setFocus(); if (!firstPage) firstPage = d->pageTemplates; } if (d->dialogType & OpenExisting) { setupPageOpenExisting(); if (d->singlePage) d->openExistingConnWidget->setFocus(); if (!firstPage) firstPage = d->pageOpenExisting; } if (!d->singlePage) { connect(this, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)), this, SLOT(slotCurrentPageChanged(KPageWidgetItem*,KPageWidgetItem*))); d->templatesWidget->setFocus(); }
void QgsNewNameDialog::nameChanged() { QgsDebugMsg( "entered" ); QString namesString = tr( "Full names" ) + ": "; if ( !mExtensions.isEmpty() ) { mNamesLabel->setText( namesString ); } mErrorLabel->setText( " " ); // space to keep vertical space QPushButton* okButton = buttonBox()->button( QDialogButtonBox::Ok ); okButton->setText( mOkString ); okButton->setEnabled( true ); QString newName = name(); if ( newName.length() == 0 || ( !mRegexp.isEmpty() && !mRegexp.exactMatch( newName ) ) ) { //mErrorLabel->setText( highlightText( tr( "Enter new name" ) ); okButton->setEnabled( false ); return; } QStringList newNames = fullNames( newName, mExtensions ); if ( !mExtensions.isEmpty() ) { namesString += ' ' + newNames.join( ", " ); mNamesLabel->setText( namesString ); } QStringList conflicts = matching( newNames, mExiting, mCaseSensitivity ); if ( !conflicts.isEmpty() ) { QString warning = !mConflictingNameWarning.isEmpty() ? mConflictingNameWarning : tr( "%n Name(s) %1 exists", nullptr, conflicts.size() ).arg( conflicts.join( ", " ) ); mErrorLabel->setText( highlightText( warning ) ); if ( mOverwriteEnabled ) { okButton->setText( tr( "Overwrite" ) ); } else { okButton->setEnabled( false ); } return; } }
void UIHostNetworkManager::configureButtonBox() { /* Configure button-box: */ connect(widget(), &UIHostNetworkManagerWidget::sigHostNetworkDetailsVisibilityChanged, button(ButtonType_Apply), &QPushButton::setVisible); connect(widget(), &UIHostNetworkManagerWidget::sigHostNetworkDetailsVisibilityChanged, button(ButtonType_Reset), &QPushButton::setVisible); connect(widget(), &UIHostNetworkManagerWidget::sigHostNetworkDetailsDataChanged, button(ButtonType_Apply), &QPushButton::setEnabled); connect(widget(), &UIHostNetworkManagerWidget::sigHostNetworkDetailsDataChanged, button(ButtonType_Reset), &QPushButton::setEnabled); connect(buttonBox(), &QIDialogButtonBox::clicked, this, &UIHostNetworkManager::sltHandleButtonBoxClick); // WORKAROUND: // Since we connected signals later than extra-data loaded // for signals above, we should handle that stuff here again: button(ButtonType_Apply)->setVisible(gEDataManager->hostNetworkManagerDetailsExpanded()); button(ButtonType_Reset)->setVisible(gEDataManager->hostNetworkManagerDetailsExpanded()); }
//_________________________________________________________ ShadowDemoDialog::ShadowDemoDialog( QWidget* parent ): QDialog( parent ), _helper(), _cache( _helper ) { setWindowTitle( i18n( "Oxygen Shadow Demo" ) ); setupUi( this ); inactiveRoundWidget->setHelper( _helper ); inactiveSquareWidget->setHelper( _helper ); activeRoundWidget->setHelper( _helper ); activeSquareWidget->setHelper( _helper ); // reparse configuration reparseConfiguration(); // customize button box QList<QDialogButtonBox*> children( findChildren<QDialogButtonBox*>() ); if( !children.isEmpty() ) { QDialogButtonBox* buttonBox( children.front() ); _backgroundCheckBox = new QCheckBox( i18n( "Draw window background" ) ); _backgroundCheckBox->setChecked( true ); buttonBox->addButton( _backgroundCheckBox, QDialogButtonBox::ResetRole ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), inactiveRoundWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), inactiveSquareWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), activeRoundWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), activeSquareWidget, SLOT(toggleBackground(bool)) ); } // use DBus connection to update on oxygen configuration change QDBusConnection dbus = QDBusConnection::sessionBus(); dbus.connect( QString(), QStringLiteral( "/OxygenWindeco" ), QStringLiteral( "org.kde.Oxygen.Style" ), QStringLiteral( "reparseConfiguration" ), this, SLOT(reparseConfiguration()) ); }
//_________________________________________________________ ShadowDemoDialog::ShadowDemoDialog( QWidget* parent ): KDialog( parent ), _helper( "oxygen" ), _cache( _helper ) { setWindowTitle( i18n( "Oxygen Shadow Demo" ) ); setButtons( KDialog::Cancel|KDialog::Apply ); button( KDialog::Apply )->setText( i18n("Save") ); button( KDialog::Apply )->setIcon( KIcon("document-save-as") ); button( KDialog::Apply )->setToolTip( i18n( "Save shadows as pixmaps in provided directory" ) ); QWidget *mainWidget( new QWidget( this ) ); ui.setupUi( mainWidget ); setMainWidget( mainWidget ); ui.inactiveRoundWidget->setHelper( _helper ); ui.inactiveSquareWidget->setHelper( _helper ); ui.activeRoundWidget->setHelper( _helper ); ui.activeSquareWidget->setHelper( _helper ); // reparse configuration reparseConfiguration(); // customize button box QList<QDialogButtonBox*> children( findChildren<QDialogButtonBox*>() ); if( !children.isEmpty() ) { QDialogButtonBox* buttonBox( children.front() ); _backgroundCheckBox = new QCheckBox( i18n( "Draw window background" ) ); _backgroundCheckBox->setChecked( true ); buttonBox->addButton( _backgroundCheckBox, QDialogButtonBox::ResetRole ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.inactiveRoundWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.inactiveSquareWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.activeRoundWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.activeSquareWidget, SLOT(toggleBackground(bool)) ); }
void DataDialog::createGui() { buttonBox()->button(QDialogButtonBox::Apply)->setVisible(false); connect(this, SIGNAL(ok()), this, SLOT(slotOk())); QWidget *extension = extensionWidget(); QVBoxLayout *extensionLayout = new QVBoxLayout(extension); extensionLayout->setContentsMargins(0, -1, 0, -1); EditMultipleWidget *editMultipleWidget = new EditMultipleWidget(); extensionLayout->addWidget(editMultipleWidget); extension->setLayout(extensionLayout); QWidget *box = topCustomWidget(); QHBoxLayout *layout = new QHBoxLayout(box); layout->setContentsMargins(0, -1, 0, -1); QLabel *label = new QLabel(tr("Unique Name:"), box); _tagString = new QLineEdit(box); QPushButton *button = new QPushButton(tr("Edit Multiple >>")); connect(button, SIGNAL(clicked()), this, SLOT(slotEditMultiple())); if (_dataObject) { setTagString(_dataObject->tag().tagString()); // FIXME: should this be displayString()? } else { setTagString(tagString()); button->setVisible(false); } layout->addWidget(label); layout->addWidget(_tagString); layout->addWidget(button); box->setLayout(layout); }
} // Bring the command-line specified type to the front. if (get_conversation_by_proto_id(cli_proto_id)) { conv_protos.removeAll(cli_proto_id); conv_protos.prepend(cli_proto_id); } // QTabWidget selects the first item by default. foreach (int conv_proto, conv_protos) { addTrafficTable(get_conversation_by_proto_id(conv_proto)); } fillTypeMenu(conv_protos); QPushButton *close_bt = buttonBox()->button(QDialogButtonBox::Close); if (close_bt) { close_bt->setDefault(true); } updateWidgets(); // currentTabChanged(); cap_file_.delayedRetapPackets(); } ConversationDialog::~ConversationDialog() { prefs_clear_string_list(recent.conversation_tabs); recent.conversation_tabs = NULL;
void MachinesDialog::slotImportMachines() { std::vector<int> vm_selected; std::vector<int> vm_update; std::vector<int> vm_update_data; std::vector<int> vm_executing; std::vector<int> vm_executing_data; std::vector<int> vm_create; for(int i = 0; i < ui->treeWidget->topLevelItemCount(); i++) if(ui->treeWidget->topLevelItem(i)->checkState(0) == Qt::Checked) vm_selected.push_back(i); for(int i = 0; i < vm_selected.size(); i++) { bool existing_machine = false; for(int j = 0; j < vmTab_vec->size(); j++) { if(vmTab_vec->at(j)->getMachineUUID() == settings_header[vm_selected.at(i)].machine_uuid) { uint32_t machineState = vmTab_vec->at(j)->machine->getState(); if(machineState == MachineState::Running || machineState == MachineState::Paused || machineState == MachineState::Starting) { vm_executing.push_back(j); vm_executing_data.push_back(i); } else { vm_update.push_back(j); vm_update_data.push_back(i); } existing_machine = true; break; } } if(!existing_machine) vm_create.push_back(vm_selected.at(i)); } if(vm_create.size() > 0) { QDialog dialog(this); dialog.resize(500, 300); QVBoxLayout *verticalLayout = new QVBoxLayout(&dialog); QLabel label("Alcune macchine selezionate non esistono. Creare le seguenti macchine?", &dialog); QTreeWidget treeWidget(&dialog); QDialogButtonBox buttonBox(&dialog); buttonBox.setStandardButtons(QDialogButtonBox::Yes|QDialogButtonBox::No); verticalLayout->addWidget(&label); verticalLayout->addWidget(&treeWidget); verticalLayout->addWidget(&buttonBox); QStringList horizontalHeaderLabels = QString(HORIZONTAL_HEADERS).split(";"); treeWidget.setColumnCount(horizontalHeaderLabels.count()); treeWidget.setHeaderLabels(horizontalHeaderLabels); treeWidget.setSelectionMode(QAbstractItemView::NoSelection); for(int i = 0; i < vm_create.size(); i++) { QTreeWidgetItem *item = new QTreeWidgetItem(); // item->setCheckState(0, Qt::Unchecked); item->setText(0, QString("Macchina: ").append(settings_header[vm_create.at(i)].machine_name)); for(int iface_index = 0; iface_index < settings_header[vm_create.at(i)].settings_iface_size; iface_index++) { QTreeWidgetItem *childItem = new QTreeWidgetItem(item); childItem->setText(0, settings_ifaces[vm_create.at(i)][iface_index].name); childItem->setText(1, settings_ifaces[vm_create.at(i)][iface_index].mac); #ifdef CONFIGURABLE_IP childItem->setText(2, settings_ifaces[vm_create.at(i)][iface_index].ip); childItem->setText(3, settings_ifaces[vm_create.at(i)][iface_index].subnetMask); #endif } treeWidget.addTopLevelItem(item); treeWidget.header()->setResizeMode(QHeaderView::ResizeToContents); } connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); dialog.setLayout(verticalLayout); if(dialog.exec() == QDialog::Rejected) vm_create.clear(); } if(vm_executing.size() > 0) { QDialog dialog(this); dialog.resize(500, 300); QVBoxLayout *verticalLayout = new QVBoxLayout(&dialog); QLabel label(QString::fromUtf8("Non è possibile importare le impostazioni per le macchine in esecuzione.\nArrestare le macchine selezionate?"), &dialog); QTreeWidget treeWidget(&dialog); QDialogButtonBox buttonBox(&dialog); buttonBox.setStandardButtons(QDialogButtonBox::Yes|QDialogButtonBox::No); verticalLayout->addWidget(&label); verticalLayout->addWidget(&treeWidget); verticalLayout->addWidget(&buttonBox); QStringList horizontalHeaderLabels = QString(HORIZONTAL_HEADERS).split(";"); treeWidget.setColumnCount(horizontalHeaderLabels.count()); treeWidget.setHeaderLabels(horizontalHeaderLabels); treeWidget.setSelectionMode(QAbstractItemView::NoSelection); for(int i = 0; i < vm_executing.size(); i++) { uint32_t machineState = vmTab_vec->at(vm_executing.at(i))->machine->getState(); QTreeWidgetItem *item = new QTreeWidgetItem(); item->setCheckState(0, Qt::Checked); item->setText(0, QString("Macchina: ").append(vmTab_vec->at(vm_executing.at(i))->getMachineName())); for(int iface_index = 0; iface_index < settings_header[vm_executing_data.at(i)].settings_iface_size; iface_index++) { QTreeWidgetItem *childItem = new QTreeWidgetItem(item); childItem->setText(0, settings_ifaces[vm_executing_data.at(i)][iface_index].name); childItem->setText(1, settings_ifaces[vm_executing_data.at(i)][iface_index].mac); #ifdef CONFIGURABLE_IP childItem->setText(2, settings_ifaces[vm_executing_data.at(i)][iface_index].ip); childItem->setText(3, settings_ifaces[vm_executing_data.at(i)][iface_index].subnetMask); #endif } treeWidget.addTopLevelItem(item); treeWidget.header()->setResizeMode(QHeaderView::ResizeToContents); } connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); dialog.setLayout(verticalLayout); if(dialog.exec() != QDialog::Accepted) vm_executing.clear(); else { std::vector<int> vm_executing_temp; std::vector<int> vm_executing_data_temp; for(int i = 0; i < treeWidget.topLevelItemCount(); i++) if(treeWidget.topLevelItem(i)->checkState(0) == Qt::Checked) { vm_executing_temp.push_back(vm_executing.at(i)); vm_executing_data_temp.push_back(vm_executing_data.at(i)); } vm_executing = vm_executing_temp; vm_executing_data = vm_executing_data_temp; } } for(int i = 0; i < vm_executing.size(); i++) { uint32_t machineState = vmTab_vec->at(vm_executing.at(i))->machine->getState(); if(machineState == MachineState::Running || machineState == MachineState::Paused || machineState == MachineState::Starting) vmTab_vec->at(vm_executing.at(i))->machine->stop(true); if(!updateMachine(vmTab_vec->at(vm_executing.at(i)), settings_header[vm_executing_data.at(i)], settings_ifaces[vm_executing_data.at(i)])) { QMessageBox qm(QMessageBox::Critical, "Errore", QString("Errore durante l'aggiornamento della macchina ").append(settings_header[vm_executing_data.at(i)].machine_name), QMessageBox::StandardButton::Ok); qm.setPalette(palette()); qm.exec(); } } for(int i = 0; i < vm_update.size(); i++) if(!updateMachine(vmTab_vec->at(vm_update.at(i)), settings_header[vm_update_data.at(i)], settings_ifaces[vm_update_data.at(i)])) { QMessageBox qm(QMessageBox::Critical, "Errore", QString("Errore durante l'aggiornamento della macchina ").append(settings_header[vm_update_data.at(i)].machine_name), QMessageBox::StandardButton::Ok); qm.setPalette(palette()); qm.exec(); } for(int i = 0; i < vm_create.size(); i++) if(!createMachine(settings_header[vm_create.at(i)], settings_ifaces[vm_create.at(i)])) { QMessageBox qm(QMessageBox::Critical, "Errore", QString("Errore durante la creazione della macchina ").append(settings_header[vm_create.at(i)].machine_name), QMessageBox::StandardButton::Ok); qm.setPalette(palette()); qm.exec(); } close(); }
/** Displays Menu on the screen as overlay on top of another Perspective view */ void Menu::display() { if (isDisplayed) { glDisable(GL_LIGHTING); glDepthMask(GL_FALSE); glDisable(GL_DEPTH_TEST); glViewport(0, 0, window->getSize().x, window->getSize().y); glLoadIdentity(); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glOrtho(0.0f, window->getSize().x, window->getSize().y, 0.0f, -1000.f, 10000.0f); glMatrixMode(GL_MODELVIEW); // Draw background box with border around complete menu buttonBox(menuPosition, menuSize, colorBackDefault, 1000); unsigned counter = 0; // button counter // Draw box with border for each visible menu button for(unsigned i = 0; i < menuItems.size(); i++) { if (menuItems.at(i)._topMenuName == itemActivated) { // Draw button buttonBox( sf::Vector2f(menuPosition.x, menuButtonSize.y * counter + menuPosition.y), menuButtonSize, menuItems.at(i).colorDefaultBack, i ); // Add text to the button std::string text = menuItems.at(i).text; sf::Vector2i textSize = measureString(text, hFontMenu); textToScreen( hFontMenu, charListMenu, sf::Vector3f( menuPosition.x + (menuButtonSize.x - textSize.x) / 2, menuPosition.y + menuButtonSize.y * (counter + 1) / 2 + textSize.y * counter, 200.0f), colorTextDefault, "%s", text.c_str() ); // Icnrement button counter counter++; } } //# Item Activated will tell which menus need to be displayed i.e. display all submenus who's container is itemActivated // # Iterate over map items and display items for top name menu // # if itemActivated != topName iterate over map items and display items under the top name menu // # if itemActivated != any item under topName keep displaying sub items under these menus until reached itemActivated glMatrixMode(GL_PROJECTION); glPopMatrix(); glFlush(); glLineWidth(2); glDepthMask(GL_TRUE); glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); } }
int main() { //Structure held in game.h which holds the x and y dimensions of the field //and the sprite vector XY MainSprites; //sets initial number of squares in x an y dimensions MainSprites.xTotal=10; MainSprites.yTotal=20; //creates a font for debugging inside of the program sf::Font font; font.loadFromFile("arial.ttf"); sf::Text text; text.setFont(font); text.setCharacterSize(24); text.setColor(sf::Color::Red); text.setStyle(sf::Text::Bold | sf::Text::Underlined); //Vector of two points to hold the current mouse cursor position sf::Vector2f mousePos; //Texture used for the backround tile sprites sf::Texture backgroundTile; backgroundTile.loadFromFile("tile50x50.jpg"); sf::RenderWindow window; std::vector<sf::VideoMode> modes = sf::VideoMode::getFullscreenModes(); //Create Window with the first element of the modes vector, which holds optimal res, also set to fullscreen window.create(sf::VideoMode(modes[0]), "DNDGame",sf::Style::Fullscreen); MainSprites.view.setSize(sf::Vector2f(float(modes[0].width*.75),float(modes[0].height))); MainSprites.view.setCenter(sf::Vector2f(float(modes[0].width/2),float(modes[0].height/2))); int spriteSelected=0; sf::RectangleShape selectRect; //Create a sprite object and populate array with the Sprites while setting the position and texture of //each sprite sf::Sprite sprite; for (int i=0;i<MainSprites.xTotal*MainSprites.yTotal;i++){ MainSprites.sprites.push_back(sprite); MainSprites.sprites[i].setTexture(backgroundTile); MainSprites.sprites[i].setPosition(sf::Vector2f(float(50*(i%MainSprites.xTotal)),(i%MainSprites.xTotal==0)?float(i/MainSprites.xTotal*50):float(std::floor(i/MainSprites.xTotal)*50))); } //Creates three gui objects, two inputs for the x and y dimensions of the playing field and a button object //to tell when to lock in the entered values tgui::Gui gui(window); gui.setGlobalFont(font); tgui::EditBox::Ptr xBox(gui, "X Cells"); tgui::EditBox::Ptr yBox(gui, "Y Cells"); tgui::Button::Ptr buttonBox(gui,"Return Box"); xBox->load("TGUI/widgets/Babyblue.conf"); yBox->load("TGUI/widgets/Babyblue.conf"); buttonBox->load("TGUI/widgets/Babyblue.conf"); xBox->setSize(400, 40); yBox->setSize(400, 40); xBox->setPosition(float(modes[0].width-400), 0.0); yBox->setPosition(float(modes[0].width-400), 50.0); buttonBox->setPosition(float(modes[0].width-400), 100.0); buttonBox->bindCallback(tgui::Button::LeftMouseClicked); buttonBox->setCallbackId(1); buttonBox->setText("Finish"); //Set to true to exit main loop bool exit=false; while (window.isOpen() && exit==false){ //Calls the drawGui function held in ViewGui.cpp, handles panning MainSprites=drawGui(MainSprites); sf::Event event; while (window.pollEvent(event)){ if (event.type == sf::Event::Closed) window.close(); // Pass the event to all gui widgets gui.handleEvent(event); } tgui::Callback callback; while (gui.pollCallback(callback)){ // Make sure tha callback comes from the button if (callback.id == 1){ tgui::EditBox::Ptr xCells = gui.get("X Cells"); tgui::EditBox::Ptr yCells = gui.get("Y Cells"); //store the input text and convert to ints to pass to x,y dimensions sf::String xNums = xCells->getText(); sf::String yNums = yCells->getText(); MainSprites.xTotal=std::stoi(xNums.toWideString()); MainSprites.yTotal=std::stoi(yNums.toWideString()); //clear the sprite array, then repopulate if new map boundries are set MainSprites.sprites.clear(); for (int i=0;i<MainSprites.xTotal*MainSprites.yTotal;i++){ MainSprites.sprites.push_back(sprite); MainSprites.sprites[i].setTexture(backgroundTile); MainSprites.sprites[i].setPosition(sf::Vector2f(float(50*(i%MainSprites.xTotal)),(i%MainSprites.xTotal==0)?float(i/MainSprites.xTotal*50):float(std::floor(i/MainSprites.xTotal)*50))); } } } //if escape is pressed, exit the main loop if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)){ exit=true; } if(sf::Mouse::isButtonPressed(sf::Mouse::Button::Left)){ //std::cout<<sf::Mouse::getPosition().y<<std::endl; mousePos=sf::Vector2f(sf::Mouse::getPosition()); //std::cout<<mousePos.y<<std::endl; spriteSelected=selectSprite(MainSprites,window.mapPixelToCoords(sf::Mouse::getPosition(window))); text.setString(std::to_string(mousePos.x)); } selectRect.setSize(sf::Vector2f(50.0,50.0)); selectRect.setPosition(MainSprites.sprites[spriteSelected].getPosition()); selectRect.setOutlineColor(sf::Color::Green); selectRect.setOutlineThickness(2.0); selectRect.setFillColor(sf::Color::Transparent); //Clear the window for drawing, draw the sprites, draw the gui on top of it, set the view, and then display window.clear(); for(unsigned int i=0;i<MainSprites.sprites.size();i++){ window.draw(MainSprites.sprites[i]); } window.draw(selectRect); gui.draw(); window.setView(MainSprites.view); window.display(); } return 0; }