testusernamedialog.cpp

来自「symbianOS第三版开发与实用教程部分源码和部分试验」· C++ 代码 · 共 43 行

CPP
43
字号
#include <avkon.hrh>
#include <TestDialog.rsg>
#include <eikedwin.h>
#include <eiklabel.h>
#include <stringloader.h>

#include "TestUserNameDialog.h"
#include "TestDialog.hrh"

TBool CTestUserNameDialog::OkToExitL(TInt aButtonId)
	{
	if (aButtonId == EAknSoftkeyOk)
		{
		CEikEdwin* editor = static_cast<CEikEdwin*>(ControlOrNull(ESimpleDlgCIdUserNameEditor));
		if (editor)
			{
			editor->GetText(iPlayerName);
			}
		}
	return ETrue;
	}


/**
* Called by the framework before the dialog is sized and laid out. 
* Initialises the control values.
*/
void CTestUserNameDialog::PreLayoutDynInitL()
	{
	CEikLabel* label = static_cast<CEikLabel*>(ControlOrNull(ESimpleDlgCIdUserName));
	if (label)
		{
		label->SetTextL(_L("Please input you name:"));
		}
	}



TBool CTestUserNameDialog::RunDlgLD (TDes& aPlayerName)
	{
		CTestUserNameDialog* userNameDialog = new (ELeave) CTestUserNameDialog(aPlayerName);
		return userNameDialog->ExecuteLD(R_SIMPLE_NAME_DIALOG);
	}

⌨️ 快捷键说明

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