📄 listviews_appui.cpp
字号:
/*****************************************************************************
COPYRIGHT All rights reserved Sony Ericsson Mobile Communications AB 2005.
The software is the copyrighted work of Sony Ericsson Mobile Communications AB.
The use of the software is subject to the terms of the end-user license
agreement which accompanies or is included with the software. The software is
provided "as is" and Sony Ericsson specifically disclaim any warranty or
condition whatsoever regarding merchantability or fitness for a specific
purpose, title or non-infringement. No warranty of any kind is made in
relation to the condition, suitability, availability, accuracy, reliability,
merchantability and/or non-infringement of the software provided herein.
*****************************************************************************/
// ListViews_AppUi.cpp
//
//
#include "ListViews_AppUi.h"
#include "ListViews_Document.h"
#include "ListViews_Application.h" // KUidListViews
#include "ListViews_AppView.h"
#include "ColumnListView.h"
#include "TextListView.h"
#include "SnakingListView.h"
#include "HierarchicalListView.h"
#include <gdi.h>
void CListViewsAppUi::ConstructL()
{
CQikAppUi::ConstructL();
iAppView = CListViewsAppView::NewL(ClientRect());
AddToStackL(*iAppView, iAppView);
RegisterViewL(*iAppView);
iColumnListView = CColumnListView::NewL(ClientRect());
AddToStackL(*iColumnListView, iColumnListView);
RegisterViewL(*iColumnListView);
iTextListView = CTextListView::NewL(ClientRect());
AddToStackL(*iTextListView, iTextListView);
RegisterViewL(*iTextListView);
iSnakingListView = CSnakingListView::NewL(ClientRect());
AddToStackL(*iSnakingListView, iSnakingListView);
RegisterViewL(*iSnakingListView);
iHierarchicalListView = CHierarchicalListView::NewL(ClientRect());
AddToStackL(*iHierarchicalListView, iHierarchicalListView);
RegisterViewL(*iHierarchicalListView);
// iViewType = EAppView;
iViewType = EColumnListView;
// iViewType = ETextListView;
// iViewType = ESnakingListView;
// iViewType = EHierarchicalListView;
// SetDefaultViewL(*iAppView);
SetDefaultViewL(*iColumnListView);
// SetDefaultViewL(*iTextListView);
// SetDefaultViewL(*iSnakingListView);
// SetDefaultViewL(*iHierarchicalListView);
}
CListViewsAppUi::~CListViewsAppUi()
{
if( iAppView )
{
RemoveFromStack(iAppView);
DeregisterView(*iAppView);
delete iAppView;
}
if( iColumnListView )
{
RemoveFromStack(iColumnListView);
DeregisterView(*iColumnListView);
delete iColumnListView;
}
if( iTextListView )
{
RemoveFromStack(iTextListView);
DeregisterView(*iTextListView);
delete iTextListView;
}
if( iSnakingListView )
{
RemoveFromStack(iSnakingListView);
DeregisterView(*iSnakingListView);
delete iSnakingListView;
}
if( iHierarchicalListView )
{
RemoveFromStack(iHierarchicalListView);
DeregisterView(*iHierarchicalListView);
delete iHierarchicalListView;
}
}
void CListViewsAppUi::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
// Just issue simple info messages to show that
// the menu items have been selected
case EListViewsCmdAppView:
CmdSetView(EAppView);
break;
case EListViewsCmdColumnListView:
CmdSetView(EColumnListView);
break;
case EListViewsCmdTextListView:
CmdSetView(ETextListView);
break;
case EListViewsCmdSnakingListView:
CmdSetView(ESnakingListView);
break;
case EListViewsCmdHierarchicalListView :
CmdSetView(EHierarchicalListView);
break;
case EListViewsCmdColumnOpt1 :
case EListViewsCmdColumnOpt2 :
switch(iViewType)
{
case EColumnListView :
iColumnListView->HandleCommandL(aCommand);
break;
case ETextListView :
iTextListView->HandleCommandL(aCommand);
break;
case ESnakingListView :
iSnakingListView->HandleCommandL(aCommand);
break;
default : break;
}
break;
case EListViewsCmdColumnOpt3 :
case EListViewsCmdColumnOpt4 :
case EListViewsCmdColumnOpt5 :
case EListViewsCmdColumnOpt6 :
case EListViewsCmdColumnOpt7 :
if( iViewType == EColumnListView )
iColumnListView->HandleCommandL(aCommand);
break;
case EListViewsCmdHierExpand :
iHierarchicalListView->ListPerformElement(ETrue);
break;
case EListViewsCmdHierColapse :
iHierarchicalListView->ListPerformElement(EFalse);
break;
case EListViewsCmdHierExpandAll :
iHierarchicalListView->ListPerform(ETrue);
break;
case EListViewsCmdHierColapseAll :
iHierarchicalListView->ListPerform(EFalse);
break;
// Exit the application. The call is implemented by the UI framework.
case EEikCmdExit:
Exit();
break;
}
}
void CListViewsAppUi::CmdSetView(TViewType aFlag)
{
if( iViewType == aFlag )
return;
iViewType = aFlag;
switch(aFlag)
{
case EAppView :
ActivateViewL(iAppView->ViewId());
break;
case EColumnListView :
ActivateViewL(iColumnListView->ViewId());
break;
case ETextListView :
ActivateViewL(iTextListView->ViewId());
break;
case ESnakingListView :
ActivateViewL(iSnakingListView->ViewId());
break;
case EHierarchicalListView :
ActivateViewL(iHierarchicalListView->ViewId());
break;
default : break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -