⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 marklistappui.cpp

📁 《基于Symbian OS的手机开发与应用实践》这本书的配套源码。
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CMarkListAppUi from MarkListAppui.cpp
*  Part of  : MarkList
*  Created  : 16.03.2006 by ToBeReplacedByAuthor
*  Implementation notes:
*     Initial content was generated by Series 60 Application Wizard.
*  Version  :
*  Copyright: ToBeReplacedByCopyright
* ============================================================================
*/

// INCLUDE FILES
#include <eikmenub.h>           // for CEikMenuBar 
#include <eikmenup.h>           // for CEikMenuPane
#include <avkon.hrh>
#include <avkon.rsg>
#include <aknquerydialog.h>
#include <MarkList.rsg>

#include "MarkListAppui.h"
#include "MarkListContainer.h" 
#include "MarkList.hrh"


// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CMarkListAppUi::ConstructL()
// 
// ----------------------------------------------------------
//
void CMarkListAppUi::ConstructL()
    {
    BaseConstructL();

    iAppContainer = new (ELeave) CMarkListContainer;
    iAppContainer->SetMopParent( this );
    iAppContainer->ConstructL( ClientRect() );
    AddToStackL( iAppContainer );
    }

// ----------------------------------------------------
// CMarkListAppUi::~CMarkListAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CMarkListAppUi::~CMarkListAppUi()
    {
    if (iAppContainer)
        {
        RemoveFromStack( iAppContainer );
        delete iAppContainer;
        }
   }

// ------------------------------------------------------------------------------
// CMarkListAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
//  This function is called by the EIKON framework just before it displays
//  a menu pane. Its default implementation is empty, and by overriding it,
//  the application can set the state of menu items dynamically according
//  to the state of application data.
// ------------------------------------------------------------------------------
//
void CMarkListAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
    {
    if(aResourceId == R_MARKLIST_MENU)
        {
        aMenuPane->SetItemDimmed(EMarkListCmdDelete, iAppContainer->SelectionCount()<=0);
        }
    }

// ----------------------------------------------------
// CMarkListAppUi::HandleKeyEventL(
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CMarkListAppUi::HandleKeyEventL(
    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
    {
    return EKeyWasNotConsumed;
    }

// ----------------------------------------------------
// CMarkListAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CMarkListAppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
        case EAknSoftkeyBack:
        case EEikCmdExit:
            {
            Exit();
            break;
            }
        case EMarkListCmdAdd:
            {
            TBuf<16> buf;
            CAknTextQueryDialog* dlg = new(ELeave) CAknTextQueryDialog(buf);
            if(dlg->ExecuteLD(R_AVKON_DIALOG_QUERY_VALUE_TEXT))
                {
                iAppContainer->AddRecordL(buf);
                }
            break;
            }
        case EMarkListCmdDelete:
            {
            iAppContainer->DeleteRecordL();
            break;
            }
        case EAknCmdMark:
        case EAknCmdUnmark:
        case EAknMarkAll:
        case EAknUnmarkAll:
            {
            iAppContainer->HandleMarkCommandL(aCommand);
            break;
            }
        default:
            break;
        }
    }



// End of File  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -