本文整理汇总了C++中wxThreadEvent类的典型用法代码示例。如果您正苦于以下问题:C++ wxThreadEvent类的具体用法?C++ wxThreadEvent怎么用?C++ wxThreadEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxThreadEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()]);
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
示例5: OnThumbnailLoadDone
void MainFrame::OnThumbnailLoadDone(wxThreadEvent &event) {
if (event.GetExtraLong() != threadId)
return;
GetStatusBar()->SetStatusText("Idle");
loadThread = nullptr;
}
示例6: OnRBFComplete
void MainFrame::OnRBFComplete(wxThreadEvent& evt)
{
//stopTimer("RBF Stop");
m_RBF = NULL;
m_bRBFrunning = false;
showMessage(evt.GetString());
}
示例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);
}
示例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);
}
示例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());
}
示例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
}
示例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));
}
}
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}