TBool CRecordFormatOptionsDialog::OkToExitL(TInt /*aKeycode*/)
	{
	// get bit rate, sample, channel, codec settings
	CFormatOptionsDialog::OkToExitL(0);
	// get gain and balance, which are recording specific parameters
    CEikNumberEditor* gain = static_cast<CEikNumberEditor*>(Control(EGain));
	iRecordFormatOptions.iGain = gain->Number();
    CEikNumberEditor* balance = static_cast<CEikNumberEditor*>(Control(EBalance));
	iRecordFormatOptions.iBalance = balance->Number();
	iRecordFormatOptions.iGainSet = iRecordFormatOptions.iBalanceSet = ETrue;

	return ETrue;
	}
TBool CMVSVolumeDialog::OkToExitL(TInt aButtonId)
	{
    // Get a pointer to the progress bar control.
    // Downcast the returned CCoeControl* pointer to the correct type.
    CCoeControl* myControlPtr = this->Control(EMVSCmdSetVolume);
    iProgInfo = static_cast<CEikProgressInfo*>(myControlPtr);
    CEikNumberEditor* control = static_cast<CEikNumberEditor*>(Control(EMVSCmdSetVolumeRamp));
    switch(aButtonId)
    	{
    	case (EMVSButtonCancel):
    		iAppUi->SetVolumeL(iOldVolume, iRamp);
         	return ETrue;
         	
        case(EMVSButtonDown):
        	if(iProgInfo)
	        	{
	        	iProgInfo->IncrementAndDraw(-5);
	        	iVolume = iProgInfo->CurrentValue();
	          	iRamp = control->Number()*1000;
	        	iAppUi->SetVolumeL(iVolume, iRamp);
	        	}
        	break;

        case(EMVSButtonUp):
            if(iProgInfo)
	            {
	            iProgInfo->IncrementAndDraw(5);
	        	iVolume = iProgInfo->CurrentValue();
	          	iRamp = control->Number()*1000;
	            iAppUi->SetVolumeL(iVolume, iRamp);
	            }
           	break;

        case(EMVSButtonOk):
        default:
        	return ETrue;
        }
     
    return EFalse;
    }
TBool CCreateSpeakerSinkDialog::OkToExitL( TInt aKey )
    {
    if ( aKey == EEikCmdCanceled )
        {
        // Cancel pressed. Just exit.
        return ETrue;
        }
    const RPointerArray<CMCETestUIEngineSink>& sinks = 
            iStream.SinksL();
            
   	CMceMediaSink& mediaSink = static_cast<CMceMediaSink&>(sinks[iSinkIndex]->Sink());
    CMceSpeakerSink& speakerSink = static_cast<CMceSpeakerSink&>(mediaSink);
    	
    CEikNumberEditor* volume = static_cast<CEikNumberEditor*>(
                              Control( ESpeakerSinkVolumeSetting ) );
    speakerSink.SetVolumeL( volume->Number() );  
        
    CEikNumberEditor* routing = static_cast<CEikNumberEditor*>(
                              Control( ESpeakerSinkRoutingSetting ) );
    speakerSink.SetRoutingL( routing->Number() );  
    return ETrue;
    }
TBool CSettingsDialog::OkToExitL(TInt /*aButtonId*/)
	{
	// Store dialog input
	CEikEdwin* name=(CEikEdwin*)Control(EServerName);
	name->GetText(iConnectSettings.iAddress);
	CEikEdwin* page=(CEikEdwin*)Control(EPage);
	TBuf<KSettingFieldWidth> temp;
	page->GetText(temp);
	iConnectSettings.iPage.Copy(temp);
	CEikNumberEditor* port = (CEikNumberEditor*)Control(EPort);
	iConnectSettings.iPortNum = port->Number();

	return ETrue;
	}
TBool CMVSCropDialog::OkToExitL(TInt aButtonId)
	{
    //Get a pointer to the Option Button List control
    CEikHorOptionButtonList* button = static_cast<CEikHorOptionButtonList*>(Control(EMVSCmdCropLeftRight));
	//Get a pointer to the number editor
    CEikNumberEditor* control = static_cast<CEikNumberEditor*> ( Control(EMVSCmdCropPositionNumber) );
	TInt position = control->Number()*KMicroSecs;
    TInt64 pos64(position);
    iPosition = TTimeIntervalMicroSeconds(pos64);
    if(iPosition > iClipLength)
    	{
     	iPosition = iClipLength;
     	}
	if(iPosition < iCropStart)
	 	{
	 	iPosition = iCropStart; 
	 	}
    TInt buttonId = button->LabeledButtonId();
	switch (aButtonId)
    	{
        case(EMVSButtonUpdate):
        	//update prog info based on num-editor
        	if(buttonId == EMVSHorOptButtonCropFromBeginning) //'From Beginning' selected
            	{
               	iCropFromBeginning = ETrue;
               	iCropStart = iPosition;
               	}
          	else
            	{
               	iCropFromBeginning = EFalse;
               	iCropStart = iPosition;
               	}
            iAppUi->SetCropL(iCropStart, iCropFromBeginning);
            break;

        case(EMVSButtonCancel):
            break;

        default:
 		    break;
        }
    return ETrue;    
    }
TBool CSendDTMFDialog::OkToExitL( TInt aKey )
    {
    if ( aKey == EEikCmdCanceled )
        {
        // Cancel pressed. Just exit.
        return ETrue;
        }
    TBuf<1> buffer;
    
	CEikEdwin* dtmf_char = static_cast<CEikEdwin*>(
                             Control( ESendDtmfTone ) );
	dtmf_char->GetText( buffer );
	
	iChar = buffer[0];
   	
   	CEikNumberEditor* interval = static_cast<CEikNumberEditor*>(
                                  Control( ESendDtmfTone_duration ) );
	iInterval = interval->Number();
	    
	           	  
    return ETrue;
    }