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


C++ wxCommandEvent::GetClientData方法代码示例

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


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

示例1: OnFileLoaded

void ClangCodeCompletion::OnFileLoaded(wxCommandEvent& e)
{
    e.Skip();
    CHECK_CLANG_ENABLED_RET();

    if(TagsManagerST::Get()->GetCtagsOptions().GetClangCachePolicy() == TagsOptionsData::CLANG_CACHE_ON_FILE_LOAD) {
        CL_DEBUG(wxT("ClangCodeCompletion::OnFileLoaded() START"));
        if(m_clang.IsBusy() || m_allEditorsAreClosing) {
            CL_DEBUG(wxT("ClangCodeCompletion::OnFileLoaded() ENDED"));
            return;
        }
        if(e.GetClientData()) {
            IEditor *editor = (IEditor*)e.GetClientData();
            // sanity
            if(editor->GetProjectName().IsEmpty() || editor->GetFileName().GetFullName().IsEmpty())
                return;

            if(!TagsManagerST::Get()->IsValidCtagsFile(editor->GetFileName()))
                return;

            m_clang.SetContext(CTX_CachePCH);
            m_clang.CodeCompletion(editor);
        }
        CL_DEBUG(wxT("ClangCodeCompletion::OnFileLoaded() ENDED"));
    }
}
开发者ID:ecmadrid,项目名称:codelite,代码行数:26,代码来源:clang_code_completion.cpp

示例2: OnUpdateReceived

void MainFrame::OnUpdateReceived(wxCommandEvent& event) 
{
	std::string data = *(std::string*)event.GetClientData();
	delete (std::string*)event.GetClientData();
	size_t first_colon = data.find(':');
	size_t second_colon = data.find(':', first_colon+1);

	if(first_colon == std::string::npos || second_colon == std::string::npos) 
		return;

	std::string update = data.substr(0, first_colon);
	std::string verstr = data.substr(first_colon+1, second_colon-first_colon-1);
	std::string url = (second_colon == data.size()? "" : data.substr(second_colon+1));

	if(update == "yes") 
	{
		int ret = gui.PopupDialog(
			wxT("Update Notice"),
			wxString(wxT("There is a newd update available (")) << wxstr(verstr) << 
			wxT("). Do you want to go to the website and download it?"),
			wxYES | wxNO,
			wxT("I don't want any update notices"),
			Config::AUTOCHECK_FOR_UPDATES
			);
		if(ret == wxID_YES)
			::wxLaunchDefaultBrowser(wxstr(url),  wxBROWSER_NEW_WINDOW);
	}
}
开发者ID:LaloHao,项目名称:rme,代码行数:28,代码来源:application.cpp

示例3: switch

void console::ted_cmd::OnGUInput(wxCommandEvent& evt) {
   switch (evt.GetInt()) {
      case -4: _translation.FlipY();break;
      case -3: _translation.Rotate(90.0);break;
      case -2: cancelLastPoint();break;
      case -1:   // abort current  mouse input
         Disconnect(-1, wxEVT_COMMAND_ENTER);
         delete puc; puc = NULL;
         _mouseIN_OK = false;
         tell_log(MT_WARNING, "input aborted");
         tell_log(MT_EOL);
         // wake-up the thread expecting this data
         threadWaits4->Signal();
         break;
      case  0:  {// left mouse button
         telldata::ttpnt* p = static_cast<telldata::ttpnt*>(evt.GetClientData());
         mouseLB(*p);
         delete p;
         break;
         }
      case  2: {
         telldata::ttpnt* p = static_cast<telldata::ttpnt*>(evt.GetClientData());
         mouseRB(); 
         delete p;
         break;
         }
      default: assert(false);
   }
}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:29,代码来源:ted_prompt.cpp

示例4: OnSessionList

/*!
 * Handle events from SessionList
 */
void SessionAdmin::OnSessionList(wxCommandEvent& event)
{
    long idx;
    MySession *s;
    switch (event.GetInt()) {
        case SessionList::SessionAdded:
            s = wxDynamicCast((void *)event.GetClientData(), MySession);
            // Hostname
            idx = m_SessionListCtrl->InsertItem(0, s->sGetHost(), 0);
            m_SessionListCtrl->SetItemData(idx, (long)s);
            // Port
            m_SessionListCtrl->SetItem(idx, 1, s->sGetPort());
            // Session ID
            m_SessionListCtrl->SetItem(idx, 2, s->sGetMd5());
            // Creation Time
            m_SessionListCtrl->SetItem(idx, 3, s->sGetCreationTime());
            // PID
            m_SessionListCtrl->SetItem(idx, 4, s->sGetPID());
            // Status
            m_SessionListCtrl->SetItem(idx, 5, s->sGetSessionStatus());
            // Type
            m_SessionListCtrl->SetItem(idx, 6, s->sGetSessionType());
            break;
        case SessionList::SessionChanged:
            s = wxDynamicCast((void *)event.GetClientData(), MySession);
            idx = m_SessionListCtrl->FindItem(-1, (long)s);
            ::myLogTrace(MYTRACETAG, wxT("state changed: %d"), idx);
            if (idx != -1) {
                m_SessionListCtrl->SetItem(idx, 3, s->sGetCreationTime());
                m_SessionListCtrl->SetItem(idx, 4, s->sGetPID());
                m_SessionListCtrl->SetItem(idx, 5, s->sGetSessionStatus());
                if (m_SessionListCtrl->GetItemState(idx, wxLIST_STATE_SELECTED)) {
                    bool running = (s->eGetSessionStatus() == MySession::Running);
                    SessionToolsEnable(true, running);
                }
            }
            break;
        case SessionList::SessionRemoved:
            idx = m_SessionListCtrl->FindItem(-1, (long)event.GetClientData());
            if (idx != -1) {
                m_SessionListCtrl->DeleteItem(idx);
            }
            break;
        case SessionList::UpdateList:
#ifndef __WXMAC__ // On OSX, this messes up column headers
            {
                int width = m_SessionListCtrl->GetItemCount() ?
                    wxLIST_AUTOSIZE : wxLIST_AUTOSIZE_USEHEADER;
                for (int i = 0; i < m_SessionListCtrl->GetColumnCount(); i++) 
                    m_SessionListCtrl->SetColumnWidth(i, width);
            }
#endif
            m_SessionListCtrl->Update();
            break;
    }
}
开发者ID:carriercomm,项目名称:opennx-1,代码行数:59,代码来源:SessionAdmin.cpp

示例5: switch

void browsers::browserTAB::OnCommand(wxCommandEvent& event) {
   int command = event.GetInt();
   switch (command) {
      case BT_ADDTDT_TAB:OnTELLaddTDTtab(event.GetString(), 
                            (laydata::TDTHierTree*)event.GetClientData());break;
      case BT_ADDGDS_TAB:OnTELLaddGDStab(event.GetString(), 
                            (GDSin::GDSHierTree*)event.GetClientData());break;
      case BT_CLEARGDS_TAB:OnTELLclearGDStab(); break;
   }
}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:10,代码来源:browsers.cpp

示例6: switch

void browsers::TDTbrowser::OnCommand(wxCommandEvent& event) {
   switch (event.GetInt()) {
      case BT_CELL_OPEN:OnTELLopencell(event.GetString());break;
      case BT_CELL_HIGHLIGHT:OnTELLhighlightcell(event.GetString());break;
      case BT_CELL_ADD :OnTELLaddcell(event.GetString(), 
          *((wxString*)event.GetClientData()), (int)event.GetExtraLong());
          delete ((wxString*)event.GetClientData()); break;
      case BT_CELL_REMOVE:OnTELLremovecell(event.GetString(), 
          *((wxString*)event.GetClientData()), (0 != event.GetExtraLong()));
          delete ((wxString*)event.GetClientData()); break;

   }   
}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:13,代码来源:browsers.cpp

示例7: OnClickResult

void SearchResultWindow::OnClickResult(wxCommandEvent& event)
{
	Position* pos = reinterpret_cast<Position*>(event.GetClientData());
	if(pos) {
		gui.CenterOnPosition(*pos);
	}
}
开发者ID:OMARTINEZ210,项目名称:rme,代码行数:7,代码来源:result_window.cpp

示例8: HandleCommand

	void HandleCommand(wxCommandEvent& event)
	{
		event.Skip();

		switch(event.GetId())
		{
		case DID_STOP_EMU:
			m_btn_run->SetLabel("Run");
		break;

		case DID_PAUSE_EMU:
			m_btn_run->SetLabel("Resume");
		break;

		case DID_START_EMU:
		case DID_RESUME_EMU:
			m_btn_run->SetLabel("Pause");
		break;

		case DID_EXIT_THR_SYSCALL:
			Emu.GetCPU().RemoveThread(((PPCThread*)event.GetClientData())->GetId());
		break;
		}

		UpdateUI();
	}
开发者ID:MorganCabral,项目名称:rpcs3,代码行数:26,代码来源:Debugger.cpp

示例9: OnNewEntry

void wxJADFrame::OnNewEntry( wxCommandEvent & event )
{
	wprintf( wxT( "New entry received...\n" ) );
	JadEntry * pEntry = ( JadEntry * ) event.GetClientData();
	if( pEntry != NULL )
		tree->AddEntry( pEntry );
}
开发者ID:goughy,项目名称:wxJAD,代码行数:7,代码来源:wxJADFrame.cpp

示例10: OnTargetComplete

void dlgDirectDbg::OnTargetComplete( wxCommandEvent &event )
{
	// Extract the result set handle from the event and log the status info

	PGresult    *result = (PGresult *)event.GetClientData();

	wxLogInfo( wxT( "OnTargetComplete() called\n" ));
	wxLogInfo( wxT( "%s\n" ), wxString(PQresStatus( PQresultStatus( result )), wxConvUTF8).c_str());

	// If the query failed, write the error message to the status line, otherwise, copy the result set into the grid
	if(( PQresultStatus( result ) == PGRES_NONFATAL_ERROR ) || ( PQresultStatus( result ) == PGRES_FATAL_ERROR ))
	{
		wxString    message( PQresultErrorMessage( result ), wxConvUTF8 );

		message.Replace( wxT( "\n" ), wxT( " " ));

		m_parent->getStatusBar()->SetStatusText( message, 1 );
		char *state = PQresultErrorField(result, PG_DIAG_SQLSTATE);

		// Don't bother telling the user that he aborted - he already knows!
		// Depending on the stage, m_conn might not be set all! so check for
		// that first
		if (m_conn)
		{
			if (state != NULL && strcmp(state, "57014"))
				wxLogError( wxT( "%s\n" ), wxString(PQerrorMessage(m_conn->getConnection()), wxConvUTF8).c_str());
			else
				wxLogInfo( wxT( "%s\n" ), wxString(PQerrorMessage(m_conn->getConnection()), wxConvUTF8).c_str());
		}
	}
	else
	{
		wxString message( PQcmdStatus( result ), wxConvUTF8 );

		message.Replace( wxT( "\r" ), wxT( "" ));
		message.Replace( wxT( "\n" ), wxT( " " ));

		m_parent->getStatusBar()->SetStatusText( message, 1 );

		// If this result set has any columns, add a result grid to the code window so
		// we can show the results to the user

		if( m_codeWindow && PQnfields( result ))
		{
			m_codeWindow->OnResultSet( result );
		}
	}

	if (m_codeWindow)
	{
		m_codeWindow->m_targetComplete = true;
		m_codeWindow->disableTools( );
	}

	// Do not show if aborted
	if ( m_codeWindow && m_codeWindow->m_targetAborted )
		return;

	this->Show( true );
}
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:60,代码来源:dlgDirectDbg.cpp

示例11: OnSelectUnit

void InterpreterDisAsmFrame::OnSelectUnit(wxCommandEvent& event)
{
	m_disasm.reset();

	if (cpu = (cpu_thread*)event.GetClientData())
	{
		switch (cpu->type)
		{
		case cpu_type::ppu:
		{
			m_disasm = std::make_unique<PPUDisAsm>(CPUDisAsm_InterpreterMode);
			break;
		}

		case cpu_type::spu:
		{
			m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
			break;
		}

		case cpu_type::arm:
		{
			m_disasm = std::make_unique<ARMv7DisAsm>(CPUDisAsm_InterpreterMode);
			break;
		}
		}
	}

	DoUpdate();
}
开发者ID:DreadIsBack,项目名称:rpcs3,代码行数:30,代码来源:InterpreterDisAsm.cpp

示例12: OnIpcClosed

void ApiHandler::OnIpcClosed(wxCommandEvent& event) {
	IConnection* conn = (IConnection*)event.GetClientData();
	if (!conn) return;

	// Remove all notifiers from closed connection
	map<unsigned int, IConnection*>::iterator p = m_notifiers.begin();
	while (p != m_notifiers.end()) {
		if (p->second == conn) m_notifiers.erase(p++);
		else ++p;
	}

	boost::ptr_map<IConnection*, ConnectionState>::const_iterator c = m_connStates.find(conn);
	if (c != m_connStates.end()) {
		// If any editors are still in a change group, we have to release them
		const set<int>& editorsInChange = c->second->editorsInChange;
		if (!editorsInChange.empty()) {
			for (set<int>::const_iterator e = editorsInChange.begin(); e != editorsInChange.end(); ++e) {
				EditorCtrl* editor = m_app.GetEditorCtrl(*e);
				if (editor) editor->EndChange();
			}
		}
	}

	// Clear any associated state
	m_connStates.erase(conn);
}
开发者ID:BBkBlade,项目名称:e,代码行数:26,代码来源:ApiHandler.cpp

示例13: OnClangProcessTerminated

void ClangMacroHandler::OnClangProcessTerminated(wxCommandEvent& e)
{
    ProcessEventData *ped = (ProcessEventData *)e.GetClientData();
    delete ped;
    if( m_process ) {
        delete m_process;
        m_process = NULL;
    }

    wxString macrosAsString;
    wxArrayString lines = ::wxStringTokenize(m_output, wxT("\n\r"), wxTOKEN_STRTOK);
    for(size_t i=0; i<lines.GetCount(); i++) {
        wxString rest;
        if(lines.Item(i).StartsWith(wxT("MACRO:"), &rest)) {
            rest.Trim().Trim(false);
            macrosAsString << wxT(" ") << rest;
        }
    }

    // Process the output here...
    CL_DEBUG(wxT("ClangMacroHandler: Macros collected: %s"), macrosAsString.c_str());

    if(m_editor) {
        // Scintilla preprocessor management
        m_editor->GetSTC()->SetProperty(wxT("lexer.cpp.track.preprocessor"),  wxT("1"));
        m_editor->GetSTC()->SetProperty(wxT("lexer.cpp.update.preprocessor"), wxT("1"));
        m_editor->GetSTC()->SetKeyWords(4, macrosAsString);
        m_editor->GetSTC()->Colourise(0, wxSTC_INVALID_POSITION);
    }

    wxCommandEvent evt(wxEVT_CMD_CLANG_MACRO_HADNLER_DELETE);
    evt.SetClientData(this);
    EventNotifier::Get()->AddPendingEvent(evt);
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:34,代码来源:clang_macro_handler.cpp

示例14: OnSelectUnit

void InterpreterDisAsmFrame::OnSelectUnit(wxCommandEvent& event)
{
	CPU = (PPCThread*)event.GetClientData();

	delete decoder;
	//delete disasm;
	decoder = nullptr;
	disasm = nullptr;

	if(CPU)
	{
		if(CPU->GetType() != PPC_THREAD_PPU)
		{
			SPU_DisAsm& dis_asm = *new SPU_DisAsm(*CPU, InterpreterMode);
			decoder = new SPU_Decoder(dis_asm);
			disasm = &dis_asm;
		}
		else
		{
			PPU_DisAsm& dis_asm = *new PPU_DisAsm(*CPU, InterpreterMode);
			decoder = new PPU_Decoder(dis_asm);
			disasm = &dis_asm;
		}
	}

	DoUpdate();
}
开发者ID:Deidara387,项目名称:rpcs3,代码行数:27,代码来源:InterpreterDisAsm.cpp

示例15: OnViewInComparisonDB

void CompareDlg::OnViewInComparisonDB(wxCommandEvent& evt)
{
  ContextMenuData* menuContext = reinterpret_cast<ContextMenuData*>(evt.GetClientData());
  const ComparisonGridTable& table = *wxDynamicCast(menuContext->cdata->grid->GetTable(), ComparisonGridTable);
  const pws_os::CUUID& uuid = table[menuContext->selectedRows[0]].uuid1;
  wxCHECK_RET(ViewEditEntry(m_otherCore, uuid, true) == false, wxT("Should not need to refresh grid for just viewing entry"));
}
开发者ID:Safari77,项目名称:lumimaja,代码行数:7,代码来源:CompareDlg.cpp


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