本文整理汇总了C++中wxWizardExEvent::Veto方法的典型用法代码示例。如果您正苦于以下问题:C++ wxWizardExEvent::Veto方法的具体用法?C++ wxWizardExEvent::Veto怎么用?C++ wxWizardExEvent::Veto使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxWizardExEvent
的用法示例。
在下文中一共展示了wxWizardExEvent::Veto方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _ProcessCancelEvent
void CWizardAttach::_ProcessCancelEvent( wxWizardExEvent& event ) {
bool bCancelWithoutNextPage = false;
wxWizardPageEx* page = GetCurrentPage();
int iRetVal = wxGetApp().SafeMessageBox(
_("Do you really want to cancel?"),
_("Question"),
wxICON_QUESTION | wxYES_NO,
this
);
// Reenable the next and back buttons if they have been disabled
GetNextButton()->Enable();
GetBackButton()->Enable();
// Page specific rules - Disable the validator(s)
if (wxYES == iRetVal) {
if ((page == m_ProjectInfoPage) || (page == m_AccountManagerInfoPage)) {
m_ProjectInfoPage->m_pProjectUrlCtrl->SetValidator(wxDefaultValidator);
} else if (page == m_AccountInfoPage) {
m_AccountInfoPage->m_pAccountEmailAddressCtrl->SetValidator(wxDefaultValidator);
m_AccountInfoPage->m_pAccountPasswordCtrl->SetValidator(wxDefaultValidator);
if (IsAttachToProjectWizard) {
m_AccountInfoPage->m_pAccountConfirmPasswordCtrl->SetValidator(wxDefaultValidator);
}
} else if (page == m_ErrProxyPage) {
m_ErrProxyPage->m_pProxyHTTPServerCtrl->SetValidator(wxDefaultValidator);
m_ErrProxyPage->m_pProxyHTTPPortCtrl->SetValidator(wxDefaultValidator);
m_ErrProxyPage->m_pProxyHTTPUsernameCtrl->SetValidator(wxDefaultValidator);
m_ErrProxyPage->m_pProxyHTTPPasswordCtrl->SetValidator(wxDefaultValidator);
m_ErrProxyPage->m_pProxySOCKSServerCtrl->SetValidator(wxDefaultValidator);
m_ErrProxyPage->m_pProxySOCKSPortCtrl->SetValidator(wxDefaultValidator);
m_ErrProxyPage->m_pProxySOCKSUsernameCtrl->SetValidator(wxDefaultValidator);
m_ErrProxyPage->m_pProxySOCKSPasswordCtrl->SetValidator(wxDefaultValidator);
}
}
// Generic rules
bCancelWithoutNextPage |= (page == m_ErrNotDetectedPage);
bCancelWithoutNextPage |= (page == m_ErrUnavailablePage);
bCancelWithoutNextPage |= (page == m_ErrNoInternetConnectionPage);
if (IsAttachToProjectWizard) {
bCancelWithoutNextPage |= (page == m_ErrAlreadyExistsPage);
} else {
bCancelWithoutNextPage |= (page == m_WelcomePage);
}
if (wxYES != iRetVal) {
event.Veto();
}
}
示例2: _ProcessCancelEvent
void CWizardAttach::_ProcessCancelEvent( wxWizardExEvent& event ) {
bool bCancelWithoutNextPage = false;
wxWizardPageEx* page = GetCurrentPage();
m_bCancelInProgress = true;
int iRetVal = wxGetApp().SafeMessageBox(
_("Do you really want to cancel?"),
_("Question"),
wxICON_QUESTION | wxYES_NO,
this
);
// Reenable the next and back buttons if they have been disabled
GetNextButton()->Enable();
GetBackButton()->Enable();
// Generic rules
bCancelWithoutNextPage |= (page == m_ErrNotDetectedPage);
bCancelWithoutNextPage |= (page == m_ErrUnavailablePage);
bCancelWithoutNextPage |= (page == m_ErrNoInternetConnectionPage);
if (IsAttachToProjectWizard) {
bCancelWithoutNextPage |= (page == m_ErrAlreadyExistsPage);
} else {
bCancelWithoutNextPage |= (page == m_ProjectWelcomePage);
}
if (wxYES != iRetVal) {
event.Veto();
m_bCancelInProgress = false;
} else {
m_bCancelInProgress = true;
}
}
示例3: OnPageChanging
void CAccountInfoPage::OnPageChanging( wxWizardExEvent& event ) {
if (event.GetDirection() == false) return;
CWizardAttach* pWA = ((CWizardAttach*)GetParent());
PROJECT_CONFIG& pc = pWA->project_config;
wxString strTitle;
wxString strMessage = wxT("");
bool bDisplayError = false;
wxString strBaseConfigLocation = wxString(wxT("/Wizards"));
wxConfigBase* pConfig = wxConfigBase::Get(FALSE);
if (!CHECK_CLOSINGINPROGRESS()) {
// We are leaving this page, so store the email address for future
// use.
pConfig->SetPath(strBaseConfigLocation);
pConfig->Write(wxT("DefaultEmailAddress"), m_strAccountEmailAddress);
pConfig->Write(wxT("DefaultUsername"), m_strAccountUsername);
pConfig->Flush();
// Construct potiental dialog title
if (IS_ATTACHTOPROJECTWIZARD()) {
strTitle = _("Add project");
} else if (IS_ACCOUNTMANAGERWIZARD() && IS_ACCOUNTMANAGERUPDATEWIZARD()) {
strTitle = _("Update account manager");
} else if (IS_ACCOUNTMANAGERWIZARD()) {
strTitle = _("Use account manager");
}
// Verify minimum username length
if (!m_pAccountUseExistingCtrl->GetValue()) {
if (!(m_pAccountPasswordCtrl->GetValue().Length() > 0)) {
if (pc.uses_username) {
if (IS_ATTACHTOPROJECTWIZARD()) {
strMessage.Printf(
_("The minimum username length for this project is 1. Please enter a different username.")
);
}
if (IS_ACCOUNTMANAGERWIZARD()) {
strMessage.Printf(
_("The minimum username length for this account manager is 1. Please enter a different username.")
);
}
} else {
if (IS_ATTACHTOPROJECTWIZARD()) {
strMessage.Printf(
_("The minimum email address length for this project is 1. Please enter a different email address.")
);
}
if (IS_ACCOUNTMANAGERWIZARD()) {
strMessage.Printf(
_("The minimum email address length for this account manager is 1. Please enter a different email address.")
);
}
}
bDisplayError = true;
}
}
// Verify minimum password length
if (!m_pAccountUseExistingCtrl->GetValue()) {
if (m_pAccountPasswordCtrl->GetValue().Length() < (size_t)pc.min_passwd_length) {
if (IS_ATTACHTOPROJECTWIZARD()) {
strMessage.Printf(
_("The minimum password length for this project is %d. Please enter a different password."),
pc.min_passwd_length
);
}
if (IS_ACCOUNTMANAGERWIZARD()) {
strMessage.Printf(
_("The minimum password length for this account manager is %d. Please enter a different password."),
pc.min_passwd_length
);
}
bDisplayError = true;
}
}
// Verify that the password and confirmation password math.
if (!IS_ACCOUNTMANAGERWIZARD() && m_pAccountCreateCtrl->GetValue()) {
if (m_pAccountPasswordCtrl->GetValue() != m_pAccountConfirmPasswordCtrl->GetValue()) {
strMessage = _("The password and confirmation password do not match. Please type them again.");
bDisplayError = true;
}
}
if (bDisplayError) {
wxGetApp().SafeMessageBox(
strMessage,
strTitle,
wxICON_ERROR | wxOK,
this
);
event.Veto();
}
}
}
示例4: OnPageChanging
void CProjectInfoPage::OnPageChanging( wxWizardExEvent& event ) {
if (event.GetDirection() == false) return;
wxLogTrace(wxT("Function Start/End"), wxT("CProjectInfoPage::OnPageChanging - Function Begin"));
CMainDocument* pDoc = wxGetApp().GetDocument();
CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
wxString strTitle;
int iAnswer;
wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
wxASSERT(pSkinAdvanced);
wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));
strTitle.Printf(
wxT("%s"),
pSkinAdvanced->GetApplicationName().c_str()
);
// Check to see if the project is supported:
if ( !GetProjectSupported() ) {
iAnswer = wxGetApp().SafeMessageBox(
_("This project may not have work for your type of computer. Do you want to add it anyway?"),
strTitle,
wxCENTER | wxYES_NO | wxICON_INFORMATION
);
// Project is not supported
if (wxNO == iAnswer) {
event.Veto();
}
} else {
// Check if we are already attached to that project:
for (int i = 0; i < pDoc->GetProjectCount(); ++i) {
PROJECT* project = pDoc->project(i);
if (project) {
std::string project_url = project->master_url;
std::string new_project_url = (const char*)m_strProjectURL.mb_str();
canonicalize_master_url(project_url);
canonicalize_master_url(new_project_url);
if (project_url == new_project_url) {
wxGetApp().SafeMessageBox(
_("You already added this project. Please choose a different project."),
strTitle,
wxCENTER | wxICON_INFORMATION
);
// We are already attached to that project,
event.Veto();
break;
}
}
}
}
wxLogTrace(wxT("Function Start/End"), wxT("CProjectInfoPage::OnPageChanging - Function End"));
}