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

📄 helloview.cpp

📁 这是一个关于Symbian Gird控件的程序
💻 CPP
字号:
/* Copyright (c) 2007, Nokia. All rights reserved */

#include "ldk008appui.h"
#include "HelloView.h"
#include "HelloContainer.h"
//#include "Projectname.hrh"
#include "LDK008.rsg"
#include "LDK008.hrh"


CHelloView* CHelloView::NewL()
{
    CHelloView* self = NewLC();
    CleanupStack::Pop(self);
    return self;
}

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

void CHelloView::ConstructL()
{
	BaseConstructL(R_HELP_VIEW);
}

CHelloView::CHelloView()
{
	iContainer = NULL;
}


CHelloView::~CHelloView()
{
}

TUid CHelloView::Id() const
{
	return TUid::Uid(3);
}

void CHelloView::HandleCommandL(TInt aCommand)
{
	switch (aCommand)
	{
	case EHelpMenuEdit:
		{
			iContainer->SetTextToListL(0, _L("This is a Test!"));
 			iContainer->SetTextToListL(1, _L("This is a Test!"));
 			iContainer->SetTextToListL(3, _L("This is a Test!"));			iContainer->SetTextToListL(8, _L("This is a Test!"));
 			iContainer->SetTextToListL(10, _L("This is a Test!"));
			//切换视图
			//AppUi()->ActivateLocalViewL(TUid::Uid(2));
		}
		break;
	case EHelpMenuHelp:
		{
			TInt nCurr = iContainer->GetIndexFromList();
			iContainer->DeleteTextFromList(nCurr);
		}
		break;
	default:
		AppUi()->HandleCommandL(aCommand);
		break;
	}
	
}

void CHelloView::HandleClientRectChange()
{

}

void CHelloView::DoActivateL(const TVwsViewId&, TUid, const TDesC8&)
{
	iContainer = new( ELeave ) CHelloContainer();
	iContainer->SetMopParent(this);
	iContainer->ConstructL( ClientRect() );	
	AppUi()->AddToStackL( *this, iContainer );
}

void CHelloView::DoDeactivate()
{
	if(iContainer)
	{
		AppUi()->RemoveFromStack( iContainer );
		delete iContainer;
		iContainer = NULL;
	}
}

⌨️ 快捷键说明

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