EventHolder( IGUIEventListener* pEvent, int event_id ) : m_pEvent( pEvent ) , m_EventId( event_id ) { //there should be no events registered for this id EVENTPAIR theEvent( m_pEvent, m_EventId ); assert( m_EventListeners.find( theEvent ) == m_EventListeners.end()); m_EventListeners[ theEvent ] = this; }
static EventHolder* GetEventHolder( IGUIEventListener* pEvent, int event_id ) { EVENTPAIR theEvent( pEvent, event_id ); std::map<EVENTPAIR, EventHolder*>::iterator found = m_EventListeners.find( theEvent ) ; if( found != m_EventListeners.end() ) { return found->second; } else { return 0; } }
void cbAuiNotebook::OnTabCtrlDblClick(wxMouseEvent& event) { wxWindow* win = nullptr; wxAuiTabCtrl* tabCtrl = (wxAuiTabCtrl*)event.GetEventObject(); if (tabCtrl && tabCtrl->TabHitTest(event.GetX(), event.GetY(), &win)) { if (win != nullptr) { // send double-click-event CodeBlocksEvent theEvent(cbEVT_CBAUIBOOK_LEFT_DCLICK, GetParent()->GetId()); theEvent.SetEventObject(win); GetParent()->GetEventHandler()->ProcessEvent(theEvent); } } }
void wxMediaBackendCommonBase::QueueEvent(wxEventType evtType) { wxMediaEvent theEvent(evtType, m_ctrl->GetId()); m_ctrl->GetEventHandler()->AddPendingEvent(theEvent); }
bool wxMediaBackendCommonBase::SendStopEvent() { wxMediaEvent theEvent(wxEVT_MEDIA_STOP, m_ctrl->GetId()); return !m_ctrl->GetEventHandler()->ProcessEvent(theEvent) || theEvent.IsAllowed(); }
~EventHolder() { EVENTPAIR theEvent( m_pEvent, m_EventId ); m_EventListeners.erase( theEvent ); }