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

📄 simpledlgplayernamedialog.cpp

📁 Symbian OS 源码:一个标准对话框的S60手机的源码。适合于初学者
💻 CPP
字号:
/**
* 
* @brief Definition of CSimpleDlgPlayerNameDialog
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/

// INCLUDE FILES

// Class include
#include "SimpleDlgPlayerNameDialog.h"

// System includes
#include <avkon.hrh> // EAknSoftkeyOk
#include <simpledlg.rsg>
#include <eikedwin.h> // CEikEdwin
#include <eiklabel.h> // CEikLabel
#include <stringloader.h> // StringLoader

// User includes
#include "simpledlg.hrh" // dialog lines

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

/**
* Called by the framework when a soft key is pressed.
* Saves the dialog data back to the model
* @param aButtonId The soft key which was pressed
*/
TBool CSimpleDlgPlayerNameDialog::OkToExitL(TInt aButtonId)
	{
	if (aButtonId == EAknSoftkeyOk)
		{
		CEikEdwin* editor = static_cast<CEikEdwin*>(ControlOrNull(ESimpleDlgCIdPlayerNameEditor));
		if (editor)
			{
			editor->GetText(iPlayerName);
			}
		}
	return ETrue;
	}


/**
* Called by the framework before the dialog is sized and laid out. 
* Initialises the control values.
*/
void CSimpleDlgPlayerNameDialog::PreLayoutDynInitL()
	{
	CEikLabel* label = static_cast<CEikLabel*>(ControlOrNull(ESimpleDlgCIdPlayerName));
	if (label)
		{
		HBufC* labelText = StringLoader::LoadLC(R_ENTER_NAME_TEXT);
		label->SetTextL(*labelText);
		CleanupStack::PopAndDestroy(labelText);
		}
	}


/**
* Static construction and execution of the dialog. 
* @param aPlayerName the name which this dialog will edit
* @return ETrue if the dialog is dismissed with a positive action, EFalse otherwise
*/
TBool CSimpleDlgPlayerNameDialog::RunDlgLD (TDes& aPlayerName)
	{
		CSimpleDlgPlayerNameDialog* playerNameDialog = new (ELeave) CSimpleDlgPlayerNameDialog(aPlayerName);
		return playerNameDialog->ExecuteLD(R_SIMPLEDLG_PLAYER_NAME_DIALOG);
	}

// End of File

⌨️ 快捷键说明

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