00001
00002
00003
00004 #include "S60ResourceLabAppUi.h"
00005 #include "S60ResourceLabContainer.h"
00006 #include <S60ResourceLab.rsg>
00007 #include "S60Resourcelab.hrh"
00008
00009 #include <avkon.hrh>
00010
00011
00012
00013
00014
00015
00016
00017
00018 void CS60ResourceLabAppUi::ConstructL()
00019 {
00020 BaseConstructL();
00021 iAppContainer = new (ELeave) CS60ResourceLabContainer;
00022 iAppContainer->SetMopParent(this);
00023 iAppContainer->ConstructL( ClientRect() );
00024 AddToStackL( iAppContainer );
00025 }
00026
00027
00028
00029
00030
00031
00032
00033 CS60ResourceLabAppUi::~CS60ResourceLabAppUi()
00034 {
00035 if (iAppContainer)
00036 {
00037 RemoveFromStack( iAppContainer );
00038 delete iAppContainer;
00039 }
00040 }
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 void CS60ResourceLabAppUi::DynInitMenuPaneL(
00052 TInt ,CEikMenuPane* )
00053 {
00054 }
00055
00056
00057
00058
00059
00060
00061
00062 TKeyResponse CS60ResourceLabAppUi::HandleKeyEventL(
00063 const TKeyEvent& ,TEventCode )
00064 {
00065 return EKeyWasNotConsumed;
00066 }
00067
00068
00069
00070
00071
00072
00073 void CS60ResourceLabAppUi::HandleCommandL(TInt aCommand)
00074 {
00075 switch ( aCommand )
00076 {
00077 case EAknSoftkeyBack:
00078 case EEikCmdExit:
00079 {
00080 Exit();
00081 break;
00082 }
00083
00084 case ES60ResourceLabCmdAppTest:
00085 {
00086 HBufC* helloworld = iCoeEnv->AllocReadResourceL(R_S60RESOURCELAB_TEXT_HELLO_WORLD);
00087 iEikonEnv->InfoMsg(*helloworld);
00088 delete helloworld;
00089 break;
00090 }
00091
00092 case ES60ResourceLabCmdGoodbye:
00093 {
00094 iAppContainer->GoodbyeL();
00095 break;
00096 }
00097
00098 default:
00099 break;
00100 }
00101 }
00102
00103