cscoredialog.cpp
来自「symbian 的一个 二维飞行游戏 源码 及相关技术文章」· C++ 代码 · 共 59 行
CPP
59 行
// Copyright 2002 Kenneth Guy,
//
// CScoreDialog.cpp
/** \file CScoreDialog.cpp
implementation of class CScoreDialog */
//
#include <eikgted.h>
#include <txtetext.h>
#include <txtglobl.h>
#include <eikmenup.h>
#include "CHighScores.h"
#include "CScoreDialog.h"
/** Show enter name dialog.
Creates the dialog, runs it. The ExecuteLD() function will
return when the dialog has completed and will delete the
dialog.
\param aHighScores high score table to add score to.
\param aScore players score
*/
void CScoreDialog::RunDlgLD(CHighScores &aHighScores,TInt aScore) {
CEikDialog* dialog = new (ELeave) CScoreDialog(aHighScores, aScore);
dialog->ExecuteLD(R_SCORE_DIALOG);
}
/** constructor */
CScoreDialog::CScoreDialog(CHighScores &aHighScores, TInt aScore)
:iHighScores(aHighScores), iScore(aScore) {
}
/** Add high score.
If the user pressed OK or enter this will add their name to
the high score table.
\param aKeyCode key pressed to exit dialog.
\return ETrue as it is always ok to exit this dialog
*/
TBool CScoreDialog::OkToExitL(TInt aKeycode) {
if(aKeycode==EEikBidOk) {
CEikGlobalTextEditor *ed= STATIC_CAST(CEikGlobalTextEditor*,Control(EHighScoreNameControlId));
CGlobalText *text=ed->GlobalText();
iHighScores.AddScoreL(text->Read(0),iScore);
}
return ETrue;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?