コード例 #1
0
ファイル: FilterListView.cpp プロジェクト: IFGHou/Holodeck
	//*************************************************************************
	// Method:		LocalFilterFunc
	// Description: handles the filter event
	//
	// Parameters:
	//	sender - the sender of the event
	//	e - the args representing the event
	//
	// Return Value: None
	//*************************************************************************
	void FilterListView::LocalFilterFunc(Object *sender, EventArgs *e)
	{
		if (customFilters->Item[columnWithFocus])
		{
			EventHandler *customFilterMethod = static_cast<EventHandler *>(customFilters->Item[columnWithFocus]);
			customFilterMethod->Invoke(sender, EventArgs->Empty);
		}
	}
コード例 #2
0
ファイル: FilterListView.cpp プロジェクト: IFGHou/Holodeck
	//*************************************************************************
	// Method:		localFilterFunc
	// Description: The local function which is called when "Custom Filter .." 
	//				is selected. This method calls the appropriate handler
	//				function (if exists) by looking it up in the hash table.
	//
	// Parameters:
	//		sender	- the object which sent this 
	//		e		- the event arguments
	//
	// Return Value: None
	//*************************************************************************
	void FilterListView::localFilterFunc(System::Object * sender, EventArgs * e)
	{
		if (customFilters->Item[columnWithFocus] != NULL)
		{
			//checkItemRadio (static_cast <MenuItem *> (sender));
			EventHandler * customFilterMethod = static_cast <EventHandler *> (customFilters->Item[columnWithFocus]);
			customFilterMethod->Invoke (sender, EventArgs->Empty);
		}
	}
コード例 #3
0
void Object::OnEvent(Object* sender, StringHash eventType, VariantMap& eventData)
{
    // Make a copy of the context pointer in case the object is destroyed during event handler invocation
    Context* context = context_;
    EventHandler* specific = 0;
    EventHandler* nonSpecific = 0;
    
    EventHandler* handler = eventHandlers_.First();
    while (handler)
    {
        if (handler->GetEventType() == eventType)
        {
            if (!handler->GetSender())
                nonSpecific = handler;
            else if (handler->GetSender() == sender)
            {
                specific = handler;
                break;
            }
        }
        handler = eventHandlers_.Next(handler);
    }
    
    // Specific event handlers have priority, so if found, invoke first
    if (specific)
    {
        context->SetEventHandler(specific);
        specific->Invoke(eventData);
        context->SetEventHandler(0);
        return;
    }
    
    if (nonSpecific)
    {
        context->SetEventHandler(nonSpecific);
        nonSpecific->Invoke(eventData);
        context->SetEventHandler(0);
    }
}