本文整理汇总了C++中dialog函数的典型用法代码示例。如果您正苦于以下问题:C++ dialog函数的具体用法?C++ dialog怎么用?C++ dialog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dialog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dialog
void MainWindow::openDeleteCategory(){
deleteCategoryDialog dialog(this, m_database);
dialog.exec();
ui->comboBox_categorie->clear();
this->genrateCategorie();
}
示例2: dialog
void MainWindow::open()
{
FindFileDialog dialog(textViewer, assistant);
dialog.exec();
}
示例3: m
void NoteCanvas::menu(const QPoint&) {
Q3PopupMenu m(0);
Q3PopupMenu fontsubm(0);
m.insertItem(new MenuTitle(TR("Note"), m.font()), -1);
m.insertSeparator();
m.insertItem(TR("Upper"), 0);
m.insertItem(TR("Lower"), 1);
m.insertItem(TR("Go up"), 7);
m.insertItem(TR("Go down"), 8);
m.insertSeparator();
m.insertItem(TR("Edit"), 2);
m.insertSeparator();
m.insertItem(TR("Color of text"), 6);
m.insertItem(TR("Font"), &fontsubm);
init_font_menu(fontsubm, the_canvas(), 10);
m.insertItem(TR("Edit drawing settings"), 3);
if (linked()) {
m.insertSeparator();
m.insertItem(TR("Select linked items"), 4);
}
m.insertSeparator();
m.insertItem(TR("Remove from diagram"),5);
int index = m.exec(QCursor::pos());
switch (index) {
case 0:
upper();
modified(); // call package_modified()
return;
case 1:
lower();
modified(); // call package_modified()
return;
case 7:
z_up();
modified(); // call package_modified()
return;
case 8:
z_down();
modified(); // call package_modified()
return;
case 2:
open();
// modified then package_modified already called
return;
case 3:
edit_drawing_settings();
return;
case 4:
the_canvas()->unselect_all();
select_associated();
return;
case 5:
delete_it();
break;
case 6:
for (;;) {
ColorSpecVector co(1);
co[0].set(TR("color"), &fg_c);
SettingsDialog dialog(0, &co, TRUE, FALSE,
TR("Text color dialog"));
dialog.raise();
if (dialog.exec() != QDialog::Accepted)
return;
// force son reaffichage
hide();
show();
canvas()->update();
if (!dialog.redo())
break;
else
package_modified();
}
break;
default:
if (index >= 10) {
itsfont = (UmlFont) (index - 10);
modified();
}
return;
}
package_modified();
}
示例4: dialog
bool EditConfigWindow::editParameter(ConfigMap::Parameter& parameter)
{
EditParameterDialog dialog(parameter, this);
return dialog.exec() == 1;
}
示例5: WXUNUSED
void CGameListCtrl::OnCompressGCM(wxCommandEvent& WXUNUSED (event))
{
const GameListItem *iso = GetSelectedISO();
if (!iso)
return;
wxString path;
std::string FileName, FilePath, FileExtension;
SplitPath(iso->GetFileName(), &FilePath, &FileName, &FileExtension);
do
{
if (iso->IsCompressed())
{
wxString FileType;
if (iso->GetPlatform() == GameListItem::WII_DISC)
FileType = _("All Wii ISO files (iso)") + "|*.iso";
else
FileType = _("All GameCube GCM files (gcm)") + "|*.gcm";
path = wxFileSelector(
_("Save decompressed GCM/ISO"),
StrToWxStr(FilePath),
StrToWxStr(FileName) + FileType.After('*'),
wxEmptyString,
FileType + "|" + wxGetTranslation(wxALL_FILES),
wxFD_SAVE,
this);
}
else
{
path = wxFileSelector(
_("Save compressed GCM/ISO"),
StrToWxStr(FilePath),
StrToWxStr(FileName) + ".gcz",
wxEmptyString,
_("All compressed GC/Wii ISO files (gcz)") +
wxString::Format("|*.gcz|%s", wxGetTranslation(wxALL_FILES)),
wxFD_SAVE,
this);
}
if (!path)
return;
} while (wxFileExists(path) &&
wxMessageBox(
wxString::Format(_("The file %s already exists.\nDo you wish to replace it?"), path.c_str()),
_("Confirm File Overwrite"),
wxYES_NO) == wxNO);
bool all_good = false;
{
wxProgressDialog dialog(
iso->IsCompressed() ? _("Decompressing ISO") : _("Compressing ISO"),
_("Working..."),
1000,
this,
wxPD_APP_MODAL |
wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME |
wxPD_SMOOTH
);
if (iso->IsCompressed())
all_good = DiscIO::DecompressBlobToFile(iso->GetFileName(),
WxStrToStr(path), &CompressCB, &dialog);
else
all_good = DiscIO::CompressFileToBlob(iso->GetFileName(),
WxStrToStr(path),
(iso->GetPlatform() == GameListItem::WII_DISC) ? 1 : 0,
16384, &CompressCB, &dialog);
}
if (!all_good)
WxUtils::ShowErrorDialog(_("Dolphin was unable to complete the requested action."));
Update();
}
示例6: wxPanel
//.........这里部分代码省略.........
m_reflector->SetSelection(0);
} else {
wxString name = reflector;
name.SetChar(LONG_CALLSIGN_LENGTH - 1U, wxT(' '));
bool res = m_reflector->SetStringSelection(name);
if (!res)
m_reflector->SetSelection(0);
}
m_channel = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1));
m_channel->Append(wxT("A"));
m_channel->Append(wxT("B"));
m_channel->Append(wxT("C"));
m_channel->Append(wxT("D"));
m_channel->Append(wxT("E"));
m_channel->Append(wxT("F"));
m_channel->Append(wxT("G"));
m_channel->Append(wxT("H"));
m_channel->Append(wxT("I"));
m_channel->Append(wxT("J"));
m_channel->Append(wxT("K"));
m_channel->Append(wxT("L"));
m_channel->Append(wxT("M"));
m_channel->Append(wxT("N"));
m_channel->Append(wxT("O"));
m_channel->Append(wxT("P"));
m_channel->Append(wxT("Q"));
m_channel->Append(wxT("R"));
m_channel->Append(wxT("S"));
m_channel->Append(wxT("T"));
m_channel->Append(wxT("U"));
m_channel->Append(wxT("V"));
m_channel->Append(wxT("W"));
m_channel->Append(wxT("X"));
m_channel->Append(wxT("Y"));
m_channel->Append(wxT("Z"));
sizer->Add(m_channel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
res = m_channel->SetStringSelection(reflector.Right(1U));
if (!res)
m_channel->SetSelection(0);
#endif
SetAutoLayout(true);
SetSizer(sizer);
}
CStarNetSet::~CStarNetSet()
{
}
bool CStarNetSet::Validate()
{
int n = m_band->GetCurrentSelection();
if (n == wxNOT_FOUND) {
wxMessageDialog dialog(this, _("The StarNet Band is not set"), m_title + _(" Error"), wxICON_ERROR);
dialog.ShowModal();
return false;
}
n = m_userTimeout->GetCurrentSelection();
if (n == wxNOT_FOUND) {
wxMessageDialog dialog(this, _("The StarNet user timeout is not set"), m_title + _(" Error"), wxICON_ERROR);
dialog.ShowModal();
return false;
}
n = m_groupTimeout->GetCurrentSelection();
if (n == wxNOT_FOUND) {
wxMessageDialog dialog(this, _("The StarNet group timeout is not set"), m_title + _(" Error"), wxICON_ERROR);
dialog.ShowModal();
return false;
}
n = m_callsignSwitch->GetCurrentSelection();
if (n == wxNOT_FOUND) {
wxMessageDialog dialog(this, _("The MYCALL Setting is not set"), m_title + _(" Error"), wxICON_ERROR);
dialog.ShowModal();
return false;
}
n = m_txMsgSwitch->GetCurrentSelection();
if (n == wxNOT_FOUND) {
wxMessageDialog dialog(this, _("The TX Message switch is not set"), m_title + _(" Error"), wxICON_ERROR);
dialog.ShowModal();
return false;
}
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
n = m_reflector->GetCurrentSelection();
if (n == wxNOT_FOUND) {
wxMessageDialog dialog(this, _("The StarNet reflector link is not set"), m_title + _(" Error"), wxICON_ERROR);
dialog.ShowModal();
return false;
}
#endif
return true;
}
示例7: dialog
// }}}
// {{{ void MainFrame::OnPreferences(wxCommandEvent &event)
void MainFrame::OnPreferences(wxCommandEvent &event) {
PrefDialog dialog(this, -1, _("Preferences"));
dialog.ShowModal();
}
示例8: portableIniFile
// Portable installations are assumed to be run in either administrator rights mode, or run
// from "insecure media" such as a removable flash drive. In these cases, the default path for
// PCSX2 user documents becomes ".", which is the current working directory.
//
// Portable installation mode is typically enabled via the presence of an INI file in the
// same directory that PCSX2 is installed to.
//
wxConfigBase* Pcsx2App::TestForPortableInstall()
{
InstallationMode = InstallMode_Registered;
const wxFileName portableIniFile( GetPortableIniPath() );
const wxDirName portableDocsFolder( portableIniFile.GetPath() );
if (Startup.PortableMode || portableIniFile.FileExists())
{
wxString FilenameStr = portableIniFile.GetFullPath();
if (Startup.PortableMode)
Console.WriteLn( L"(UserMode) Portable mode requested via commandline switch!" );
else
Console.WriteLn( L"(UserMode) Found portable install ini @ %s", WX_STR(FilenameStr) );
// Just because the portable ini file exists doesn't mean we can actually run in portable
// mode. In order to determine our read/write permissions to the PCSX2, we must try to
// modify the configured documents folder, and catch any ensuing error.
std::unique_ptr<wxFileConfig> conf_portable( OpenFileConfig( portableIniFile.GetFullPath() ) );
conf_portable->SetRecordDefaults(false);
while( true )
{
wxString accessFailedStr, createFailedStr;
if (TestUserPermissionsRights( portableDocsFolder, createFailedStr, accessFailedStr )) break;
wxDialogWithHelpers dialog( NULL, AddAppName(_("Portable mode error - %s")) );
wxTextCtrl* scrollText = new wxTextCtrl(
&dialog, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_READONLY | wxTE_MULTILINE | wxTE_WORDWRAP
);
if (!createFailedStr.IsEmpty())
scrollText->AppendText( createFailedStr + L"\n" );
if (!accessFailedStr.IsEmpty())
scrollText->AppendText( accessFailedStr + L"\n" );
dialog += dialog.Heading( _("PCSX2 has been installed as a portable application but cannot run due to the following errors:" ) );
dialog += scrollText | pxExpand.Border(wxALL, 16);
dialog += 6;
dialog += dialog.Text( GetMsg_PortableModeRights() );
// [TODO] : Add url for platform-relevant user permissions tutorials? (low priority)
wxWindowID result = pxIssueConfirmation( dialog,
MsgButtons().Retry().Cancel().Custom(_("Switch to User Documents Mode"), "switchmode")
);
switch (result)
{
case wxID_CANCEL:
throw Exception::StartupAborted( L"User canceled portable mode due to insufficient user access/permissions." );
case wxID_RETRY:
// do nothing (continues while loop)
break;
case pxID_CUSTOM:
wxDialogWithHelpers dialog2( NULL, AddAppName(_("%s is switching to local install mode.")) );
dialog2 += dialog2.Heading( _("Try to remove the file called \"portable.ini\" from your installation directory manually." ) );
dialog2 += 6;
pxIssueConfirmation( dialog2, MsgButtons().OK() );
return NULL;
}
}
// Success -- all user-based folders have write access. PCSX2 should be able to run error-free!
// Force-set the custom documents mode, and set the
InstallationMode = InstallMode_Portable;
DocsFolderMode = DocsFolder_Custom;
CustomDocumentsFolder = portableDocsFolder;
return conf_portable.release();
}
return NULL;
}
示例9: dialog
void CloudView::showServerStatusDialog()
{
ServerStatusDialog dialog(this);
dialog.exec();
}
示例10: dialog
void MainWindow::on_actionAbout_triggered()
{
std::unique_ptr<AboutDialog> dialog(new AboutDialog(this));
dialog->exec();
}
示例11: getKnob
void
KnobGui::linkTo(int dimension)
{
KnobPtr thisKnob = getKnob();
assert(thisKnob);
EffectInstance* isEffect = dynamic_cast<EffectInstance*>(thisKnob->getHolder());
if (!isEffect) {
return;
}
for (int i = 0; i < thisKnob->getDimension(); ++i) {
if (i == dimension || dimension == -1) {
std::string expr = thisKnob->getExpression(dimension);
if (!expr.empty()) {
Dialogs::errorDialog(tr("Param Link").toStdString(),tr("This parameter already has an expression set, edit or clear it.").toStdString());
return;
}
}
}
LinkToKnobDialog dialog( shared_from_this(),_imp->copyRightClickMenu->parentWidget() );
if ( dialog.exec() ) {
KnobPtr otherKnob = dialog.getSelectedKnobs();
if (otherKnob) {
if ( !thisKnob->isTypeCompatible(otherKnob) ) {
Dialogs::errorDialog( tr("Param Link").toStdString(), tr("Types incompatibles!").toStdString() );
return;
}
for (int i = 0; i < thisKnob->getDimension(); ++i) {
std::pair<int,KnobPtr > existingLink = thisKnob->getMaster(i);
if (existingLink.second) {
std::string err( tr("Cannot link ").toStdString() );
err.append( thisKnob->getLabel() );
err.append( " \n " + tr("because the knob is already linked to ").toStdString() );
err.append( existingLink.second->getLabel() );
Dialogs::errorDialog(tr("Param Link").toStdString(), err);
return;
}
}
EffectInstance* otherEffect = dynamic_cast<EffectInstance*>(otherKnob->getHolder());
if (!otherEffect) {
return;
}
std::stringstream expr;
boost::shared_ptr<NodeCollection> thisCollection = isEffect->getNode()->getGroup();
NodeGroup* otherIsGroup = dynamic_cast<NodeGroup*>(otherEffect);
if (otherIsGroup == thisCollection.get()) {
expr << "thisGroup"; // make expression generic if possible
} else {
expr << otherEffect->getNode()->getFullyQualifiedName();
}
expr << "." << otherKnob->getName() << ".get()";
if (otherKnob->getDimension() > 1) {
expr << "[dimension]";
}
thisKnob->beginChanges();
for (int i = 0; i < thisKnob->getDimension(); ++i) {
if (i == dimension || dimension == -1) {
thisKnob->setExpression(i, expr.str(), false, false);
}
}
thisKnob->endChanges();
thisKnob->getHolder()->getApp()->triggerAutoSave();
}
}
}
示例12: beforeBrowsing
void PathChooser::slotBrowse()
{
emit beforeBrowsing();
QString predefined = path();
if ((predefined.isEmpty() || !QFileInfo(predefined).isDir())
&& !m_d->m_initialBrowsePathOverride.isNull()) {
predefined = m_d->m_initialBrowsePathOverride;
if (!QFileInfo(predefined).isDir())
predefined.clear();
}
// Prompt for a file/dir
QString newPath;
switch (m_d->m_acceptingKind) {
case PathChooser::Directory:
case PathChooser::ExistingDirectory:
newPath = QFileDialog::getExistingDirectory(this,
makeDialogTitle(tr("Choose Directory")), predefined);
break;
case PathChooser::ExistingCommand:
case PathChooser::Command:
newPath = QFileDialog::getOpenFileName(this,
makeDialogTitle(tr("Choose Executable")), predefined,
m_d->m_dialogFilter);
break;
case PathChooser::File: // fall through
newPath = QFileDialog::getOpenFileName(this,
makeDialogTitle(tr("Choose File")), predefined,
m_d->m_dialogFilter);
break;
case PathChooser::Any: {
QFileDialog dialog(this);
dialog.setFileMode(QFileDialog::AnyFile);
dialog.setWindowTitle(makeDialogTitle(tr("Choose File")));
QFileInfo fi(predefined);
if (fi.exists())
dialog.setDirectory(fi.absolutePath());
// FIXME: fix QFileDialog so that it filters properly: lib*.a
dialog.setNameFilter(m_d->m_dialogFilter);
if (dialog.exec() == QDialog::Accepted) {
// probably loop here until the *.framework dir match
QStringList paths = dialog.selectedFiles();
if (!paths.isEmpty())
newPath = paths.at(0);
}
break;
}
default:
break;
}
// Delete trailing slashes unless it is "/"|"\\", only
if (!newPath.isEmpty()) {
newPath = QDir::toNativeSeparators(newPath);
if (newPath.size() > 1 && newPath.endsWith(QDir::separator()))
newPath.truncate(newPath.size() - 1);
setPath(newPath);
}
emit browsingFinished();
m_d->m_lineEdit->triggerChanged();
}
示例13: printer
void PharmacyReceipt::on_printButton_clicked()
{
QPrinter printer( QPrinter::PrinterResolution );
QPrintDialog dialog( &printer, this );
if ( dialog.exec() == QDialog::Accepted ) print( &printer );
}
示例14: WXUNUSED
void MyFrame::OnTestDialog(wxCommandEvent& WXUNUSED(event))
{
MyDialog dialog( wxT("Test") );
dialog.ShowModal();
}
示例15: LOG
void IECommandExecutor::DispatchCommand() {
LOG(TRACE) << "Entering IECommandExecutor::DispatchCommand";
Response response(this->session_id_);
CommandHandlerMap::const_iterator found_iterator =
this->command_handlers_.find(this->current_command_.command_type());
if (found_iterator == this->command_handlers_.end()) {
LOG(WARN) << "Unable to find command handler for " << this->current_command_.command_type();
response.SetErrorResponse(501, "Command not implemented");
} else {
BrowserHandle browser;
int status_code = SUCCESS;
if (this->current_command_.command_type() != webdriver::CommandType::NewSession) {
// There should never be a modal dialog or alert to check for if the command
// is the "newSession" command.
status_code = this->GetCurrentBrowser(&browser);
if (status_code == SUCCESS) {
bool alert_is_active = false;
HWND alert_handle = browser->GetActiveDialogWindowHandle();
if (alert_handle != NULL) {
// Found a window handle, make sure it's an actual alert,
// and not a showModalDialog() window.
vector<char> window_class_name(34);
::GetClassNameA(alert_handle, &window_class_name[0], 34);
if (strcmp(ALERT_WINDOW_CLASS, &window_class_name[0]) == 0) {
alert_is_active = true;
} else {
LOG(WARN) << "Found alert handle does not have a window class consistent with an alert";
}
} else {
LOG(DEBUG) << "No alert handle is found";
}
if (alert_is_active) {
Alert dialog(browser, alert_handle);
std::string command_type = this->current_command_.command_type();
if (command_type == webdriver::CommandType::GetAlertText ||
command_type == webdriver::CommandType::SendKeysToAlert ||
command_type == webdriver::CommandType::AcceptAlert ||
command_type == webdriver::CommandType::DismissAlert) {
LOG(DEBUG) << "Alert is detected, and the sent command is valid";
} else {
LOG(DEBUG) << "Unexpected alert is detected, and the sent command is invalid when an alert is present";
std::string alert_text = dialog.GetText();
if (this->unexpected_alert_behavior_ == ACCEPT_UNEXPECTED_ALERTS) {
LOG(DEBUG) << "Automatically accepting the alert";
dialog.Accept();
} else if (this->unexpected_alert_behavior_ == DISMISS_UNEXPECTED_ALERTS || command_type == webdriver::CommandType::Quit) {
// If a quit command was issued, we should not ignore an unhandled
// alert, even if the alert behavior is set to "ignore".
LOG(DEBUG) << "Automatically dismissing the alert";
if (dialog.is_standard_alert()) {
dialog.Dismiss();
} else {
// The dialog was non-standard. The most common case of this is
// an onBeforeUnload dialog, which must be accepted to continue.
dialog.Accept();
}
}
if (command_type != webdriver::CommandType::Quit) {
// To keep pace with what Firefox does, we'll return the text of the
// alert in the error response.
Json::Value response_value;
response_value["message"] = "Modal dialog present";
response_value["alert"]["text"] = alert_text;
response.SetResponse(EMODALDIALOGOPENED, response_value);
this->serialized_response_ = response.Serialize();
return;
} else {
LOG(DEBUG) << "Quit command was issued. Continuing with command after automatically closing alert.";
}
}
}
} else {
LOG(WARN) << "Unable to find current browser";
}
}
CommandHandlerHandle command_handler = found_iterator->second;
command_handler->Execute(*this, this->current_command_, &response);
status_code = this->GetCurrentBrowser(&browser);
if (status_code == SUCCESS) {
this->is_waiting_ = browser->wait_required();
if (this->is_waiting_) {
if (this->page_load_timeout_ >= 0) {
this->wait_timeout_ = clock() + (this->page_load_timeout_ / 1000 * CLOCKS_PER_SEC);
}
::PostMessage(this->m_hWnd, WD_WAIT, NULL, NULL);
}
} else {
if (this->current_command_.command_type() != webdriver::CommandType::Quit) {
LOG(WARN) << "Unable to get current browser";
}
}
}
this->serialized_response_ = response.Serialize();
}