/*
============================================================================
Name : $(baseName)AppUi.cpp
Author : $(author)
Copyright : $(copyright)
Description : C$(baseName)AppUi implementation
============================================================================
*/
// INCLUDE FILES
#include "$(baseName)Application.h"
#include "$(baseName)Appui.h"
#include "$(baseName)View.h"
#include "$(baseName)View2.h"
#include <hlplch.h>
#include <$(baseName).rsg>
#include "$(baseName).hrh"
#include "$(baseName).hlp.hrh"
#include <avkon.hrh>
#include <aknmessagequerydialog.h>
#include <aknglobalnote.h>
#include <hlplch.h>
// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// C$(baseName)AppUi::ConstructL()
//
// ----------------------------------------------------------
//
void C$(baseName)AppUi::ConstructL()
{
BaseConstructL(EAknEnableSkin);
// Show tabs for main views from resources
CEikStatusPane* sp = StatusPane();
// Fetch pointer to the default navi pane control
iNaviPane = (CAknNavigationControlContainer*)sp->ControlL(
TUid::Uid(EEikStatusPaneUidNavi));
// Tabgroup has been read from resource and it were pushed to the navi pane.
// Get pointer to the navigation decorator with the ResourceDecorator() function.
// Application owns the decorator and it has responsibility to delete the object.
iDecoratedTabGroup = iNaviPane->ResourceDecorator();
if (iDecoratedTabGroup)
{
iTabGroup = (CAknTabGroup*) iDecoratedTabGroup->DecoratedControl();
iTabGroup->SetObserver( this );
}
C$(baseName)View* view1 = new (ELeave) C$(baseName)View;
CleanupStack::PushL( view1 );
view1->ConstructL();
AddViewL( view1 ); // transfer ownership to CAknViewAppUi
CleanupStack::Pop(); // view1
C$(baseName)View2* view2 = new (ELeave) C$(baseName)View2;
CleanupStack::PushL( view2 );
view2->ConstructL();
AddViewL( view2 ); // transfer ownership to CAknViewAppUi
CleanupStack::Pop(); // view2
SetDefaultViewL(*view1);
}
// ----------------------------------------------------
// C$(baseName)AppUi::~C$(baseName)AppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
C$(baseName)AppUi::~C$(baseName)AppUi()
{
delete iDecoratedTabGroup;
}
// ------------------------------------------------------------------------------
// C$(baseName)AppUi::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 C$(baseName)AppUi::DynInitMenuPaneL(
TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
{
}
// ----------------------------------------------------
// C$(baseName)AppUi::HandleKeyEventL(
// const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse C$(baseName)AppUi::HandleKeyEventL(
const TKeyEvent& aKeyEvent,TEventCode aType)
{
if ( iTabGroup == NULL )
{
return EKeyWasNotConsumed;
}
if ( aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyRightArrow )
{
return iTabGroup->OfferKeyEventL( aKeyEvent, aType );
}
else
{
return EKeyWasNotConsumed;
}
}
// ----------------------------------------------------
// C$(baseName)AppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void C$(baseName)AppUi::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EAknSoftkeyExit:
case EEikCmdExit:
{
Exit();
break;
}
case E$(baseName)CmdHelp:
{
CArrayFix<TCoeHelpContext>* buf = CCoeAppUi::AppHelpContextL();
HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), buf);
break;
}
case E$(baseName)CmdAbout:
{
CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog();
dlg->PrepareLC(R_ABOUT_QUERY_DIALOG);
HBufC* title = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TITLE);
dlg->QueryHeading()->SetTextL(*title);
CleanupStack::PopAndDestroy(); //title
HBufC* msg = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TEXT);
dlg->SetMessageTextL(*msg);
CleanupStack::PopAndDestroy(); //msg
dlg->RunLD();
break;
}
// TODO: Add Your command handling code here
default:
break;
}
}
// ----------------------------------------------------
// C$(baseName)AppUi::TabChangedL(TInt aIndex)
// This method gets called when CAknTabGroup active
// tab has changed.
// ----------------------------------------------------
//
void C$(baseName)AppUi::TabChangedL(TInt aIndex)
{
ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(aIndex)));
}
CArrayFix<TCoeHelpContext>* C$(baseName)AppUi::HelpContextL() const
{
#warning "Please see comment about help and UID3..."
// Note: Help will not work if the application uid3 is not in the
// protected range. The default uid3 range for projects created
// from this template (0xE0000000 - 0xEFFFFFFF) are not in the protected range so that they
// can be self signed and installed on the device during testing.
// Once you get your official uid3 from Symbian Ltd. and find/replace
// all occurrences of uid3 in your project, the context help will
// work.
CArrayFixFlat<TCoeHelpContext>* array = new(ELeave)CArrayFixFlat<TCoeHelpContext>(1);
CleanupStack::PushL(array);
array->AppendL(TCoeHelpContext(KUid$(baseName)App, KGeneral_Information));
CleanupStack::Pop(array);
return array;
}
没有合适的资源?快使用搜索试试~ 我知道了~
Carbide.C++s60.3rd 多视图工程模板
共32个文件
cpp:8个
h:7个
xml:4个
需积分: 10 26 下载量 184 浏览量
2008-12-25
14:25:18
上传
评论
收藏 23KB RAR 举报
温馨提示
Carbide.C++s60.3rd 多视图工程模板
资源推荐
资源详情
资源评论
收起资源包目录
S60-3rdViewApplication.rar (32个子文件)
S60-ViewApplication
group
Basename.mmp 1KB
bld.inf 494B
Icons_scalable_dc.mk 1KB
sis
Basename.pkg 2KB
backup_registration.xml 144B
template.properties 2KB
help
Basename.cshlp 545B
Basename.xml 488B
build_help.mk 1KB
Custom.xml 660B
inc
Basename.pan 665B
BasenameAppUi.h 2KB
Basename.hrh 684B
BasenameDocument.h 1KB
BasenameContainer.h 2KB
BasenameApplication.h 1KB
BasenameView.h 2KB
BasenameContainer2.h 2KB
BasenameView2.h 2KB
src
Basename.cpp 550B
BasenameView.cpp 3KB
BasenameView2.cpp 3KB
BasenameApplication.cpp 1KB
BasenameAppUi.cpp 6KB
BasenameDocument.cpp 1KB
BasenameContainer.cpp 3KB
BasenameContainer2.cpp 3KB
gfx
qgn_menu_baseName.svg 4KB
template.xml 7KB
data
baseName.rls 1KB
baseName.rss 5KB
baseName_reg.rss 729B
共 32 条
- 1
资源评论
Max__Payne
- 粉丝: 154
- 资源: 31
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功