    #include <avkon.hrh>
    #include <aknnotewrappers.h>

    #include "MyApp.pan"
    #include "MyAppAppUi.h"
    #include "MyAppAppView.h"
    #include "MyApp.hrh"

    // ConstructL is called by the application framework
    void CMyAppAppUi::ConstructL()
    {
    	// load the menu, etc. configuration from the resources
        BaseConstructL();

        // create the AppView - the control that will be able to draw on the screen
        iAppView = CMyAppAppView::NewL(ClientRect());

        // required e.g. to display scroll buttons
        iAppView->SetMopParent(this);

        // add the control to the control stack - it will recieve key press events
        AddToStackL(iAppView);
    }

    CMyAppAppUi::CMyAppAppUi()
    {
    	// no implementation required
    }

    CMyAppAppUi::~CMyAppAppUi()
    {
        if (iAppView)
        {
            RemoveFromStack(iAppView);
            delete iAppView;
            iAppView = NULL;
        }
    }

    // handle any menu commands. This function is called if the user selects an
    // option from the menu of the softkeys defined in the resources file
    void CMyAppAppUi::HandleCommandL(TInt aCommand)
    {
        switch(aCommand)
        {
            case EEikCmdExit:
            case EAknSoftkeyExit:
                Exit();
                break;

            case EMyAppCommand1:
            {
                _LIT(message,"Hello!");
                CAknInformationNote *informationNote = new(ELeave) CAknInformationNote;
                informationNote->ExecuteLD(message);
            }
            break;

            default:
                Panic(EMyAppBasicUi);
                break;
        }
    }