helpview.cpp

来自「symbian 3nd 实现短信息收发」· C++ 代码 · 共 133 行

CPP
133
字号
/*
* ============================================================================
*  Name     : CHelpView from CAknView
*  Part of  : Help
*  Copyright (c) 2003 Nokia. All rights reserved.
* ============================================================================
*/

// INCLUDE FILES
#include <aknviewappui.h>
#include <avkon.hrh>
#include "akntitle.h"
#include <FrMes.rsg>
#include "FrMes.hrh"
#include "HelpView.h"
#include "HelpContainer.h" 

// ================= MEMBER FUNCTIONS =======================

// C++ default constructor can NOT contain any code, that
// might leave.
//
CHelpView* CHelpView::NewL()
{
    CHelpView* self = NewLC();
    CleanupStack::Pop(self);
    return self;
}

CHelpView* CHelpView::NewLC()
{
    CHelpView* self = new (ELeave) CHelpView;
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
}

CHelpView::CHelpView()
    {
    }

// EPOC default constructor can leave.
void CHelpView::ConstructL()
    {
    BaseConstructL(R_HELP_VIEW);
    }

// Destructor
CHelpView::~CHelpView()
    {
    if (iContainer)
        {
        AppUi()->RemoveFromStack(iContainer);
        }

    delete iContainer;
    }

// ---------------------------------------------------------
// TUid CHelpView::Id()
// Returns Id of the view.
// ---------------------------------------------------------
TUid CHelpView::Id() const
    {
    return KHelpViewId;
    }

// ---------------------------------------------------------
// CHelpView::HandleCommandL(TInt aCommand)
// Handles commands
// ---------------------------------------------------------
void CHelpView::HandleCommandL(TInt aCommand)
{
	if(aCommand == EAknSoftkeyBack)
	{
		AppUi()->HandleCommandL(aCommand);
	}
}

// ---------------------------------------------------------
// CHelpView::HandleClientRectChange()
// Handles client rect change.
// ---------------------------------------------------------
void CHelpView::HandleClientRectChange()
    {
    if (iContainer)
        {
        iContainer->SetRect(ClientRect());
        }
    }

// ---------------------------------------------------------
// CHelpView::DoActivateL(...)
// Creates the Container class object.
// ---------------------------------------------------------
void CHelpView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
                                    TUid /*aCustomMessageId*/,
                                    const TDesC8& /*aCustomMessage*/)
    {
    iContainer = new (ELeave) CHelpContainer;
    iContainer->SetMopParent(this);
	//===============================modify cba by wzg===============
		TRect rc;
		rc.SetRect(ClientRect().iTl, TSize(176, 144));
		iContainer->ConstructL(rc);
		AppUi()->AddToStackL(*this, iContainer);

	//modify title by wzg
		TBuf<32> sTmpTitle;
		CEikStatusPane* statusPane = StatusPane();
		CEikonEnv::Static()->ReadResource(sTmpTitle,R_FRMES_VIEW_TITLE_HELP);
		CAknTitlePane* titlePane = (CAknTitlePane*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
		titlePane->SetTextL(sTmpTitle);
    }

// ---------------------------------------------------------
// CHelpView::DoDeactivate()
// Deletes the Container class object.
// ---------------------------------------------------------
void CHelpView::DoDeactivate()
    {
    if (iContainer)
        {
        AppUi()->RemoveFromStack(iContainer);
        }
    
    delete iContainer;
    iContainer = NULL;
    }

// End of File

⌨️ 快捷键说明

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