当前位置: 首页>>代码示例>>C++>>正文


C++ wxProcessEvent类代码示例

本文整理汇总了C++中wxProcessEvent的典型用法代码示例。如果您正苦于以下问题:C++ wxProcessEvent类的具体用法?C++ wxProcessEvent怎么用?C++ wxProcessEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了wxProcessEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnProcTerminate

void mxExportPreview::OnProcTerminate (wxProcessEvent & event) {
    _LOG("mxExportPreview::OnProcessTerminate");
    if (pid<=0||!the_process||event.GetPid()!=pid) return;
    int exit_code = event.GetExitCode();
    delete the_process;
    the_process=NULL;
    if (exit_code!=0) {
        SetMessage(_Z("Error al intentar exportar"));
        state=mxEP_NONE;
        return;
    }

    switch(state) {

    case mxEP_NONE: { // no deberia pasar nunca
        return;
    }
    break;

    case mxEP_CHECK: { // estaba armando el psd, ahora exportar
        wxString command;
        command<<config->psexport_command<<_T(" \"")<<temp_filename<<".psd"<<_T("\" \"")<<temp_filename<<".exp"<<_T("\"");
        if (config->lang[LS_BASE_ZERO_ARRAYS]) command<<_T(" --base_zero_arrays=1");
        int lang_id = mxID_FILE_EXPORT_LANG_FIRST+1+combo_lang->GetCurrentSelection();
        command<<" --lang="<<utils->GetExportLangCode(lang_id);

        the_process = new wxProcess(this->GetEventHandler());
        _LOG("mxExportPreview, command="<<command);
        pid = wxExecute(command,wxEXEC_ASYNC,the_process);
        state = mxEP_EXP;

    }
    break;

    case mxEP_EXP: { // estaba exportando, mostrar
        state = mxEP_NONE;
        code_ctrl->LoadFile(temp_filename+".exp");
    }
    break;

    case mxEP_UPDATE: {  // se interrumpio lo que estaba haciendo para empezar otra vez
        pid = 0;
        state = mxEP_NONE;
        UpdatePrev();
    }
    break;

    default:
        break;
    }
}
开发者ID:ifigueroap,项目名称:pse-spy,代码行数:51,代码来源:mxExportPreview.cpp

示例2: OnTerminate

void VersionChecker::OnTerminate(wxProcessEvent& e) {
    assert(m_process);

    // if version check returned correctly and print sth.
    // otherwise there is a bug!
    if( e.GetExitCode() == 255 && m_process->IsInputAvailable()) {
        wxTextInputStream is(*m_process->GetInputStream());
        wxString version = is.ReadLine();
        if (version != SC::A2S(SZARP_VERSION))
            m_is_new_version = true;
    } else {
        wxLogError( _("This should never happen. Probably there is a bug in version checking.") );
        std::wcerr << "Dump stdout:" << std::endl;
        DumpStream( m_process->GetInputStream() );
        std::wcerr << "Dump stderr:" << std::endl;
        DumpStream( m_process->GetErrorStream() );
    }

    delete m_process;
    m_process = NULL;

    if (m_is_new_version) {
        ShowNewVersionMessage();
        NotifyNewVersionAvailable();
    } else
        Start();
}
开发者ID:hermixy,项目名称:szarp,代码行数:27,代码来源:vercheck.cpp

示例3: OnTerminateInstall

void SigUIFrame::OnTerminateInstall(wxProcessEvent &event)
{
    wxEndBusyCursor();
    wxWakeUpIdle();
    if (event.GetExitCode() == 0) {
	m_sig_candidates->Clear();
	wxLogMessage(_("Successfully installed new virus signatures\n"));
	reload();
    } else {
	bool had_errors = false;
	wxInputStream *err = m_siginst_process->GetErrorStream();
	wxTextInputStream tis(*err);

	while (!err->Eof()) {
	    wxString line = tis.ReadLine();
	    line.Trim();
	    if (!line.IsEmpty()) {
		wxLogWarning("%s", line);
		had_errors = true;
	    }
	}
	if (had_errors) {
	    wxLogError(_("Errors encountered during virus signature install"));
	}
    }
    delete m_siginst_process;

    m_panel_sigman->Enable();
}
开发者ID:LZ-SecurityTeam,项目名称:clamav-devel,代码行数:29,代码来源:SigUIMain.cpp

示例4: OnInstProcExited

void Instance::OnInstProcExited(wxProcessEvent& event)
{
	m_running = false;
	printf("Instance exited with code %i.\n", event.GetExitCode());
	if (evtHandler != NULL)
	{
		evtHandler->AddPendingEvent(event);
	}
}
开发者ID:bartbes,项目名称:MultiMC4,代码行数:9,代码来源:instance.cpp

示例5: OnEndProcess

void PipedProcessCtrl::OnEndProcess(wxProcessEvent &event)
{
    m_exitcode=event.GetExitCode();
    SyncOutput(-1); //read any left over output TODO: while loop to handle extremely large amount of output
    m_dead=true;
    delete m_proc;
    m_proc=NULL;
    m_killlevel=0;
    if(m_shellmgr)
        m_shellmgr->OnShellTerminate(this);
}
开发者ID:stahta01,项目名称:EmBlocks,代码行数:11,代码来源:PipedProcessCtrl.cpp

示例6: OnProcessTerminate

void mxConsole::OnProcessTerminate( wxProcessEvent &event ) {
    if (event.GetPid()==the_process_pid) {
        GetProcessOutput(false);
        want_input=false;
        Refresh();
        the_process->Detach();
        the_process=NULL;
        timer_process->Stop();
        parent->OnProcessTerminated();
    }
}
开发者ID:ifigueroap,项目名称:pse-spy,代码行数:11,代码来源:mxConsole.cpp

示例7: ProcessEnd

void AsyncExeCmd::ProcessEnd(wxProcessEvent& event)
{
	//read all input before stopping the timer
	if( !m_stop ){
		PrintOutput();
	}
	
	m_timer->Stop();
	m_busy = false;
	m_stop = false;

	SendEndMsg(event.GetExitCode());
}
开发者ID:BackupTheBerlios,项目名称:codelite-svn,代码行数:13,代码来源:async_executable_cmd.cpp

示例8: Z

void
job_run_dialog::on_end_process(wxProcessEvent &evt) {
  process_input();

  int ndx         = jobs_to_start[current_job];
  int exit_code   = evt.GetExitCode();
  bool remove_job;
  wxString status;

  if (abort) {
    jobs[ndx].status = JOBS_ABORTED;
    status           = Z("aborted");
    remove_job       = false;
  } else if (0 == exit_code) {
    jobs[ndx].status = JOBS_DONE;
    status           = Z("completed OK");
    remove_job       = CJAR_NEVER != mdlg->options.clear_job_after_run_mode;
  } else if (1 == exit_code) {
    jobs[ndx].status = JOBS_DONE_WARNINGS;
    status           = Z("completed with warnings");
    remove_job       = (CJAR_ALWAYS == mdlg->options.clear_job_after_run_mode) || (CJAR_WARNINGS == mdlg->options.clear_job_after_run_mode);
  } else {
    jobs[ndx].status = JOBS_FAILED;
    status           = Z("failed");
    remove_job        = CJAR_ALWAYS == mdlg->options.clear_job_after_run_mode;
  }

  jobs[ndx].finished_on = wxGetUTCTime();

  add_to_log(wxString::Format(Z("Finished job ID %d on %s: status '%s'"), jobs[ndx].id, format_date_time(jobs[ndx].finished_on).c_str(), status.c_str()));

  if (remove_job) {
    jobs.erase(jobs.begin() + ndx, jobs.begin() + ndx + 1);
    for (auto idx = 0u; jobs_to_start.size() > idx; ++idx)
      if (jobs_to_start[idx] >= ndx)
        jobs_to_start[idx]--;
  }

  mdlg->save_job_queue();
  delete process;
  process = nullptr;
  out     = nullptr;

  wxRemoveFile(opt_file_name);

  if (!abort)
    g_jobs->SetValue((current_job + 1) * 100);

  start_next_job();
}
开发者ID:CheesyWiggles,项目名称:mkvtoolnix,代码行数:50,代码来源:jobs.cpp

示例9: OnEndDebugeeProcess

void wxLuaDebuggerBase::OnEndDebugeeProcess(wxProcessEvent& event)
{
    //wxPrintf(wxT("OnEndDebugeeProcess the m_debuggeeProcess %p %d exists %d\n"), m_debuggeeProcess, m_debuggeeProcessID, wxProcess::Exists(m_debuggeeProcessID)); fflush(stdout);

    // The process's OnTerminate will null m_debuggeeProcess,
    // but if in destructor it's already NULL and don't send event.
    if (m_debuggeeProcess != NULL)
    {
        wxLuaDebuggerEvent debugEvent(wxEVT_WXLUA_DEBUGGER_EXIT, this);
        debugEvent.SetMessage(wxString::Format(wxT("Process (%d) ended with exit code : %d"), event.GetPid(), event.GetExitCode()));
        wxPostEvent(this, debugEvent);
    }

    event.Skip();
}
开发者ID:oeuftete,项目名称:wx-xword,代码行数:15,代码来源:wxldserv.cpp

示例10: OnTerminate

void MyProcessOutput::OnTerminate(wxProcessEvent &event)
{
    m_wakeup.Stop();
    // show all output
    while (processInput()) {}

    int exit = event.GetExitCode();
    delete m_process;
    m_process = 0;

    m_cancel_process->SetLabel(_("&Close window"));
    wxString msg;
    msg << _("Freshclam exited with code: ") << exit;
    m_logoutput->Append(msg);
}
开发者ID:LZ-SecurityTeam,项目名称:clamav-devel,代码行数:15,代码来源:SigUIMain.cpp

示例11:

void MainWindow::OnFRED2Exited(wxProcessEvent &event) {
	if ( this->FRED2_pid == 0 ) {
		wxLogError(_T("OnFRED2Exited called before there is a process running"));
		return;
	}

	int exitCode = event.GetExitCode();

	wxLogInfo(_T("FRED2 Open exited with a status of %d"), exitCode);

	delete this->process;
	this->process = NULL;
	this->FRED2_pid = 0;
	
	wxButton* fred = dynamic_cast<wxButton*>(
		wxWindow::FindWindowById(ID_FRED_BUTTON, this));
	wxCHECK_RET(fred != NULL, _T("Unable to find FRED button"));
	fred->SetLabel(_T("FRED"));
	fred->Enable();
}
开发者ID:asarium,项目名称:wxlauncher,代码行数:20,代码来源:MainWindow.cpp

示例12: OnEndProcess

void PreviewDlg::OnEndProcess(wxProcessEvent& event) {
	m_thread = NULL;
	if (event.GetExitCode() == -1) return;

	RefreshBrowser(cxUPDATE_REFRESH);
}
开发者ID:baguatuzi,项目名称:e,代码行数:6,代码来源:PreviewDlg.cpp

示例13: OnEndProcess

void frmRestore::OnEndProcess(wxProcessEvent& ev)
{
    ExternProcessDialog::OnEndProcess(ev);

    if (done && viewRunning && !ev.GetExitCode())
    {
        done = false;

        wxString str=wxTextBuffer::Translate(txtMessages->GetValue(), wxTextFileType_Unix);

        wxStringTokenizer line(str, wxT("\n"));
        line.GetNextToken();
        
        wxBeginBusyCursor();

        wxString i18nbackup = _("Backup");
        wxTreeItemId root = ctvObjects->AddRoot(i18nbackup + wxT(" ") + txtFilename->GetValue());
        wxString currentSchema = wxT("");
        wxTreeItemId currentSchemaNode;
        wxTreeItemId schemaNode, lastItem;
        wxTreeItemIdValue schemaNodeData;
        numberOfTOCItems = 0;

        while (line.HasMoreTokens())
        {
            // Read the next line
            str=line.GetNextToken();

            // Skip the few lines of comments
            if (str.Left(1) == wxT(";") || str.Left(1) == wxT("P"))
                continue;

            // Split the line according to spaces
            wxStringTokenizer col(str, wxT(" "));

            // Column 1 (dumpId)
            col.GetNextToken();

            // Column 2 (tableOid)
            col.GetNextToken();

            // Column 3 (oid)
            col.GetNextToken();

            // Column 4 (desc)
            // First interesting information: object's type
            wxString type=col.GetNextToken();

            if (type == wxT("PROCEDURAL"))
            {
                // type for a PL is PROCEDURAL LANGUAGE
                // we'll keep the next column for the object's type
                type = col.GetNextToken();
            }
            else if (type == wxT("SHELL"))
            {
                // type for a SHELL is SHELL TYPE
                // we'll keep both columns for the object's type
                type += col.GetNextToken();
            }
            else if (type == wxT("OPERATOR"))
            {
                // type for an operator class is OPERATOR CLASS
                // we'll keep the two columns for the object's type
                wxString tmp = str.Mid(str.Find(type)+type.Length()+1, 5);
                if (tmp == wxT("CLASS"))
                    type += wxT(" ") + col.GetNextToken();
            }
            else if (type == wxT("SEQUENCE"))
            {
                // type for a sequence can be SEQUENCE, SEQUENCE OWNED BY or SEQUENCE SET
                // we'll keep all these columns for the object's type
                wxString tmp = str.Mid(str.Find(type)+type.Length()+1, 3);
                if (tmp == wxT("OWN") || tmp == wxT("SET"))
                {
                    type += wxT(" ") + col.GetNextToken();
                    if (type == wxT("SEQUENCE OWNED"))
                        type += wxT(" ") + col.GetNextToken();
                }
            }
            else if (type == wxT("FK"))
            {
                // type for a FK is FK CONSTRAINT
                // we'll keep the next column for the object's type
                type = col.GetNextToken();
            }
            else if (type == wxT("TABLE"))
            {
                if (col.CountTokens() == 4)
                {
                    // TABLE DATA detected
                    type += wxT(" ") + col.GetNextToken();
                }
            }

            // Column 5 (namespace)
            // Second interesting information: object's schema
            wxString schema=col.GetNextToken();

            // Column 6 (tag)
//.........这里部分代码省略.........
开发者ID:xiul,项目名称:Database-Designer-for-pgAdmin,代码行数:101,代码来源:frmRestore.cpp

示例14: bmx_wxprocessevent_getexitcode

int bmx_wxprocessevent_getexitcode(wxProcessEvent & event) {
	return event.GetExitCode();
}
开发者ID:GWRon,项目名称:wx.mod,代码行数:3,代码来源:glue.cpp

示例15: bmx_wxprocessevent_getpid

int bmx_wxprocessevent_getpid(wxProcessEvent & event) {
	return event.GetPid();
}
开发者ID:GWRon,项目名称:wx.mod,代码行数:3,代码来源:glue.cpp


注:本文中的wxProcessEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。