⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fepsetupdialog.cpp

📁 运行EXE实例的一个实例
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CFepSetupDialog from FepSetupDialog.h
*  Part of  : FepSetup
*  Created  : 02/22/2003 by Chiam Poh Guan
*  Implementation notes:
*     Initial content was generated by Series 60 AppWizard.
*  Version  :
*  Copyright: Forum Nokia
* ============================================================================
*/

// INCLUDE FILES
#include    "FepSetupDialog.h"

#include <eiklabel.h>  // for example label control
#include <avkon.hrh>
#include <aknappui.h>

#include <f32file.h> // for TParseBase
#include <FepSetup.rsg>
#include "fepsetup.hrh"


#include <AknListQueryDialog.h>

//_LIT(KAknExQueryDefaultDataText, "Hello");
_LIT(KMySelect, "Selected %d");



// ================= MEMBER FUNCTIONS =======================

// Destructor
CFepSetupDialog::~CFepSetupDialog()
    {
	delete iFepSetting;
	delete iFileNamesOfAvailableFeps;
	delete iNamesOfAvailableFeps;
    }

// ---------------------------------------------------------
// CFepSetupDialog::OkToExitL(TInt aButtonId)
// called by framework when the OK button is pressed
// ---------------------------------------------------------
//
TBool CFepSetupDialog::OkToExitL(TInt aButtonId)
{
    // Translate the button presses into commands for the appui & current
    // view to handle
    if ( aButtonId == EAknSoftkeyOptions )
        {
        iAvkonAppUi->ProcessCommandL( EAknSoftkeyOptions );
        }
    else if ( aButtonId == EAknSoftkeyBack )
        {
        iAvkonAppUi->ProcessCommandL( EEikCmdExit );
        }
    
    return EFalse;
}

// ---------------------------------------------------------
// CFepSetupDialog::PreLayoutDynInitL();
// called by framework before dialog is shown 
// ---------------------------------------------------------
//
void CFepSetupDialog::PreLayoutDynInitL()
    {
	iFepSetting=CFepGenericGlobalSettings::NewL(*iEikonEnv, 
					TFepOnOrOffKeyData(EKeyEnter, EModifierFunc|EModifierShift, EModifierFunc),
					TFepOnOrOffKeyData(EKeyEnter, EModifierFunc|EModifierShift, EModifierShift), 
					EFalse);

	iFileNamesOfAvailableFeps = iEikonEnv->FileNamesOfAvailableFepsL();

	const TInt numberOfAvailableFeps = iFileNamesOfAvailableFeps->MdcaCount();
	iNamesOfAvailableFeps = new(ELeave) CDesCArrayFlat(numberOfAvailableFeps+1);
	
	for(TInt i=0; i<numberOfAvailableFeps; i++)
		{
		iNamesOfAvailableFeps->AppendL(TParsePtrC(iFileNamesOfAvailableFeps->MdcaPoint(i)).Name());
		}
	HBufC* noneFepText = iCoeEnv->AllocReadResourceLC(R_FEPSETUP_TBUF_NONE);
	iNamesOfAvailableFeps->AppendL(*noneFepText);

	CleanupStack::PopAndDestroy(); // noneFepText
	}

void CFepSetupDialog::DisplayListOfFepsL()
    {
    TInt index(0);
    CAknListQueryDialog* dlg = new(ELeave) CAknListQueryDialog(&index);
    dlg->PrepareLC(R_FEPSETUP_LIST_QUERY);
    dlg->SetItemTextArray(iNamesOfAvailableFeps);

    dlg->SetOwnershipType(ELbmDoesNotOwnItemArray);
    TInt answer( dlg->RunLD() );

    if (answer)
		{
	    TBuf<50> text;
        text.Format(KMySelect, index+1);
		iEikonEnv->InfoMsg(text);
		}
	else
		{
//		iEikonEnv->InfoMsg("Error");			
		}
	}

// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -