Esempio n. 1
0
bool MPopupMenu::OnCommand(MWidget* pWindow, const char* szMessage)
{
	if(GetType()==MPMT_VERTICAL) Show(false);
	else Select((MMenuItem*)NULL);
	MListener* pListener = GetListener();
	if(pListener!=NULL) pListener->OnCommand(this, szMessage);
	return true;
}
Esempio n. 2
0
Net::SsdpListenerMulticast& Environment::MulticastListenerClaim(TIpAddress aInterface)
{
    AutoMutex a(*iPrivateLock);
    const TInt count = (TUint)iMulticastListeners.size();
    for (TInt i=0; i<count; i++) {
        Environment::MListener* listener = iMulticastListeners[i];
        if (listener->Interface() == aInterface) {
            listener->AddRef();
            return listener->Listener();
        }
    }
    // first request on this interface; create a shared multicast listener for it
    MListener* listener = new MListener(*this, aInterface);
    iMulticastListeners.push_back(listener);
    listener->Listener().Start();
    return listener->Listener();
}
Esempio n. 3
0
bool MMsgBox::OnCommand(MWidget* pWindow, const char* szMessage)
{
	MListener* pListener = GetListener();
	if(pListener==NULL) return false;

	if(pWindow==m_pOK && strcmp(szMessage, MBTN_CLK_MSG)==0){
		if(m_nType==MT_YESNO) pListener->OnCommand(this, MMSGBOX_YES);
		else pListener->OnCommand(this, MMSGBOX_OK);
		return true;
	}
	else if(pWindow==m_pCancel && strcmp(szMessage, MBTN_CLK_MSG)==0){
		if(m_nType==MT_YESNO) pListener->OnCommand(this, MMSGBOX_NO);
		else pListener->OnCommand(this, MMSGBOX_CANCEL);
		return true;
	}

	return false;
}