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