本文整理汇总了C++中wxThreadEvent类的典型用法代码示例。如果您正苦于以下问题:C++ wxThreadEvent类的具体用法?C++ wxThreadEvent怎么用?C++ wxThreadEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxThreadEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: OnRemoteCmd
void CDStarRepeaterApp::OnRemoteCmd(wxThreadEvent& event)
{
wxLogMessage("Request to execute command %s (%d)",
m_commandLine[event.GetInt()], event.GetInt());
// XXX sanity check the command line here.
wxShell(m_commandLine[event.GetInt()]);
}
开发者ID:dg0tm,项目名称:OpenDV,代码行数:7,代码来源:DStarRepeaterApp.cpp
示例2: OnResolverResponse
void CMainApp::OnResolverResponse(wxThreadEvent& event)
{
unsigned key = event.GetInt();
unsigned data = event.GetExtraLong();
CContact c = event.GetPayload<CContact>();
CJournalEntry *pE = findActiveEntry(key);
if (pE != NULL) {
if (data == RESOLVE_CALLER) {
pE->setCallerName(c.getSN());
if (pE->getType() == CJournalEntry::J_INCOMING) {
pE->setImage(c.getImage());
}
} else if (data == RESOLVE_CALLED) {
pE->setCalledName(c.getSN());
if (pE->getType() == CJournalEntry::J_OUTGOING) {
pE->setImage(c.getImage());
}
}
m_pJournalModel->insertUpdateEntry(*pE);
}
else {
CJournalEntry e;
if (findJournalEntry(key, e)) {
if (data == RESOLVE_CALLER) e.setCallerName(c.getSN());
if (data == RESOLVE_CALLED) e.setCalledName(c.getSN());
m_pJournalModel->insertUpdateEntry(e);
}
}
}
开发者ID:Sonderstorch,项目名称:c-mon,代码行数:29,代码来源:mainapp.cpp
示例3: onJumpToCalculateComplete
/* TextEditor::onJumpToCalculateComplete
* Called when the 'Jump To' calculation thread completes
*******************************************************************/
void TextEditor::onJumpToCalculateComplete(wxThreadEvent& e)
{
if (!choice_jump_to)
{
jump_to_calculator = nullptr;
return;
}
choice_jump_to->Clear();
jump_to_lines.clear();
string jump_points = e.GetString();
wxArrayString split = wxSplit(jump_points, ',');
wxArrayString items;
for (unsigned a = 0; a < split.size(); a += 2)
{
if (a == split.size() - 1)
break;
long line;
if (!split[a].ToLong(&line))
line = 0;
string name = split[a + 1];
items.push_back(name);
jump_to_lines.push_back(line);
}
choice_jump_to->Append(items);
choice_jump_to->Enable(true);
jump_to_calculator = nullptr;
}
开发者ID:Gaerzi,项目名称:SLADE,代码行数:37,代码来源:TextEditor.cpp
示例4: OnMoveComplete
void MyFrame::OnMoveComplete(wxThreadEvent& event)
{
try
{
Mount *pThisMount = event.GetPayload<Mount *>();
assert(pThisMount->IsBusy());
pThisMount->DecrementRequestCount();
Mount::MOVE_RESULT moveResult = static_cast<Mount::MOVE_RESULT>(event.GetInt());
pMount->LogGuideStepInfo();
if (moveResult != Mount::MOVE_OK)
{
if (moveResult == Mount::MOVE_STOP_GUIDING)
{
Debug.Write("mount move error indicates guiding should stop\n");
pGuider->StopGuiding();
}
throw ERROR_INFO("Error reported moving");
}
}
catch (wxString Msg)
{
POSSIBLY_UNUSED(Msg);
}
}
开发者ID:xeqtr1982,项目名称:phd2,代码行数:28,代码来源:myframe_events.cpp
示例5: OnThumbnailLoadDone
void MainFrame::OnThumbnailLoadDone(wxThreadEvent &event) {
if (event.GetExtraLong() != threadId)
return;
GetStatusBar()->SetStatusText("Idle");
loadThread = nullptr;
}
开发者ID:wutipong,项目名称:ZipPicViewWx,代码行数:7,代码来源:MainFrame.cpp
示例6: OnRBFComplete
void MainFrame::OnRBFComplete(wxThreadEvent& evt)
{
//stopTimer("RBF Stop");
m_RBF = NULL;
m_bRBFrunning = false;
showMessage(evt.GetString());
}
开发者ID:pinetum,项目名称:Ann545,代码行数:7,代码来源:MainFrame.cpp
示例7: OnNewCall
void CMainApp::OnNewCall(wxThreadEvent& event)
{
unsigned pid = event.GetInt();
TEventInfoNewCall info = event.GetPayload<TEventInfoNewCall>();
CJournalEntry *pCall = new CJournalEntry(pid, info.cid, CallType2JournalType(info.type));
pCall->setState(CallState2JournalState(info.status));
m_pJournalModel->insertUpdateEntry(*pCall);
m_ActiveCalls.insert(std::make_pair(TJournalKey(pid, info.cid), pCall));
displayNotification(*pCall);
}
开发者ID:Sonderstorch,项目名称:c-mon,代码行数:10,代码来源:mainapp.cpp
示例8: OnQUERYSequenceEnd
void PMBUSQUERYProgressDialog::OnQUERYSequenceEnd(wxThreadEvent& event){
PSU_DEBUG_PRINT(MSG_DEBUG, "OnQUERYSequenceEnd");
int HasError = event.GetInt();
if (HasError == 1){
PSU_DEBUG_PRINT(MSG_ERROR, "Query Commands Failed ! Please Check PSU Device Status !");
}
// Close Dialog
this->EndModal(wxID_OK);
}
开发者ID:bingshiue,项目名称:wxPSU,代码行数:12,代码来源:PMBUSQUERYProgressDialog.cpp
示例9: OnRBFUpdatePg
void MainFrame::OnRBFUpdatePg(wxThreadEvent& evt)
{
int iteration = evt.GetInt() + 1 ;
int total = m_RBF->m_nTotalIteration;
m_gaugePg->SetValue(100*iteration/total);
m_staticTextPg->SetLabel(wxString::Format("%d/%d", iteration, total));
m_staticTextTimer->SetLabel(getTimer());
}
开发者ID:pinetum,项目名称:Ann545,代码行数:12,代码来源:MainFrame.cpp
示例10: OnNewMessageFromThread
void IndiGui::OnNewMessageFromThread(wxThreadEvent& event)
{
char *message = (char *) event.GetExtraLong();
if (message && strlen(message) > 0) {
textbuffer->SetInsertionPoint(0);
textbuffer->WriteText(wxString::FromAscii(message));
textbuffer->WriteText(_T("\n"));
}
#ifdef INDI_PRE_1_0_0
delete message; //http://sourceforge.net/p/indi/code/1803/
#endif
}
开发者ID:AndresPozo,项目名称:phd2,代码行数:13,代码来源:indi_gui.cpp
示例11: OnCallStateUpdate
void CMainApp::OnCallStateUpdate(wxThreadEvent& event)
{
unsigned pid = event.GetInt();
TEventInfoCallStatus info = event.GetPayload<TEventInfoCallStatus>();
TJournalMap::iterator it = m_ActiveCalls.find(TJournalKey(pid, info.cid));
if (it != m_ActiveCalls.end()) {
if (info.status == TCALL_IDLE) {
delete (it->second);
m_ActiveCalls.erase(it);
} else {
it->second->setState(CallState2JournalState(info.status));
m_pJournalModel->insertUpdateEntry(*(it->second));
}
}
}
开发者ID:Sonderstorch,项目名称:c-mon,代码行数:15,代码来源:mainapp.cpp
示例12: OnNewTextFromThread
void IndiGui::OnNewTextFromThread(wxThreadEvent& event)
{
void *st;
int i;
ITextVectorProperty *tvp = (ITextVectorProperty *) event.GetExtraLong();
//printf("newtext from thread %s \n",tvp->name);
wxString devname = wxString::FromAscii(tvp->device);
wxString propname = wxString::FromAscii(tvp->name);
IndiDev *indiDev = (IndiDev *) devlist[devname];
IndiProp *indiProp = (IndiProp *) indiDev->properties[propname];
for (i = 0; i < tvp->ntp; i++) {
st = indiProp->ctrl[wxString::FromAscii(tvp->tp[i].name)];
wxStaticText *ctrl = (wxStaticText *)st;
ctrl->SetLabel(wxString::Format(wxT("%s"), tvp->tp[i].text));
}
indiProp->state->SetState(tvp->s);
}
开发者ID:AndresPozo,项目名称:phd2,代码行数:17,代码来源:indi_gui.cpp
示例13: OnNewNumberFromThread
void IndiGui::OnNewNumberFromThread(wxThreadEvent& event)
{
void *st;
int i;
INumberVectorProperty *nvp = (INumberVectorProperty *) event.GetExtraLong();
//printf("newnumber from thread %s \n",nvp->name);
wxString devname = wxString::FromAscii(nvp->device);
wxString propname = wxString::FromAscii(nvp->name);
IndiDev *indiDev = (IndiDev *) devlist[devname];
IndiProp *indiProp = (IndiProp *) indiDev->properties[propname];
for (i = 0; i < nvp->nnp; i++) {
st = indiProp->ctrl[wxString::FromAscii(nvp->np[i].name)];
wxStaticText *ctrl = (wxStaticText *)st;
ctrl->SetLabel(wxString::Format(wxT("%f"), nvp->np[i].value));
}
indiProp->state->SetState(nvp->s);
}
开发者ID:AndresPozo,项目名称:phd2,代码行数:17,代码来源:indi_gui.cpp
示例14: OnNewDeviceFromThread
void IndiGui::OnNewDeviceFromThread(wxThreadEvent& event)
{
INDI::BaseDevice *dp = (INDI::BaseDevice *) event.GetExtraLong();
//printf("newdevice from thread %s \n",dp->getDeviceName());
wxString devname = wxString::FromAscii(dp->getDeviceName());
IndiDev *indiDev = new IndiDev();
wxPanel *panel = new wxPanel(parent_notebook);
indiDev->page = new wxNotebook(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_TOP);
wxBoxSizer *nb_sizer = new wxBoxSizer(wxVERTICAL);
panel->SetSizer(nb_sizer);
nb_sizer->Add(indiDev->page, 1, wxEXPAND | wxALL);
parent_notebook->AddPage(panel, devname);
indiDev->dp = dp;
devlist[devname] = indiDev;
panel->Fit();
sizer->Layout();
Fit();
}
开发者ID:AndresPozo,项目名称:phd2,代码行数:18,代码来源:indi_gui.cpp
示例15: OnNewPropertyFromThread
void IndiGui::OnNewPropertyFromThread(wxThreadEvent& event)
{
INDI::Property *property = (INDI::Property *) event.GetExtraLong();
//printf("newproperty from thread %s %s %s\n",property->getDeviceName(),property->getGroupName(),property->getName());
wxString devname = wxString::FromAscii(property->getDeviceName());
wxString groupname = wxString::FromAscii(property->getGroupName());
wxString propname = wxString::FromAscii(property->getName());
IndiProp *indiProp = new IndiProp();
wxPanel *page;
wxGridBagSizer *gbs;
int next_free_row;
IndiDev *indiDev = (IndiDev *)devlist[devname];
if (! indiDev) return;
indiProp->idev = indiDev;
page = (wxPanel *)indiDev->groups[groupname];
if (! page) {
page = new wxPanel(indiDev->page);
indiDev->page->AddPage(page, groupname);
page->SetSizer(new wxGridBagSizer(0, 20));
indiDev->groups[groupname] = page;
}
gbs = (wxGridBagSizer *)page->GetSizer();
gbs->Layout();
next_free_row = gbs->GetRows();
BuildPropWidget(property, page, indiProp);
gbs->Add(indiProp->state, POS(next_free_row, 0), SPAN(1, 1), wxALIGN_LEFT | wxALL);
gbs->Add(indiProp->name, POS(next_free_row, 1), SPAN(1, 1), wxALIGN_LEFT | wxALL);
gbs->Add(indiProp->panel,POS(next_free_row, 2), SPAN(1, 1), wxALIGN_LEFT | wxEXPAND | wxALL);
gbs->Layout();
page->Fit();
panel->Fit();
page->Show();
indiDev->properties[propname] = indiProp;
indiDev->page->Fit();
indiDev->page->Layout();
indiDev->page->Show();
sizer->Layout();
Fit();
}
开发者ID:AndresPozo,项目名称:phd2,代码行数:43,代码来源:indi_gui.cpp
示例16: OnNewSwitchFromThread
void IndiGui::OnNewSwitchFromThread(wxThreadEvent& event)
{
void *st;
int i,idx;
ISwitchVectorProperty *svp = (ISwitchVectorProperty *) event.GetExtraLong();
//printf("newswitch from thread %s \n",svp->name);
wxString devname = wxString::FromAscii(svp->device);
wxString propname = wxString::FromAscii(svp->name);
int swtype = GetSwitchType(svp);
IndiDev *indiDev = (IndiDev *) devlist[devname];
IndiProp *indiProp = (IndiProp *) indiDev->properties[propname];
switch (swtype) {
case SWITCH_COMBOBOX: {
idx=0;
for (i = 0; i < svp->nsp; i++){
if(svp->sp[i].s == ISS_ON)
idx = i;
}
st = indiProp->ctrl[wxString::FromAscii(svp->name)];
wxChoice *combo = (wxChoice *)st;
combo->SetSelection(idx);
break;
}
case SWITCH_CHECKBOX:{
for (i = 0; i < svp->nsp; i++){
st = indiProp->ctrl[wxString::FromAscii(svp->sp[i].name)];
wxCheckBox *button = (wxCheckBox *) st;
button->SetValue(svp->sp[i].s ? true : false);
}
break;
}
case SWITCH_BUTTON:{
for (i = 0; i < svp->nsp; i++){
st = indiProp->ctrl[wxString::FromAscii(svp->sp[i].name)];
wxToggleButton *button = (wxToggleButton *) st;
button->SetValue(svp->sp[i].s ? true : false);
}
break;
}
}
}
开发者ID:AndresPozo,项目名称:phd2,代码行数:41,代码来源:indi_gui.cpp
示例17: OnRemovePropertyFromThread
void IndiGui::OnRemovePropertyFromThread(wxThreadEvent& event)
{
IndiProp *indiProp = (IndiProp *)event.GetExtraLong();
if (! indiProp) return;
IndiDev *indiDev = (IndiDev *) indiProp->idev;
if (! indiDev) return;
wxString propname = indiProp->PropName;
for (int y = 0; y < indiProp->gbs->GetRows(); y++) {
for (int x = 0; x < indiProp->gbs->GetCols(); x++) {
wxGBSizerItem *item = indiProp->gbs->FindItemAtPosition(POS(y, x));
if (item){
indiProp->gbs->Remove(item->GetId());
item->GetWindow()->Destroy();
}
}
}
indiProp->gbs->Layout();
if (indiProp->name)
indiProp->name->Destroy();
if (indiProp->state)
indiProp->state->Destroy();
if (indiProp->panel)
indiProp->panel->Destroy();
if (indiProp->page->GetChildren().GetCount() == 0) {
for (unsigned int i = 0; i < indiDev->page->GetPageCount(); i++) {
if (indiProp->page == indiDev->page->GetPage(i)) {
indiDev->groups.erase(indiDev->page->GetPageText(i));
indiDev->page->DeletePage(i);
break;
}
}
}
delete indiProp;
indiDev->properties.erase(propname);
indiDev->page->Layout();
indiDev->page->Fit();
sizer->Layout();
Fit();
}
开发者ID:AndresPozo,项目名称:phd2,代码行数:40,代码来源:indi_gui.cpp
示例18: OnMoveComplete
void MyFrame::OnMoveComplete(wxThreadEvent& event)
{
try
{
Mount *mount = event.GetPayload<Mount *>();
assert(mount->IsBusy());
mount->DecrementRequestCount();
Mount::MOVE_RESULT moveResult = static_cast<Mount::MOVE_RESULT>(event.GetInt());
mount->LogGuideStepInfo();
// deliver the outstanding GuidingStopped notification if this is a late-arriving
// move completion event
if (!pGuider->IsCalibratingOrGuiding() &&
(!pMount || !pMount->IsBusy()) &&
(!pSecondaryMount || !pSecondaryMount->IsBusy()))
{
pFrame->NotifyGuidingStopped();
}
if (moveResult != Mount::MOVE_OK)
{
mount->IncrementErrorCount();
if (moveResult == Mount::MOVE_STOP_GUIDING)
{
Debug.Write("mount move error indicates guiding should stop\n");
pGuider->StopGuiding();
}
throw ERROR_INFO("Error reported moving");
}
}
catch (const wxString& Msg)
{
POSSIBLY_UNUSED(Msg);
}
}
开发者ID:agalasso,项目名称:phd2_qhy,代码行数:39,代码来源:myframe_events.cpp
示例19: OnWorkerEvent
void MyFrame::OnWorkerEvent(wxThreadEvent& event)
{
int n = event.GetInt();
if ( n == -1 )
{
m_dlgProgress->Destroy();
m_dlgProgress = (wxProgressDialog *)NULL;
// the dialog is aborted because the event came from another thread, so
// we may need to wake up the main event loop for the dialog to be
// really closed
wxWakeUpIdle();
}
else
{
if ( !m_dlgProgress->Update(n) )
{
wxCriticalSectionLocker lock(m_csCancelled);
m_cancelled = true;
}
}
}
开发者ID:ruifig,项目名称:nutcracker,代码行数:23,代码来源:thread.cpp
示例20: OnCallInfoUpdate
void CMainApp::OnCallInfoUpdate(wxThreadEvent& event)
{
unsigned pid = event.GetInt();
TEventInfoCallInfo info = event.GetPayload<TEventInfoCallInfo>();
TJournalMap::iterator it = m_ActiveCalls.find(TJournalKey(pid, info.cid));
if (it != m_ActiveCalls.end())
{
CJournalEntry *pJ = it->second;
if (pJ->getCalledName().IsEmpty()) {
pJ->setCalledName(info.info.m_strCalledName);
}
if (pJ->getCallerName().IsEmpty()) {
pJ->setCallerName(info.info.m_strCallerName);
}
if (pJ->getCalledAddress().IsEmpty() && !info.info.m_strCalledAddress.empty()) {
ResolveCalled(info.info.m_strCalledAddress, pJ);
}
if (pJ->getCallerAddress().IsEmpty() && !info.info.m_strCallerAddress.empty()) {
ResolveCaller(info.info.m_strCallerAddress, pJ);
}
m_pJournalModel->insertUpdateEntry(*pJ);
}
}
开发者ID:Sonderstorch,项目名称:c-mon,代码行数:23,代码来源:mainapp.cpp
注:本文中的wxThreadEvent类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论