本文整理汇总了C++中AddPendingEvent函数的典型用法代码示例。如果您正苦于以下问题:C++ AddPendingEvent函数的具体用法?C++ AddPendingEvent怎么用?C++ AddPendingEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddPendingEvent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDataForItem
void ProjectExplorerWindow::OnTreeItemContextMenu(wxTreeEvent& event)
{
m_tree->SelectItem(event.GetItem(), true);
if (m_contextMenu != NULL)
{
ItemData* itemData = GetDataForItem(event.GetItem());
// If this is a file, display the context menu.
if (itemData != NULL && itemData->file != NULL && itemData->symbol == NULL)
{
wxTreeEvent copy(event);
copy.SetInt(0);
copy.SetEventType(wxEVT_TREE_CONTEXT_MENU);
AddPendingEvent(copy);
}
//Is a basic directory
else if (itemData == NULL)
{
wxTreeEvent copy(event);
copy.SetInt(1);
copy.SetEventType(wxEVT_TREE_CONTEXT_MENU);
AddPendingEvent(copy);
}
}
}
示例2: ev
void wxCheckedListCtrl::OnActivateEvent(wxListEvent& event)
{
long item = event.GetItem().GetId();
if (item == wxNOT_FOUND || !IsEnabled(item))
{
// skip this item
event.Skip();
return;
}
wxListEvent ev(wxEVT_NULL, GetId());
ev.m_itemIndex = item;
// send the check event
if (IsChecked(item))
{
ev.SetEventType(wxEVT_COMMAND_LIST_ITEM_UNCHECKED);
Check(item, FALSE);
AddPendingEvent(ev);
} else {
ev.SetEventType(wxEVT_COMMAND_LIST_ITEM_CHECKED);
Check(item, TRUE);
AddPendingEvent(ev);
}
event.Skip();
}
示例3: GetCellEditor
void nwxGrid::OnEditorEnd(wxGridEvent &e)
{
if(m_nEditorOn)
{
m_nEditorOn--;
int nRow = e.GetRow();
int nCol = e.GetCol();
// memory leak on following line
wxGridCellEditor *pEdit = GetCellEditor(nRow, nCol);
wxControl *pControl = (pEdit == NULL) ? NULL : pEdit->GetControl();
wxTextCtrl *pText =
(pControl == NULL)
? NULL
: wxDynamicCast(pControl,wxTextCtrl);
if(pText != NULL)
{
wxString s;
s = pText->GetValue();
if(s == m_sEditorStartValue || s != m_sValue)
{
// value hasn't changed but we still want to force a
// CELL_CHANGED event
wxGridEvent ee(e);
ee.SetEventType(wxEVT_GRID_CELL_CHANGED);
AddPendingEvent(ee);
}
if(pEdit != NULL)
{
pEdit->DecRef();
}
}
}
e.Skip();
}
示例4: wxCHECK_MSG
bool wxLuaDebuggerCServer::StartServer()
{
wxCHECK_MSG(m_serverSocket == NULL, false, wxT("Debugger server socket already created"));
m_shutdown = false;
m_serverSocket = new wxLuaCSocket();
m_serverSocket->m_name = wxString::Format(wxT("wxLuaDebuggerCServer::m_serverSocket (%ld)"), (long)wxGetProcessId());
if (m_serverSocket->Listen(m_port_number))
{
wxCHECK_MSG(m_pThread == NULL, false, wxT("Debugger server thread already created"));
if (!m_shutdown)
{
m_pThread = new wxLuaDebuggerCServer::LuaThread(this);
return ((m_pThread != NULL) &&
(m_pThread->Create() == wxTHREAD_NO_ERROR) &&
(m_pThread->Run() == wxTHREAD_NO_ERROR));
}
}
else
{
wxLuaDebuggerEvent debugEvent(wxEVT_WXLUA_DEBUGGER_ERROR, this);
debugEvent.SetMessage(m_serverSocket->GetErrorMsg(true));
AddPendingEvent(debugEvent);
delete m_serverSocket;
m_serverSocket = NULL;
m_shutdown = true;
}
return false;
}
示例5: raiseMovementEvent
void
raiseMovementEvent(
wxWindow &Control,
std::shared_ptr<StateAccessToken> &Access,
std::function<seec::cm::MovementResult (seec::cm::ProcessState &State)> Mover)
{
auto const Handler = Control.GetEventHandler();
if (!Handler) {
wxLogDebug("raiseMovementEvent: wxWindow does not have an event handler.");
return;
}
if (!Access) {
wxLogDebug("raiseMovementEvent: no access provided.");
return;
}
auto LockAccess = Access->getAccess();
if (!LockAccess) { // Token is out of date.
wxLogDebug("raiseMovementEvent: access token is outdated.");
return;
}
ProcessMoveEvent Ev {
SEEC_EV_PROCESS_MOVE,
Control.GetId(),
std::move(Mover)
};
Ev.SetEventObject(&Control);
LockAccess.release();
Handler->AddPendingEvent(Ev);
}
示例6: HitTest
void CMuleNotebook::OnMouseButtonRelease(wxMouseEvent &event)
{
if (GetImageList() == NULL) {
// This Mulenotebook has no images on tabs, so nothing to do.
event.Skip();
return;
}
long xpos, ypos;
event.GetPosition(&xpos, &ypos);
long flags = 0;
int tab = HitTest(wxPoint(xpos,ypos),&flags);
if ((tab != -1) && (((flags == wxNB_HITTEST_ONICON) && event.LeftUp()) ||
((flags == wxNB_HITTEST_ONLABEL) && event.MiddleUp()))) {
// User did click on a 'x' or middle click on the label
#if MULE_NEEDS_DELETEPAGE_WORKAROUND
/* WORKAROUND: Instead of calling DeletePage, we need to wait for the
* mouse release signal to reach Gtk. Inconsistent with normal wxEvent
* behaviour the button release handler in wxWidgets don't evaluate
* the result of the signal handling. */
wxNotebookEvent evt( wxEVT_COMMAND_MULENOTEBOOK_DELETE_PAGE, GetId(), tab );
evt.SetEventObject(this);
AddPendingEvent( evt );
#else
DeletePage(tab);
#endif // MULE_NEEDS_DELETEPAGE_WORKAROUND
} else {
// Is not a 'x'. Send this event up.
event.Skip();
}
}
示例7: p
void tcOOBView::OnLButtonDown(wxMouseEvent& event)
{
wxPoint point = event.GetPosition();
wxRealPoint p(double(point.x), double(point.y));
if (CategoryShowHideClick(p))
{
return;
}
if (tsOOBInfo* info =
ButtonContainingPoint(p))
{
long new_key = info->mnID;
if (new_key != mnSelectedKey)
{
wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_NEWHOOK) ;
command.SetEventObject(this);
command.SetExtraLong(new_key);
AddPendingEvent(command);
}
mnSelectedKey = new_key;
tcSound::Get()->PlayEffect("ShortBeep");
mbMouseDrag = true;
msFormationChangeInfo.mnFollowerKey = info->mnID;
}
}
示例8: ButtonContainingPoint
void tcOOBView::OnLButtonDClick(wxMouseEvent& event)
{
wxPoint point = event.GetPosition();
if (tsOOBInfo* info =
ButtonContainingPoint(wxRealPoint((float)point.x,(float)point.y)))
{
long new_key = info->mnID;
if (new_key != -1)
{
long flags = 0;
if (event.ShiftDown()) flags += 1;
if (event.ControlDown()) flags += 2;
if (event.AltDown()) flags += 4;
wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, ID_DCLICKHOOK) ;
command.SetEventObject(this);
command.SetExtraLong(flags);
AddPendingEvent(command);
}
mnSelectedKey = new_key;
tcSound::Get()->PlayEffect("ShortBeep");
}
}
示例9: event
void EventNotifier::PostReloadExternallyModifiedEvent(bool prompt)
{
if(_eventsDiabled)
return;
wxCommandEvent event( prompt ? wxEVT_CMD_RELOAD_EXTERNALLY_MODIFIED : wxEVT_CMD_RELOAD_EXTERNALLY_MODIFIED_NOPROMPT );
AddPendingEvent( event );
}
示例10: fprintf
void ClangPlugin::OnClangReparseFinished( wxEvent& event )
{
//#ifdef CLANGPLUGIN_TRACE_FUNCTIONS
fprintf(stdout,"%s\n", __PRETTY_FUNCTION__);
//#endif
ClangProxy::ReparseJob* pJob = static_cast<ClangProxy::ReparseJob*>(event.GetEventObject());
if ( HasEventSink(clEVT_DIAGNOSTICS_UPDATED ) )
{
ClangProxy::GetDiagnosticsJob job( cbEVT_CLANG_ASYNCTASK_FINISHED, idClangGetDiagnostics, pJob->GetTranslationUnitId(), pJob->GetFilename() );
m_Proxy.AppendPendingJob(job);
}
ClangEvent evt( clEVT_REPARSE_FINISHED, pJob->GetTranslationUnitId(), pJob->GetFilename());
ProcessEvent(evt);
#if 0
if (pJob->m_TranslId != this->m_TranslUnitId)
{
std::cout<<" Reparse finished but another file was loaded"<<std::endl;
return;
}
if (m_ReparseNeeded)
{
fprintf(stdout,"%s: Reparsing again, was modified while we were busy...\n", __PRETTY_FUNCTION__);
wxCommandEvent evt(cbEVT_COMMAND_REPARSE, idReparse);
AddPendingEvent(evt);
}
else
{
//m_DiagnosticTimer.Stop();
//m_DiagnosticTimer.Start(DIAGNOSTIC_DELAY, wxTIMER_ONE_SHOT);
}
#endif
}
示例11: event
/////////////////////
// Ask to stop later
void AudioPlayer::RequestStop() {
wxCommandEvent event(wxEVT_STOP_AUDIO, 1000);
event.SetEventObject(this);
wxMutexGuiEnter();
AddPendingEvent(event);
wxMutexGuiLeave();
}
示例12: event
void EventNotifier::PostFileSavedEvent(const wxString& filename)
{
clCommandEvent event( wxEVT_FILE_SAVED );
event.SetString( filename );
event.SetFileName( filename );
AddPendingEvent( event );
}
示例13: GetId
void NetPlayDialog::StopGame()
{
wxCommandEvent stop_event{ DOLPHIN_EVT_STOP_SOFTWARE, GetId() };
stop_event.SetEventObject(this);
AddPendingEvent(stop_event);
}
示例14: event
void CamArtProvider::ArtLoad(BOOL newbitmaps, BOOL defer)
{
// If we already have an event pending, don't generate a new one
if (m_GetBitmapEventPending && !newbitmaps) return;
if (newbitmaps && m_pMissingImage && m_pHash && !m_pHash->empty())
{
ResIDWithFlagsToBitmapPtr::iterator current;
for( current = m_pHash->begin(); current != m_pHash->end(); ++current )
{
// we don't need to worry about memory management as deleting the
// bitmaps are CamResource::'s responsibility
if (current->second.m_pImage == m_pMissingImage)
m_pMissingImage = NULL; // mark as required to be loaded on the event
}
}
// Send ourselves a deferred event
m_GetBitmapEventPending = TRUE;
wxCamArtProviderEvent event (wxEVT_CAMARTPROVIDER_GETBITMAP, 0, defer);
if (defer)
AddPendingEvent(event);
else
ProcessEvent(event);
}
示例15: AddPendingEvent
void wxZEditNode::AskRefresh()
{
wxSizeEvent event;
event.SetEventObject(this);
event.SetEventType(14000);
AddPendingEvent(event);
}