00001 // Copyright 2002 Kenneth Guy, 00002 // 00003 // You are free to take the source and do as you wish with it. 00004 // However it would be nice if you let me know if the code was useful 00005 // to you and give me an acknowledgement if you use a significant portion 00006 // of the code in an application. 00007 // 00008 // CScoreDialog.cpp 00009 00013 // 00014 00015 #include <eikgted.h> 00016 #include <txtetext.h> 00017 #include <txtglobl.h> 00018 #include <eikmenup.h> 00019 00020 #include "CHighScores.h" 00021 #include "CScoreDialog.h" 00022 00033 void CScoreDialog::RunDlgLD(CHighScores &aHighScores,TInt aScore) { 00034 CEikDialog* dialog = new (ELeave) CScoreDialog(aHighScores, aScore); 00035 dialog->ExecuteLD(R_SCORE_DIALOG); 00036 } 00037 00040 CScoreDialog::CScoreDialog(CHighScores &aHighScores, TInt aScore) 00041 :iHighScores(aHighScores), iScore(aScore) { 00042 00043 } 00044 00055 TBool CScoreDialog::OkToExitL(TInt aKeycode) { 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 } 00063