📄 ldcno3appui.cpp
字号:
/* Copyright (c) 2008, Nokia. All rights reserved */
#include <avkon.hrh>
#include <aknnotewrappers.h>
#include "LDCNO3.pan"
#include "LDCNO3AppUi.h"
#include "LDCNO3AppView.h"
#include "LDCNO3.hrh"
void CLDCNO3AppUi::ConstructL()
{
BaseConstructL(EAknEnableSkin);
iAppView = CLDCNO3AppView::NewL(ClientRect());
AddToStackL(iAppView);
}
CLDCNO3AppUi::CLDCNO3AppUi()
{
// add any construction that cannot leave here
}
CLDCNO3AppUi::~CLDCNO3AppUi()
{
if (iAppView)
{
iEikonEnv->RemoveFromStack(iAppView);
delete iAppView;
iAppView = NULL;
}
}
void CLDCNO3AppUi::HandleCommandL(TInt aCommand)
{
TInt8 Num1 = 100;
TReal32 Num2 = 10.5f;
TReal32 Num3 = 0.0f;
TReal32 Num4 = 0.0f;
TReal32 Num5 = 0.0f;
TReal32 Num6 = 0.0f;
Num3 = (TReal32)Num1 + Num2;
Num4 = (TReal32)Num1 - Num2;
Num5 = (TReal32)Num1 * Num2;
// Num5 = 129.00f;
Num6 = (TReal32)Num1 / Num2;
TBuf16<12> buf1;
buf1.Format( _L( "%5.2f" ) , Num3 );
TBuf16<12> buf2;
buf2.Format( _L( "%5.2f" ) , Num4 );
TBuf16<12> buf3;
buf3.Format( _L( "%6.2f" ) , Num5 );
/*
TBuf16<5> buf3;
buf3.Format( _L( "%6.2f" ) , Num5 );
*/
TBuf16<12> buf4;
buf4.Format( _L( "%5.2f" ) , Num6 );
switch(aCommand)
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
case ELDCNOSONGCommand1:
{
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
informationNote->ExecuteLD(buf1);
}
break;
case ELDCNOSONGCommand2:
{
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
informationNote->ExecuteLD(buf2);
}
break;
case ELDCNOSONGCommand3:
{
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
informationNote->ExecuteLD(buf3);
}
break;
case ELDCNOSONGCommand4:
{
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
informationNote->ExecuteLD(buf4);
}
break;
default:
Panic(ELDCNO3BasicUi);
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -