📄 simpleex_ui.cpp
字号:
// simpleEx_ui.cpp
//
// Copyright (c) Symbian Software Ltd 1999 - 2007. All rights reserved.
//
/*=================================================================
This file contains the application UI class for SimpleEx.
==================================================================*/
#include "SimpleEx.h"
#include <e32cons.h>
void CSimpleExAppUi::ConstructL()
{
BaseConstructL(EAknEnableSkin);
iAppView = CSimpleExAppView::NewL(ClientRect());
iWeather = CWeatherInfo::NewL(*this);
}
CSimpleExAppUi::~CSimpleExAppUi()
{
delete iAppView;
delete iWeather;
}
void CSimpleExAppUi::TemperatureReport(TDesC& aCity, TDesC& aTemperature)
{
_LIT(KTempTitle,"Report:");
_LIT(KTempMessage,"Temperature in %S is %S");
TBuf<50> str;
str.Format(KTempMessage,&aCity,&aTemperature);
TRAPD(err,iEikonEnv->InfoWinL(KTempTitle,str));
}
void CSimpleExAppUi::TemperatureError(TDesC& aErrStr,TInt aErrCode)
{
_LIT(KErrTitle,"Error:");
_LIT(KErrMsg,"%S (%d)");
TBuf<50> str;
str.Format(KErrMsg,&aErrStr,aErrCode);
TRAPD(err,iEikonEnv->InfoWinL(KErrTitle,str));
}
void CSimpleExAppUi::HandleCommandL(TInt aCommand)
{
switch(aCommand)
{
case EAknSoftkeyExit:
Exit();
break;
case ESimpleExCommand:
{
_LIT(KMessage,"Start Selected!");
iEikonEnv->AlertWin(KMessage);
break;
}
case ESimpleExTemperatureCommand:
{
// Display the temperature in Austin, TX
_LIT(KCityCode,"AUS");
iWeather->GetTemperature(KCityCode);
}
default:
; // Do nothing
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -