void SelGenSchemaPage::OnWizardPageChanging(wxWizardEvent &event)
{
	if(event.GetDirection() && m_allSchemas->GetSelection() == wxNOT_FOUND)
	{
		wxMessageBox(_("Please select an item to move to next step."), _("No choice made"), wxICON_WARNING | wxOK, this);
		event.Veto();
	}
	else if(event.GetDirection())
	{
		if(m_allSchemas->GetSelection() > 0)
		{
			wparent->OIDSelectedSchema = schemasHM[schemasNames[m_allSchemas->GetSelection()]];
			wparent->schemaName = schemasNames[m_allSchemas->GetSelection()];
			wxArrayString tables = ddImportDBUtils::getTablesNames(wparent->getConnection(), wparent->schemaName);
			wparent->getDesign()->unMarkSchemaOnAll();
			wparent->getDesign()->markSchemaOn(tables);
		}
		else
		{
			wparent->OIDSelectedSchema = -1;
			wparent->schemaName = _("");
		}
		wparent->page4->populateGrid();
	}
}
示例#2
0
void WizardPageFlagsConfig::OnWizardPageChanging( wxWizardEvent& event )
{
    uint32_t mask = ( 1 << m_pItem->m_width ) - 1;
    mask = mask << m_pItem->m_pos;

    if ( event.GetDirection() ) {  // Forward

        if ( flagtype_value == m_pItem->m_type ) {
            wxString str = m_textField->GetValue();
            if ( !str.IsNumber() ) {
                event.Veto();
            }
            else {
                m_value = vscp_readStringValue( str );
                m_value = ( m_value << m_pItem->m_pos ) & mask;
            }
        }
        else if ( flagtype_choice == m_pItem->m_type ) {
            m_value = m_listBox->GetSelection();
            m_value = ( m_value << m_pItem->m_pos ) & mask;
        }
        else {  // Boolean
            m_value = ( m_boolChoice->GetValue() ? 1 : 0 );
            m_value = ( m_value << m_pItem->m_pos ) & mask;
        }

    }
    else { // Backward

    }
}
示例#3
0
//------------------------------------------------------------------------------
void WizCompilerPanel::OnPageChanging(wxWizardEvent& event)
{
    if (event.GetDirection() != 0) // !=0 forward, ==0 backward
    {
        if (GetCompilerID().IsEmpty())
        {
            cbMessageBox(_("You must select a compiler for your project..."), _("Error"), wxICON_ERROR, GetParent());
            event.Veto();
            return;
        }
        if (m_AllowConfigChange && !GetWantDebug() && !GetWantRelease())
        {
            cbMessageBox(_("You must select at least one configuration..."), _("Error"), wxICON_ERROR, GetParent());
            event.Veto();
            return;
        }

        if (m_AllowConfigChange)
        {
            ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("scripts"));

            cfg->Write(_T("/generic_wizard/want_debug"), (bool)GetWantDebug());
            cfg->Write(_T("/generic_wizard/debug_name"), GetDebugName());
            cfg->Write(_T("/generic_wizard/debug_output"), GetDebugOutputDir());
            cfg->Write(_T("/generic_wizard/debug_objects_output"), GetDebugObjectOutputDir());

            cfg->Write(_T("/generic_wizard/want_release"), (bool)GetWantRelease());
            cfg->Write(_T("/generic_wizard/release_name"), GetReleaseName());
            cfg->Write(_T("/generic_wizard/release_output"), GetReleaseOutputDir());
            cfg->Write(_T("/generic_wizard/release_objects_output"), GetReleaseObjectOutputDir());
        }
    }
    WizPageBase::OnPageChanging(event); // let the base class handle it too
}
示例#4
0
void CErrProxyPage::OnPageChanging(wxWizardEvent& event) {
    CMainDocument* pDoc = wxGetApp().GetDocument();
    wxString       strBuffer = wxEmptyString;
    int            iBuffer = 0;

    wxASSERT(pDoc);
    wxASSERT(wxDynamicCast(pDoc, CMainDocument));

    if (event.GetDirection() == true) {
        // Moving to the next page, save state
        pDoc->proxy_info.use_http_proxy = (m_pProxyHTTPServerCtrl->GetValue().Length() > 0);
        pDoc->proxy_info.http_server_name = (const char*)m_pProxyHTTPServerCtrl->GetValue().mb_str();
        pDoc->proxy_info.http_user_name = (const char*)m_pProxyHTTPUsernameCtrl->GetValue().mb_str();
        pDoc->proxy_info.http_user_passwd = (const char*)m_pProxyHTTPPasswordCtrl->GetValue().mb_str();

        strBuffer = m_pProxyHTTPPortCtrl->GetValue();
        strBuffer.ToLong((long*)&iBuffer);
        pDoc->proxy_info.http_server_port = iBuffer;

        pDoc->proxy_info.use_socks_proxy = (m_pProxySOCKSServerCtrl->GetValue().Length() > 0);
        pDoc->proxy_info.socks_server_name = (const char*)m_pProxySOCKSServerCtrl->GetValue().mb_str();
        pDoc->proxy_info.socks5_user_name = (const char*)m_pProxySOCKSUsernameCtrl->GetValue().mb_str();
        pDoc->proxy_info.socks5_user_passwd = (const char*)m_pProxySOCKSPasswordCtrl->GetValue().mb_str();

        strBuffer = m_pProxySOCKSPortCtrl->GetValue();
        strBuffer.ToLong((long*)&iBuffer);
        pDoc->proxy_info.socks_server_port = iBuffer;

        pDoc->SetProxyConfiguration();
    }
}
示例#5
0
void MyWizard::OnPageChanging(wxWizardEvent &event)
{
	wxWizardPage *wp=event.GetPage();
	EnterLeavePage *elp=dynamic_cast<EnterLeavePage*>(wp);
	if (elp)
	{
		if (event.GetDirection())
		{
			//forward
			bool b=elp->OnLeave(true);
			if (!b) {event.Veto();return;}
			wxWizardPage *nwp=wp->GetNext();
			EnterLeavePage *nelp=dynamic_cast<EnterLeavePage*>(nwp);
			if (nelp)
			{
				bool b=nelp->OnEnter(true);
				if (!b) event.Veto();
			}
		}
		else
		{
			//backward
			bool b=elp->OnLeave(false);
			if (!b) {event.Veto();return;}
			wxWizardPage *nwp=wp->GetPrev();
			EnterLeavePage *nelp=dynamic_cast<EnterLeavePage*>(nwp);
			if (nelp)
			{
				bool b=nelp->OnEnter(false);
				if (!b) event.Veto();
			}
		}
	}
}
void ConnectWizard::OnPageChanged( wxWizardEvent& event ) {
	dout << "> OnPageChanged" << std::endl;
	if( event.GetDirection() ) {
		if( GetCurrentPage()==sessionlistPage ) {
			// just in case
			dout << "stop search" << std::endl;
			d->setup.stopSearch();

			// clear host search list
			dout << "clear list" << std::endl;
			d->sessionsCritSec.Enter();
			d->hosts.clear();
			sessions->Clear();
			sessions->Refresh();
			d->sessionsCritSec.Leave();

			// start new host search
			dout << "start new search" << std::endl;
			long portNum;
			port->GetValue().ToLong( &portNum );

			bool ret = d->setup.startSearch( broadcastRadio->GetValue(),
											 hostName->GetValue().c_str(), portNum );
			if( !ret )
				derr << "Search failed. Take a look at the logs to find out why." << std::endl;
		}
	}

	dout << "< OnPageChanged" << std::endl;
}
void ddGenerationWizard::OnWizardPageChanging(wxWizardEvent &event)
{
	if(event.GetDirection())
	{
		page2->RefreshTablesList();
	}
}
void SelGenTablesPage::OnWizardPageChanging(wxWizardEvent &event)
{
	if(event.GetDirection() && m_selTables->GetCount() <= 0)
	{
		wxMessageBox(_("Please select at least one table to move to next step."), _("No tables selected"), wxICON_WARNING | wxOK, this);
		event.Veto();
	}
}
示例#9
0
    void OnWizardPageChanging(wxWizardEvent& event)
    {
        int sel = m_radio->GetSelection();

        if ( sel == Both )
            return;

        if ( event.GetDirection() && sel == Forward )
            return;

        if ( !event.GetDirection() && sel == Backward )
            return;

        wxMessageBox(wxT("You can't go there"), wxT("Not allowed"),
                     wxICON_WARNING | wxOK, this);

        event.Veto();
    }
示例#10
0
void WeatherFaxWizard::OnWizardPageChanged( wxWizardEvent& event )
{
    if(event.GetPage() == m_pages[1]) {
        if(!event.GetDirection()) {
            /* if we backed up, convert the mapped coordinates back to the input */
            double x1, y1, mx1, my1;
            double x2, y2, mx2, my2;

            x1 = m_sCoord1X->GetValue(), y1 = m_sCoord1Y->GetValue();
            x2 = m_sCoord2X->GetValue(), y2 = m_sCoord2Y->GetValue();

            m_wfimg.MercatorToInput(x1, y1, mx1, my1);
            m_sCoord1XUnMapped->SetValue(round(mx1));
            m_sCoord1YUnMapped->SetValue(round(my1));

            m_wfimg.MercatorToInput(x2, y2, mx2, my2);
            m_sCoord2XUnMapped->SetValue(round(mx2));
            m_sCoord2YUnMapped->SetValue(round(my2));
    
            double coord1lat, coord1lon, coord2lat, coord2lon;
            m_tCoord1Lat->GetValue().ToDouble(&coord1lat);
            m_tCoord1Lon->GetValue().ToDouble(&coord1lon);
            m_tCoord2Lat->GetValue().ToDouble(&coord2lat);
            m_tCoord2Lon->GetValue().ToDouble(&coord2lon);
            WriteMappingLatLon(coord1lat, coord1lon, coord2lat, coord2lon);
        }

        SetUnMappedCoordRanges();
        UpdateMappingControls();

        m_rbCoord1UnMapped->SetValue(true);
        m_rbCoord2UnMapped->SetValue(false);
    } else if(event.GetPage() == m_pages[2]) {
        StoreMappingParams();
        /* invalidate mapped image */
        m_wfimg.m_mappedimg = wxNullImage;
        m_rbCoord1UnMapped->SetValue(true);
        m_rbCoord2UnMapped->SetValue(false);

        if(!ApplyMapping()) {
            wxMessageDialog w
                ( this, _("Failed to apply mapping\nCheck Mapping Correction Parameters"),
                  _("Mapping"), wxOK | wxICON_ERROR );
            w.ShowModal();
            ShowPage(m_pages[1], true);
        } else if(m_curCoords->mapping == WeatherFaxImageCoordinates::MERCATOR &&
                m_curCoords->mappingmultiplier == 1 &&
                  m_curCoords->mappingratio == 1) {
            wxWizardEvent dummy;
            OnWizardFinished( dummy );
            if(IsModal())
                EndModal(wxID_OK);
            else
                Hide();
        }
    }
}
示例#11
0
void WizInfoPanel::OnPageChanging(wxWizardEvent& event)
{
    if (!GetSkipPage() && event.GetDirection() != 0) // !=0 forward, ==0 backward
    {
        SetSkipPage(m_InfoPanel->chkSkip->GetValue());
    }

    WizPageBase::OnPageChanging(event);
}
示例#12
0
void WizardPageCanalConfig::OnWizardPageChanging( wxWizardEvent& event )
{
    if ( event.GetDirection() ) {  // Forward
        
        if ( type_choice == m_pItem->m_type ) {
            int sel = m_listBox->GetSelection();
            if ( -1 != sel ) {
                if ( !m_bOptional ) {
                    wxMessageBox(_("This value is not optional. Please select a value!"));
                    event.Veto();
                }
                else {
                    m_strValue = wxString::Format( _( "%d" ), sel );
                }
            }
        }
        else if ( type_boolean == m_pItem->m_type ) {
            m_strValue = ( m_boolChoice->GetValue() ? _( "true" ) : _("false") );
        }
        else if ( type_string == m_pItem->m_type ) {
            m_strValue = m_textField->GetValue();
        }
        else if ( type_int32 == m_pItem->m_type ) {
            m_strValue = m_textField->GetValue();
        }
        else if ( type_uint32 == m_pItem->m_type ) {
            m_strValue = m_textField->GetValue();
        }
        else if ( type_float == m_pItem->m_type ) {
            m_strValue = m_textField->GetValue();
        }
        else if ( type_isotime == m_pItem->m_type ) {
            m_strValue = m_textField->GetValue();
        }
        else if ( type_isodate == m_pItem->m_type ) {
            m_strValue = m_textField->GetValue();
        }
        else if ( type_isodatetime == m_pItem->m_type ) {
            m_strValue = m_textField->GetValue();
        }
        else if ( type_guid == m_pItem->m_type ) {
            m_strValue = m_textField->GetValue();
        }
        else if ( type_event == m_pItem->m_type ) {
        
        }
        else if ( type_filter == m_pItem->m_type ) {
        
        }
        else if ( type_mask == m_pItem->m_type ) {
        
        }
    }
    else { // Backward

    }
}
示例#13
0
//------------------------------------------------------------------------------
void WizProjectPathPanel::OnPageChanged(wxWizardEvent& event)
{
    if (event.GetDirection() != 0) // !=0 forward, ==0 backward
    {
        wxString dir = Manager::Get()->GetProjectManager()->GetDefaultPath();
        m_pProjectPathPanel->SetPath(dir);
    }
    WizPageBase::OnPageChanged(event); // let the base class handle it too
}
示例#14
0
//------------------------------------------------------------------------------
void WizGenericSelectPathPanel::OnPageChanging(wxWizardEvent& event)
{
    if (event.GetDirection() != 0) // !=0 forward, ==0 backward
    {
        wxString dir = Manager::Get()->GetMacrosManager()->ReplaceMacros(m_pGenericSelectPath->txtFolder->GetValue());
        if (!wxDirExists(dir))
        {
            cbMessageBox(_("Please select a valid location..."), _("Error"), wxICON_ERROR, GetParent());
            event.Veto();
            return;
        }
    }
    WizPageBase::OnPageChanging(event); // let the base class handle it too

    if (event.GetDirection() != 0 && event.IsAllowed())
    {
        Manager::Get()->GetConfigManager(_T("project_wizard"))->Write(_T("/generic_paths/") + GetPageName(), m_pGenericSelectPath->txtFolder->GetValue());
    }
}
示例#15
0
//------------------------------------------------------------------------------
void WizGenericSingleChoiceList::OnPageChanging(wxWizardEvent& event)
{
    WizPageBase::OnPageChanging(event); // let the base class handle it too

    // save selection value
    if (event.GetDirection() != 0 && event.IsAllowed())
    {
        Manager::Get()->GetConfigManager(_T("project_wizard"))->Write(_T("/generic_single_choices/") + GetPageName(), (int)m_pGenericSingleChoiceList->GetChoice());
    }
}
void ReportGridPage::OnWizardPageChanging(wxWizardEvent &event)
{
	if(!event.GetDirection())
	{
		//Reset tables after a warning
		int answer = wxMessageBox(_("Going back to \"Select schema\" page will reinitialize all selections.\nDo you want to continue?"), _("Going back?"), wxYES_NO | wxCANCEL, this);
		if (answer != wxYES)
		{
			event.Veto();
		}
	}
}
示例#17
0
void FirstTimeWizard::OnPageChanging( wxWizardEvent& evt )
{
	if( evt.GetPage() == NULL ) return;		// safety valve!

	sptr page = (sptr)evt.GetPage()->GetClientData();

	if( evt.GetDirection() )
	{
		// Moving forward:
		//   Apply settings from the current page...

		if( page >= 0 )
		{
			if( ApplicableWizardPage* page = wxDynamicCast( GetCurrentPage(), ApplicableWizardPage ) )
			{
				if( !page->PrepForApply() || !page->GetApplyState().ApplyAll() )
				{
					evt.Veto();
					return;
				}
			}
		}

		if( page == 0 )
		{
			if( wxFile::Exists(GetUiSettingsFilename()) || wxFile::Exists(GetVmSettingsFilename()) )
			{
				// Asks the user if they want to import or overwrite the existing settings.

				Dialogs::ImportSettingsDialog modal( this );
				if( modal.ShowModal() != wxID_OK )
				{
					evt.Veto();
					return;
				}
			}
		}
	}
	else
	{
		// Moving Backward:
		//   Some specific panels need per-init actions canceled.

		if( page == 1 )
		{
			m_panel_PluginSel.CancelRefresh();
		}
	}
}
示例#18
0
void PHPXDebugSetupWizard::OnPageChanging(wxWizardEvent& event)
{
    event.Skip();
    if(event.GetDirection() && event.GetPage() == m_wizardPageIDEKey) {
        // build the text to copy
        wxString content;
        content << "xdebug.remote_enable=1\n";
        content << "xdebug.idekey=\"" << m_textCtrlKey->GetValue() << "\"\n";
        content << "xdebug.remote_host=" << m_textCtrlIP->GetValue() << "\n";
        content << "xdebug.remote_port=" << m_textCtrlPort->GetValue() << "\n";

        m_textCtrlPHPIni->ChangeValue(content);
        CallAfter(&PHPXDebugSetupWizard::SelectAllIniText);
    }
}
示例#19
0
void PluginWizard::OnPageChanging(wxWizardEvent& event)
{
    if ( event.GetDirection() && event.GetPage() == m_pages.at(0)) {
        wxString pluginName = m_textCtrlName->GetValue();
        pluginName.Trim();
        if ( pluginName.IsEmpty() || !::IsValidCppIndetifier(pluginName) ) {
            ::wxMessageBox(_("Invalid plugin name"), "codelite");
            event.Veto();
            return;
        }
    } else if ( event.GetDirection() && event.GetPage() == m_pages.at(1)) {
        if ( !wxDir::Exists( m_dirPickerCodeliteDir->GetPath() ) ) {
            ::wxMessageBox(_("codelite folder does not exists"), "codelite");
            event.Veto();
            return;
        }

        if ( !wxDir::Exists( m_dirPickerPluginPath->GetPath() ) ) {
            ::wxMessageBox(_("The selected plugin folder does not exist"), "codelite");
            event.Veto();
            return;
        }
    }
}
示例#20
0
//------------------------------------------------------------------------------
void WizPageBase::OnPageChanged(wxWizardEvent& event)
{
    try
    {
        wxString sig = _T("OnEnter_") + m_PageName;
        SqPlus::SquirrelFunction<void> cb(cbU2C(sig));
        if (cb.func.IsNull())
            return;
        cb(event.GetDirection() != 0); // !=0 forward, ==0 backward
    }
    catch (SquirrelError& e)
    {
        Manager::Get()->GetScriptingManager()->DisplayErrors(&e);
    }
}
示例#21
0
void CErrNotDetectedPage::OnPageChanged(wxWizardEvent& event) {
    if (event.GetDirection() == false) return;

    wxASSERT(m_pTitleStaticCtrl);
    wxASSERT(m_pDirectionsStaticCtrl);

    if (CheckWizardTypeByPage<CWizardAttachProject>(this)) {
        m_pTitleStaticCtrl->SetLabel(_("Project not found"));
        m_pDirectionsStaticCtrl->SetLabel(_("The URL you supplied is not that of a BOINC-based project.\n\nPlease check the URL and try again."));
    } else if (CheckWizardTypeByPage<CWizardAccountManager>(this)) {
        m_pTitleStaticCtrl->SetLabel(_("Account manager not found"));
        m_pDirectionsStaticCtrl->SetLabel(_("The URL you supplied is not that of a BOINC-based account\nmanager.\n\nPlease check the URL and try again."));
    } else {
        wxASSERT(FALSE);
    }
    Fit();
}
void ConnectWizard::OnNextPage( wxWizardEvent& event ) {
	dout << "> OnNextPage" << std::endl;
	if( event.GetDirection() ) {
		if( GetCurrentPage()==hostPage ) {
			wxIPV4address addr;
			if( directRadio->GetValue() && addr.Hostname( hostName->GetValue() )==false ) {
		        wxMessageBox(_T("Please enter a valid internet (IP v4) address for the hostname."), _T("Invalid hostname"),
							 wxICON_ERROR | wxOK, this);
				event.Veto();
				return;
			}
                
			if( addr.Service( port->GetValue() )==false ) {
				wxMessageBox(_T("Please enter a valid port number (between 1 and 65535)."), 
							 _T("Invalid port"),
							 wxICON_ERROR | wxOK, this);
				event.Veto();
				return;
			}
		} else
		if( GetCurrentPage()==sessionlistPage ) {
			d->setup.stopSearch();

			// session selected?
			int selected = sessions->GetSelection();
			if( selected==wxNOT_FOUND ) {
				wxMessageBox(_T("Please select the host you want to connect to."), 
							 _T("No host selected"),
							 wxICON_ERROR | wxOK, this);
				event.Veto();
				return;
			}

			// connect finally
			d->con = d->setup.connect( d->hosts[selected] );
			if( d->con.isNull() ) {
				wxMessageBox( _T(d->setup.errorMessage().c_str()),
							  _T("Connection error"),
							  wxICON_ERROR | wxOK, this);
				event.Veto();
				return;
			}
		}
	}	
	dout << "< OnNextPage" << std::endl;
}
void HostWizard::OnNextPage( wxWizardEvent& event ) {
    if( event.GetDirection() )
        if( GetCurrentPage()==sessionPage ) {
            if( sessionNameEdit->GetValue().Length()==0 ) {
                wxMessageBox(_T("Please enter a session name. Empty session names are not allowed."), _T("Invalid session name"),
                             wxICON_ERROR | wxOK, this);
                event.Veto();
            } else {

                long ret;
                if( !portEdit->GetValue().ToLong( &ret ) || ret<=0 || ret>65535 ) {
                    wxMessageBox(_T("Please enter a valid port number (between 1 and 65535)."), _T("Invalid port"),
                                 wxICON_ERROR | wxOK, this);
                    event.Veto();
                }
            }
        }
}
示例#24
0
void WizPageBase::OnPageChanging(wxWizardEvent& event)
{
    Manager::Get()->GetConfigManager(_T("scripts"))->Write(_T("/generic_wizard/") + m_PageName + _T("/skip"), (bool)m_SkipPage);

    try
    {
        wxString sig = _T("OnLeave_") + m_PageName;
        SqPlus::SquirrelFunction<bool> cb(cbU2C(sig));
        if (cb.func.IsNull())
            return;
        bool allow = cb(event.GetDirection() != 0); // !=0 forward, ==0 backward
        if (!allow)
            event.Veto();
    }
    catch (SquirrelError& e)
    {
        Manager::Get()->GetScriptingManager()->DisplayErrors(&e);
    }
}
示例#25
0
//------------------------------------------------------------------------------
void WizProjectPathPanel::OnPageChanging(wxWizardEvent& event)
{
    if (event.GetDirection() != 0) // !=0 forward, ==0 backward
    {
        wxString dir = m_pProjectPathPanel->GetPath();
        wxString name = m_pProjectPathPanel->GetName();
        wxString fullname = m_pProjectPathPanel->GetFullFileName();
        wxString title = m_pProjectPathPanel->GetTitle();
//        if (!wxDirExists(dir))
//        {
//            cbMessageBox(_("Please select a valid path to create your project..."), _("Error"), wxICON_ERROR, GetParent());
//            event.Veto();
//            return;
//        }
        if (title.IsEmpty())
        {
            cbMessageBox(_("Please select a title for your project..."), _("Error"), wxICON_ERROR, GetParent());
            event.Veto();
            return;
        }
        if (name.IsEmpty())
        {
            cbMessageBox(_("Please select a name for your project..."), _("Error"), wxICON_ERROR, GetParent());
            event.Veto();
            return;
        }
        if (wxFileExists(fullname))
        {
            if (cbMessageBox(_("A project with the same name already exists in the project folder.\n"
                        "Are you sure you want to use this directory (files may be OVERWRITTEN)?"),
                        _("Confirmation"),
                        wxICON_QUESTION | wxYES_NO, GetParent()) != wxID_YES)
            {
//                cbMessageBox(_("A project with the same name already exists in the project folder.\n"
//                            "Please select a different project name..."), _("Warning"), wxICON_WARNING, GetParent());
                event.Veto();
                return;
            }
        }
        Manager::Get()->GetProjectManager()->SetDefaultPath(dir);
    }
    WizPageBase::OnPageChanging(event); // let the base class handle it too
}
示例#26
0
void WizFilePathPanel::OnPageChanging(wxWizardEvent& event)
{
    if (event.GetDirection() != 0) // !=0 forward, ==0 backward
    {
        m_Filename = m_pFilePathPanel->GetFilename();
        m_HeaderGuard = m_pFilePathPanel->GetHeaderGuard();
        m_AddToProject = m_pFilePathPanel->GetAddToProject();

        if (m_Filename.IsEmpty() || !wxDirExists(wxPathOnly(m_Filename)))
        {
            cbMessageBox(_("Please select a filename with full path for your new file..."), _("Error"), wxICON_ERROR, GetParent());
            event.Veto();
            return;
        }

        ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("scripts"));
        cfg->Write(_T("/generic_wizard/add_file_to_project"), (bool)m_pFilePathPanel->GetAddToProject());
    }
    WizPageBase::OnPageChanging(event); // let the base class handle it too
}
示例#27
0
void DriveSelectPage::OnWizardPageChanging(wxWizardEvent& event)
{
	m_filename = m_drivebox->GetValue();
	m_type     = wxString((char *)m_typebox->GetClientData(m_typebox->GetSelection()), wxConvUTF8);
	m_compress = wxString((char *)m_compbox->GetClientData(m_compbox->GetSelection()), wxConvUTF8);
	if (m_pageType == PT_FORMAT)
		 m_format   = (dsk_format_t)(m_formbox->GetSelection());
	else m_format   = (dsk_format_t)(m_formbox->GetSelection() - 1);

	m_forceHead  = m_head->GetSelection() - 1;
	m_doubleStep = m_dstep->GetValue();

	if (m_filename.IsEmpty() && event.GetDirection())
	{
		wxMessageBox(_T("You have not entered a filename."), _T("Choose disc"),
             wxICON_WARNING | wxOK, this);

        event.Veto();
	}
}
示例#28
0
void NewProjectWizard::OnPageChanging(wxWizardEvent& event)
{
    if ( event.GetDirection() ) {
        // -------------------------------------------------------
        // Switching from the Templates page
        // -------------------------------------------------------
        if ( event.GetPage() == m_wizardPageTemplate ) {
            if ( !CheckProjectTemplate() ) {
                event.Veto();
                return;
            }

        } else if ( event.GetPage() == m_wizardPageDetails ) {
            if( !CheckProjectName() || !CheckProjectPath() ) {
                event.Veto();
                return;
            }
        }
    }
    event.Skip();
}
示例#29
0
//------------------------------------------------------------------------------
void WizBuildTargetPanel::OnPageChanging(wxWizardEvent& event)
{
    if (event.GetDirection() != 0) // !=0 forward, ==0 backward
    {
        if (m_pBuildTargetPanel->GetCompilerCombo()->IsShown() && GetCompilerID().IsEmpty())
        {
            cbMessageBox(_("You must select a compiler for your build target..."), _("Error"), wxICON_ERROR, GetParent());
            event.Veto();
            return;
        }

        cbProject* theproject = Manager::Get()->GetProjectManager()->GetActiveProject(); // can't fail; if no project, the wizard didn't even run
        if (theproject->GetBuildTarget(m_pBuildTargetPanel->GetTargetName()))
        {
            cbMessageBox(_("A build target with that name already exists in the active project..."), _("Error"), wxICON_ERROR, GetParent());
            event.Veto();
            return;
        }
    }
    WizPageBase::OnPageChanging(event); // let the base class handle it too
}
示例#30
0
文件: NUserWiz.cpp 项目: mentat/nnim
void UserWizardP2::OnWizardPageChanging(wxWizardEvent& event)
{
	if ( !event.GetDirection()  )
		return;

	wxListCtrl * listctrl = (wxListCtrl *)FindWindow(ID_U_CONFNETS);
	wxListBox * listbox = (wxListBox *)FindWindow(ID_U_ALLNETS);

	wxString uname = ((UserWizardP1 *)GetPrev())->name->GetValue();
	wxString pword = ((UserWizardP1 *)GetPrev())->p1->GetValue();

	SecByteBlock pass((const unsigned char *)pword.c_str(), pword.length());
    
	AuthLoad &myLoader = wxGetApp().AccessLoader();

	if (!myLoader.CreateNew(uname.c_str(), pass))
	{
		throw("UserWizardP2::OnWizardPageChanging: Could not create new user");
	}

	wxMessageBox(uname + pword);

  // load defaults
	XMLNode toc, msn, yahoo, kit, icq;
	
	toc <<
    "<toc>"
    "<user password=\"\" username=\"\"/>"
    "<server host=\"" TOC_SERVER "\" port=\"" TOC_SERVER_PORT "\"/>"
	"<loginserver host=\"" TOC_LOGIN_SERVER "\" port=\"" TOC_LOGIN_PORT "\"/>"
    "</toc>";

	msn <<
    "<msn>"
    "<user password=\"\" username=\"\"/>"
    "<server host=\"" MSN_SERVER "\" port=\"" MSN_PORT "\"/>"
	"</msn>";

	yahoo <<
    "<yahoo>"
    "<user password=\"\" username=\"\"/>"
    "<server host=\"" YAHOO_DATA_SERVER "\" port=\"" YAHOO_DATA_PORT "\"/>"
	"<loginserver host=\"" YAHOO_AUTH_SERVER "\" port=\"" YAHOO_AUTH_PORT "\"/>"
    "</yahoo>";

	kit <<
    "<kit>"
    "<user password=\"\" username=\"\"/>"
    "<server host=\"" GNU_SERVER "\" port=\"" GNU_PORT "\"/>"
	"</kit>";

	icq <<
    "<icq>"
    "<user password=\"\" username=\"\"/>"
    "<server host=\"" ICQ_SERVER "\" port=\"" ICQ_PORT "\"/>"
	"</icq>";


	for (long int it = 0; it < listctrl->GetItemCount(); it++)
	{
		XMLNode tmp;
		switch(listctrl->GetItemData(it)) {
		case (AIM): tmp = toc; break;
		case(MSN): tmp = msn; break;
		case(YAHOO): tmp = yahoo; break;
		case(ICQ): tmp = icq; break;
		case(GNU): tmp = kit; break;
		default: wxASSERT(false); break;
		}


		wxLogDebug(listctrl->GetItemText(it).c_str());

		tmp.child("user").setProperty("username", listctrl->GetItemText(it).c_str());
		tmp.child("user").setProperty("password", string((const char *)(const unsigned char *)m_pwords[it], m_pwords[it].Size()));
      
	}

    try
    {
	    myLoader.U().SetNet(icq);	
	    myLoader.U().SetNet(toc);
	    myLoader.U().SetNet(msn);
	    myLoader.U().SetNet(yahoo);
	    myLoader.U().SetNet(kit);
    }
    catch(...)
    {
        throw gmException("Pointer Error", gmException::gMEM);
    }
  
	myLoader.CommitToFile();

}