Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

CScoreDialog Class Reference

High score enter name dialog. More...

#include <CScoreDialog.h>

Collaboration diagram for CScoreDialog:

Collaboration graph
[legend]
List of all members.

Static Public Methods

void RunDlgLD (CHighScores &aHighScores, TInt aScore)
 Show enter name dialog. More...


Private Methods

 CScoreDialog (CHighScores &aHighScores, TInt aScore)
 constructor. More...

TBool OkToExitL (TInt aKeycode)
 Add high score. More...


Private Attributes

CHighScoresiHighScores
 High score table. More...

TInt iScore
 Players score. More...


Detailed Description

High score enter name dialog.

Definition at line 36 of file CScoreDialog.h.


Constructor & Destructor Documentation

CScoreDialog::CScoreDialog CHighScores   aHighScores,
TInt    aScore
[private]
 

constructor.

Definition at line 40 of file CScoreDialog.cpp.

Referenced by RunDlgLD().

00041   :iHighScores(aHighScores), iScore(aScore) {
00042 
00043 }


Member Function Documentation

void CScoreDialog::RunDlgLD CHighScores   aHighScores,
TInt    aScore
[static]
 

Show enter name dialog.

Creates the dialog, runs it. The ExecuteLD() function will return when the dialog has completed and will delete the dialog.

Parameters:
aHighScores  high score table to add score to.
aScore  players score

Definition at line 33 of file CScoreDialog.cpp.

References CScoreDialog().

Referenced by CGameAppUi::HandleCommandL().

00033                                                                 {
00034   CEikDialog* dialog = new (ELeave) CScoreDialog(aHighScores, aScore);
00035   dialog->ExecuteLD(R_SCORE_DIALOG);
00036 }

TBool CScoreDialog::OkToExitL TInt    aKeycode [private]
 

Add high score.

If the user pressed OK or enter this will add their name to the high score table.

Parameters:
aKeyCode  key pressed to exit dialog.
Returns:
ETrue as it is always ok to exit this dialog

Definition at line 55 of file CScoreDialog.cpp.

References CHighScores::AddScoreL(), EHighScoreNameControlId, iHighScores, and iScore.

00055                                            {    
00056   if(aKeycode==EEikBidOk) {
00057     CEikGlobalTextEditor *ed= STATIC_CAST(CEikGlobalTextEditor*,Control(EHighScoreNameControlId));
00058     CGlobalText *text=ed->GlobalText();
00059     iHighScores.AddScoreL(text->Read(0),iScore);
00060   }
00061   return ETrue;
00062 }


Member Data Documentation

CHighScores& CScoreDialog::iHighScores [private]
 

High score table.

Definition at line 45 of file CScoreDialog.h.

Referenced by OkToExitL().

TInt CScoreDialog::iScore [private]
 

Players score.

Definition at line 46 of file CScoreDialog.h.

Referenced by OkToExitL().


The documentation for this class was generated from the following files:
Documentation for Game (Beta) version 1.44.