这篇教程C++ wxQueueEvent函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wxQueueEvent函数的典型用法代码示例。如果您正苦于以下问题:C++ wxQueueEvent函数的具体用法?C++ wxQueueEvent怎么用?C++ wxQueueEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wxQueueEvent函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wxThreadEventwxThread::ExitCode ThumbnailLoadThread::Entry() { for (auto i = 0; i < entries.size(); ++i) { if (TestDestroy()) break; auto entry = entries[i]; auto image = entry->LoadImage(); auto longerSide = image.GetWidth() > image.GetHeight() ? image.GetWidth() : image.GetHeight(); auto width = 200 * image.GetWidth() / longerSide; auto height = 200 * image.GetHeight() / longerSide; auto thumbnailImage = image.Scale(width, height, wxIMAGE_QUALITY_HIGH); auto event = new wxThreadEvent(wxEVT_COMMAND_THMBTREAD_UPDATE); ThumbnailData data; data.index = i; data.image = thumbnailImage; data.total = entries.size(); event->SetPayload(data); wxQueueEvent(m_pHandler, event); } wxQueueEvent(m_pHandler, new wxThreadEvent(wxEVT_COMMAND_THMBTREAD_DONE)); return (wxThread::ExitCode)0;}
开发者ID:tmwatchanan,项目名称:ZipPicViewWx,代码行数:28,
示例2: LOG_MESSAGE/* VersionCheck::Entry * VersionCheck thread entry function *******************************************************************/wxThread::ExitCode VersionCheck::Entry(){ LOG_MESSAGE(3, "Starting VersionCheck thread"); // Init HTTP wxHTTP http; http.SetHeader("Content-type", "text/html; charset=utf-8"); http.SetTimeout(10); // Wait for connection LOG_MESSAGE(3, "VersionCheck: Testing connection..."); int attempt_count = 0; while (!http.Connect("slade.mancubus.net")) { LOG_MESSAGE(3, "VersionCheck: No connection, waiting 1 sec"); wxSleep(1); // Max connection attempts if (attempt_count++ > 5) { // Send (failed) event wxThreadEvent* event = new wxThreadEvent(wxEVT_COMMAND_VERSIONCHECK_COMPLETED); event->SetString("connect_failed"); wxQueueEvent(handler, event); return NULL; } } // Get version info LOG_MESSAGE(3, "VersionCheck: Retrieving version information..."); wxInputStream* stream = http.GetInputStream("/version.txt"); string version; if (http.GetError() == wxPROTO_NOERR) { wxStringOutputStream out(&version); stream->Read(out); LOG_MESSAGE(3, "VersionCheck: Got version info:/n%s", version); } else { LOG_MESSAGE(3, "VersionCheck: Error connecting to slade.mancubus.net"); } // Clean up delete stream; http.Close(); // Send event wxThreadEvent* event = new wxThreadEvent(wxEVT_COMMAND_VERSIONCHECK_COMPLETED); event->SetString(version); wxQueueEvent(handler, event); return NULL;}
开发者ID:Blzut3,项目名称:SLADE,代码行数:59,
示例3: wxThreadEventvoid ZLauncherFrame::ApplyPatchProgress(const float& Percentage){ wxThreadEvent* updateProgressTextEvent = new wxThreadEvent(wxEVT_COMMAND_UPDATE_PROGRESS_TEXT); updateProgressTextEvent->SetString(wxT("Applying Patch, Please Wait...")); wxQueueEvent(wxTheApp->GetTopWindow()->GetEventHandler(), updateProgressTextEvent); wxThreadEvent* updateProgressBarEvent = new wxThreadEvent(wxEVT_COMMAND_UPDATE_PROGRESS_BAR); updateProgressBarEvent->SetInt(Percentage); wxQueueEvent(wxTheApp->GetTopWindow()->GetEventHandler(), updateProgressBarEvent);}
开发者ID:TheZoc,项目名称:ZPatcher,代码行数:10,
示例4: wxThreadEventvoid CreatePatchFrame::UpdatePatchProcessedDisplay(const float& Percentage, const uint64_t& leftAmount, const uint64_t& rightAmount){ wxThreadEvent* updateProgressBarEvent = new wxThreadEvent(wxEVT_COMMAND_UPDATE_PATCH_PROCCESS_PROGRESSBAR); updateProgressBarEvent->SetInt(static_cast<int>(Percentage)); wxQueueEvent(wxTheApp->GetTopWindow()->GetEventHandler(), updateProgressBarEvent); wxThreadEvent* updateProgressTextEvent = new wxThreadEvent(wxEVT_COMMAND_UPDATE_PATCH_PROCCESS_COMPARISON_TEXT); updateProgressTextEvent->SetString(wxString::Format("%llu / %llu", leftAmount, rightAmount)); wxQueueEvent(wxTheApp->GetTopWindow()->GetEventHandler(), updateProgressTextEvent);}
开发者ID:gOreteQ,项目名称:ZPatcher,代码行数:10,
示例5: wxQueueEventwxThread::ExitCode wxGISMapView::Entry(){ wxEvtHandler* pEHandle = this->GetEventHandler();//dynamic_cast<wxEvtHandler*>(GetApplication());wxApp::GetInstance();// //GetEventHandler()->QueueEvent(new wxThreadEvent(wxEVT_MAP_DRAWING_START)); wxQueueEvent(pEHandle, new wxMxMapViewEvent(wxMXMAP_DRAWING_START)); //draw geo data OnDraw(wxGISDPGeography); //draw selection //draw anno wxQueueEvent(pEHandle, new wxMxMapViewEvent(wxMXMAP_DRAWING_STOP)); return (wxThread::ExitCode)wxTHREAD_NO_ERROR; // success}
开发者ID:Mileslee,项目名称:wxgis,代码行数:12,
示例6: curl_easy_getinfoint ZLauncherFrame::TransferInfo(void *p, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow){ DownloadFileWriter* filewriter = (DownloadFileWriter*)p; CURL *curl = filewriter->GetCurlHandle(); double curtime = 0; double speed = 0; curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &curtime); curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &speed); int percentage = (dltotal == 0) ? 0 : (int)(((float)dlnow / (float)dltotal) * 100); std::ostringstream oss_speed; oss_speed << std::fixed << std::setprecision(2); if (speed > 1048576) { speed /= 1048576; oss_speed << speed << " MiB/s"; } else if (speed > 1024) { speed /= 1024; oss_speed << speed << " KiB/s"; } else { oss_speed << speed << " B/s"; } wxThreadEvent* updateProgressBarEvent = new wxThreadEvent(wxEVT_COMMAND_UPDATE_PROGRESS_BAR); updateProgressBarEvent->SetInt(percentage); wxQueueEvent(wxTheApp->GetTopWindow()->GetEventHandler(), updateProgressBarEvent); if ((curtime - filewriter->GetLastUpdateTime()) >= 0.1f) { filewriter->SetLastUpdateTime(curtime); wxThreadEvent* updateProgressTextEvent = new wxThreadEvent(wxEVT_COMMAND_UPDATE_PROGRESS_TEXT); updateProgressTextEvent->SetString(wxString::Format("Downloading %s (%s)", filewriter->GetDestFileName(), oss_speed.str().c_str())); wxQueueEvent(wxTheApp->GetTopWindow()->GetEventHandler(), updateProgressTextEvent); } // Check if we should stop the thread and cancel it here! if (filewriter->GetParentThread() && filewriter->GetParentThread()->TestDestroy()) { return 1; } return 0;}
开发者ID:TheZoc,项目名称:ZPatcher,代码行数:49,
示例7: wxLogMessagewxThread::ExitCode MyGUIThread::Entry(){ // uncomment this to check that disabling logging here does disable it for // this thread -- but not the main one if you also comment out wxLogNull // line in MyFrame::OnStartGUIThread() //wxLogNull noLog; // this goes to the main window wxLogMessage("GUI thread starting"); // use a thread-specific log target for this thread to show that its // messages don't appear in the main window while it runs wxLogBuffer logBuf; wxLog::SetThreadActiveTarget(&logBuf); for (int i=0; i<GUITHREAD_NUM_UPDATES && !TestDestroy(); i++) { // inform the GUI toolkit that we're going to use GUI functions // from a secondary thread: wxMutexGuiEnter(); { wxCriticalSectionLocker lock(m_dlg->m_csBmp); // draw some more stuff on the bitmap wxMemoryDC dc(m_dlg->m_bmp); dc.SetBrush((i%2)==0 ? *wxBLUE_BRUSH : *wxGREEN_BRUSH); dc.DrawRectangle(rand()%GUITHREAD_BMP_SIZE, rand()%GUITHREAD_BMP_SIZE, 30, 30); // simulate long drawing time: wxMilliSleep(200); } // if we don't release the GUI mutex the MyImageDialog won't be able to refresh wxMutexGuiLeave(); // notify the dialog that another piece of our masterpiece is complete: wxThreadEvent event( wxEVT_THREAD, GUITHREAD_EVENT ); event.SetInt(i+1); wxQueueEvent( m_dlg, event.Clone() ); if ( !((i + 1) % 10) ) { // this message will go to the buffer wxLogMessage("Step #%d.", i + 1); } // give the main thread the time to refresh before we lock the GUI mutex again // FIXME: find a better way to do this! wxMilliSleep(100); } // now remove the thread-specific thread target wxLog::SetThreadActiveTarget(NULL); // so that this goes to the main window again wxLogMessage("GUI thread finished."); return (ExitCode)0;}
开发者ID:ruifig,项目名称:nutcracker,代码行数:60,
示例8: wxThreadEventvoid WorkerThread::SendWorkerThreadMoveComplete(Mount *pMount, Mount::MOVE_RESULT moveResult){ wxThreadEvent *event = new wxThreadEvent(wxEVT_THREAD, MYFRAME_WORKER_THREAD_MOVE_COMPLETE); event->SetInt(moveResult); event->SetPayload<Mount *>(pMount); wxQueueEvent(m_pFrame, event);}
开发者ID:simonct,项目名称:phd2,代码行数:7,
示例9: wxASSERT_MSGvoid wxFsEventsFileSystemWatcher::PostChange(const wxFileName& oldFileName, const wxFileName& newFileName, int event){ wxASSERT_MSG(this->GetOwner(), "owner must exist"); if ( !this->GetOwner() ) { return; } // FSEvents flags are a bit mask, but wx FSW events // are not, meaning that FSEvent flag might be // kFSEventStreamEventFlagItemCreated | kFSEventStreamEventFlagItemInodeMetaMod // this means we must send 2 events not 1. int allEvents[6] = { wxFSW_EVENT_CREATE, wxFSW_EVENT_DELETE, wxFSW_EVENT_RENAME, wxFSW_EVENT_MODIFY, wxFSW_EVENT_ACCESS, wxFSW_EVENT_ATTRIB }; for ( int i = 0; i < WXSIZEOF(allEvents); i++ ) { if ( event & allEvents[i] ) { wxFileSystemWatcherEvent* evt = new wxFileSystemWatcherEvent( allEvents[i], oldFileName, newFileName ); wxQueueEvent(this->GetOwner(), evt); } }}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:33,
示例10: eventvoid MyWorkerThread::emit_event(int status, const wxString& msg) { wxThreadEvent event(wxEVT_THREAD, WORKER_EVENT); event.SetPayload(m_task); event.SetString(msg); event.SetInt(status); wxQueueEvent(m_frame, event.Clone());}
开发者ID:jcasse,项目名称:xperimenter,代码行数:7,
示例11: Report REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_UNDEFINED ) override { wxCommandEvent* event = new wxCommandEvent( EVT_SIM_REPORT ); event->SetString( aText ); wxQueueEvent( m_parent, event ); return *this; }
开发者ID:miloh,项目名称:kicad-source-mirror,代码行数:7,
示例12: GetTracevoid SIM_PLOT_PANEL::EnableCursor( const wxString& aName, bool aEnable ){ TRACE* t = GetTrace( aName ); if( t == nullptr || t->HasCursor() == aEnable ) return; if( aEnable ) { CURSOR* c = new CURSOR( t ); int plotCenter = GetMarginLeft() + ( GetXScreen() - GetMarginLeft() - GetMarginRight() ) / 2; c->SetX( plotCenter ); t->SetCursor( c ); AddLayer( c ); } else { CURSOR* c = t->GetCursor(); t->SetCursor( NULL ); DelLayer( c, true ); } // Notify the parent window about the changes wxQueueEvent( GetParent(), new wxCommandEvent( EVT_SIM_CURSOR_UPDATE ) );}
开发者ID:miloh,项目名称:kicad-source-mirror,代码行数:25,
示例13: signal_user1void signal_user1(int){ //Envoi d'un évènement pour afficher les préférences. wxCommandEvent *event = new wxCommandEvent(wxEVT_COMMAND_MENU_SELECTED, ID_PREFERENCES); wxQueueEvent(evtHandlerMain, event);}
开发者ID:antoine163,项目名称:Talv,代码行数:7,
示例14: wxQueueEventvoid SIM_PLOT_FRAME::onTune( wxCommandEvent& event ){ if( m_schematicFrame == NULL ) return; wxQueueEvent( m_schematicFrame, new wxCommandEvent( wxEVT_TOOL, ID_SIM_TUNE ) ); m_schematicFrame->Raise();}
开发者ID:miloh,项目名称:kicad-source-mirror,代码行数:8,
示例15: eventvoid CMainApp::resolverResponse(unsigned cid, unsigned data, const CContact& contact){ wxThreadEvent event( wxEVT_THREAD, RESOLVER_RESPONSE ); event.SetInt(cid); event.SetExtraLong(data); event.SetPayload(contact); wxQueueEvent(this, event.Clone());}
开发者ID:Sonderstorch,项目名称:c-mon,代码行数:8,
示例16: run_wx_gui_from_dllvoid run_wx_gui_from_dll(const char *title){ // In order to prevent conflicts with hosting app's event loop, we // launch wx app from the DLL in its own thread. // // We can't even use wxInitializer: it initializes wxModules and one of // the modules it handles is wxThread's private module that remembers // ID of the main thread. But we need to fool wxWidgets into thinking that // the thread we are about to create now is the main thread, not the one // from which this function is called. // // Note that we cannot use wxThread here, because the wx library wasn't // initialized yet. wxCriticalSection is safe to use, though. wxCriticalSectionLocker lock(gs_wxStartupCS); if ( !gs_wxMainThread ) { HANDLE hEvent = CreateEvent ( NULL, // default security attributes FALSE, // auto-reset FALSE, // initially non-signaled NULL // anonymous ); if ( !hEvent ) return; // error // NB: If your compiler doesn't have _beginthreadex(), use CreateThread() gs_wxMainThread = (HANDLE)_beginthreadex ( NULL, // default security 0, // default stack size &MyAppLauncher, &hEvent, // arguments 0, // create running NULL ); if ( !gs_wxMainThread ) { CloseHandle(hEvent); return; // error } // Wait until MyAppLauncher signals us that wx was initialized. This // is because we use wxMessageQueue<> and wxString later and so must // be sure that they are in working state. WaitForSingleObject(hEvent, INFINITE); CloseHandle(hEvent); } // Send a message to wx thread to show a new frame: wxThreadEvent *event = new wxThreadEvent(wxEVT_THREAD, CMD_SHOW_WINDOW); event->SetString(title); wxQueueEvent(wxApp::GetInstance(), event);}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:58,
示例17: evtvoid UartThread::NotifyDownloadProgress(const wxString &image, int progress){ wxThreadEvent evt(wxEVT_COMMAND_THREAD, _threadEventId); UartMessage response(UART_EVENT_DOWNLOAD_PROGRESS); response.payload.push_back(image); response.payload.push_back(wxString::Format(wxT("%d"), progress)); evt.SetPayload<UartMessage>(response); wxQueueEvent(_pHandler, evt.Clone());}
开发者ID:mihazet,项目名称:my-test-apps,代码行数:9,
示例18: wxThreadEvent/** @brief OnMemoryWrite * * @todo: document this function */void BWLCDPlugin::OnMemoryWrite(lc3_state& state, unsigned short address, short value){ if (address == initaddr) { unsigned short data = value; if (data == 0x8000U && lcd == NULL) { wxThreadEvent* evt = new wxThreadEvent(wxEVT_COMMAND_CREATE_DISPLAY); evt->SetPayload<lc3_state*>(&state); wxQueueEvent(this, evt); lcd_initializing = true; } else if (data == 0x8000U && (lcd != NULL || lcd_initializing)) { lc3_warning(state, "BWLCD already initialized!"); } else if (value == 0 && lcd == NULL) { lc3_warning(state, "BWLCD is destroyed already!"); } else if (value == 0 && (lcd != NULL || lcd_initializing)) { wxQueueEvent(this, new wxThreadEvent(wxEVT_COMMAND_DESTROY_DISPLAY)); } else { lc3_warning(state, "Incorrect value written to BWLCD"); } } else if (address >= startaddr && address < startaddr + width * height && !lcd_initializing) { if (lcd == NULL) { lc3_warning(state, "Writing to LCD while its not initialized!"); } else { wxThreadEvent* evt = new wxThreadEvent(wxEVT_COMMAND_UPDATE_DISPLAY); evt->SetPayload<lc3_state*>(&state); wxQueueEvent(lcd, evt); } }}
开发者ID:384579283,项目名称:cs2110,代码行数:47,
示例19: paintNowvoid CurvePane::mouseReleased(wxMouseEvent& event){ mousemotion=false; paintNow(); if (mousemoved) { wxCommandEvent *e = new wxCommandEvent(wxEVT_SCROLL_THUMBRELEASE); e->SetString("This is the data"); wxQueueEvent(p,e); }}
开发者ID:butcherg,项目名称:rawproc,代码行数:10,
示例20: WXUNUSEDvoid ZLauncherFrame::OnLaunchButtonClicked(wxCommandEvent& WXUNUSED(evt)){ // System specific#ifdef _WIN32 ShellExecuteA(NULL, "open", m_LaunchExecutableName.mbc_str(), NULL, NULL, SW_SHOW);#endif // Exit after launching the game/application wxQueueEvent(wxTheApp->GetTopWindow()->GetEventHandler(), new wxCloseEvent(wxEVT_CLOSE_WINDOW));}
开发者ID:TheZoc,项目名称:ZPatcher,代码行数:10,
示例21: BWLCD/** @brief InitDisplay * * @todo: document this function */void BWLCDPlugin::InitDisplay(wxThreadEvent& event){ lcd = new BWLCD(wxTheApp->GetTopWindow(), width, height, startaddr, offcolor, oncolor); lcd_initializing = false; lcd->Show(); lcd->Connect(wxID_ANY, wxEVT_COMMAND_UPDATE_DISPLAY, wxThreadEventHandler(BWLCD::OnUpdate)); wxThreadEvent* evt = new wxThreadEvent(wxEVT_COMMAND_UPDATE_DISPLAY); evt->SetPayload<lc3_state*>(event.GetPayload<lc3_state*>()); wxQueueEvent(lcd, evt);}
开发者ID:384579283,项目名称:cs2110,代码行数:15,
示例22: wxFileSystemWatcherEventvoid wxFsEventsFileSystemWatcher::PostError(const wxString& msg){ wxFileSystemWatcherEvent* evt = new wxFileSystemWatcherEvent( wxFSW_EVENT_ERROR, wxFSW_WARNING_NONE, msg ); wxASSERT_MSG(this->GetOwner(), "owner must exist"); if (this->GetOwner()) { wxQueueEvent(this->GetOwner(), evt); }}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:11,
示例23: thread// -----------------------------------------------------------------------------// Gets a response via http from [host]/[url] (non-blocking). When the response// is received, an event is sent to [event_handler]// -----------------------------------------------------------------------------void Web::getHttpAsync(const string& host, const string& uri, wxEvtHandler* event_handler){ std::thread thread([=]() { // Queue wx event with http request response auto event = new wxThreadEvent(wxEVT_THREAD_WEBGET_COMPLETED); event->SetString(getHttp(host, uri)); wxQueueEvent(event_handler, event); }); thread.detach();}
开发者ID:sirjuddington,项目名称:SLADE,代码行数:15,
注:本文中的wxQueueEvent函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ wxRenameFile函数代码示例 C++ wxQtConvertString函数代码示例 |