📄 exelauncher_appview.cpp
字号:
// ExeLauncher_AppView.cpp
//
// Copyright (c) 2002 Symbian Ltd. All rights reserved.
//
#include "ExeLauncher_AppView.h"
CExeLauncherAppView* CExeLauncherAppView::NewL(const TRect& aRect)
{
CExeLauncherAppView * self = new(ELeave) CExeLauncherAppView;
CleanupStack::PushL(self);
self->ConstructL(aRect);
CleanupStack::Pop();
return self;
}
CExeLauncherAppView::~CExeLauncherAppView()
{
delete iTextListBox;
}
void CExeLauncherAppView::ConstructL(const TRect& aRect)
{
CreateWindowL();
SetRect(aRect);
iTextListBox = new(ELeave) CEikTextListBox;
iTextListBox->ConstructL(this,0);
iTextListBox->CreateScrollBarFrameL();
iTextListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
iTextListBox->SetBorder(TGulBorder::EDeepSunken);
TRect lbRect = Rect();
lbRect.Shrink(10,10);
iTextListBox->SetRect(lbRect);
iNamesArray = static_cast<CDesCArray*>(iTextListBox->Model()->ItemTextArray());
}
void CExeLauncherAppView::AppendItemsAndActivateL(const CDir* aFileList)
{
TInt n = 0;
if (aFileList)
{
n = aFileList->Count();
}
if (n>0)
{
for (TInt i = 0; i < n; i++)
{
TPtrC ThisName = (*aFileList)[i].iName;
iNamesArray->AppendL(ThisName);
}
}
else
{
HBufC* msg=iCoeEnv->AllocReadResourceLC(R_EXELAUNCHER_TEXT_NOTFOUND);
iNamesArray->AppendL(*msg);
CleanupStack::PopAndDestroy(msg);
}
iTextListBox->HandleItemAdditionL();
iTextListBox->SetCurrentItemIndex(0);
iTextListBox->SetFocus(ETrue);
ActivateL();
}
CCoeControl* CExeLauncherAppView::ComponentControl(TInt /* aIndex */) const
{
return iTextListBox;
}
TInt CExeLauncherAppView::CountComponentControls() const
{
return 1;
}
TInt CExeLauncherAppView::GetCurrentItem()
{
return iTextListBox->CurrentItemIndex();
}
void CExeLauncherAppView::Draw(const TRect& /*aRect*/) const
{
// Window graphics context
CWindowGc& gc = SystemGc();
// Start with a clear screen
gc.Clear();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -