예제 #1
0
bool nuiEventTargetBase::OnEvent(const nuiEvent& rEvent)
{
  bool handled = false;
  nuiEventSource* pSource = (nuiEventSource*)rEvent.GetSource();
  LinksMap::const_iterator it_source = mpLinks.find(pSource);
  
  if (it_source != mpLinks.end())
  {
    LinkList links(it_source->second);
    LinkList::const_iterator it   = links.begin();
    LinkList::const_iterator end  = links.end();
    
    for (; (it != end) && !handled; ++it)
    {
      Link* pLink = (*it);
      nuiDelegateMemento pFunc = pLink->mTargetFunc;
      rEvent.mpUser = pLink->mpUser;
      
      handled = CallEvent((void*)mpTarget, pFunc, rEvent);
    }
  }
  return handled;
}
예제 #2
0
파일: nuiTree.cpp 프로젝트: YetToCome/nui3
void nuiTreeBase::OnDelChildRequest(const nuiEvent& rEvent)
{
  nuiTreePtr pChild = (nuiTreePtr)rEvent.mpUser;
  mTreeNodeEventSink.DisconnectSource(*const_cast<nuiEventSource*>(rEvent.GetSource()));
  DelChild(pChild);
}