?? emptyui.cpp
字號:
#include <aknnotewrappers.h>
#include <hlplch.h>
#include <avkon.hrh>
#include <EIKENV.H>
#include "Empty.rsg"
#include "EmptyUi.h"
#include "EmptyContainer.h"
#include "Empty.hrh"
#include "Empty.h"
TBool iEView = ETrue;
void CEmptyUi::ConstructL()
{
BaseConstructL();
TBool iEView = ETrue;
switch (iEView)
{
case ETrue:
//iAppContainer = new (ELeave) CEmptyContainer;
//iAppContainer->MakeVisible( EFalse );
iAppContainer2 = new (ELeave) CEmptyContainer2;
iAppContainer2->SetMopParent(this);
iAppContainer2->ConstructL(ClientRect(),iAppContainer2);
AddToStackL(iAppContainer2);
break;
case EFalse:
//iAppContainer2 = new (ELeave) CEmptyContainer2;
//iAppContainer2->MakeVisible( EFalse );
iAppContainer = new (ELeave) CEmptyContainer;
iAppContainer->SetMopParent(this);
iAppContainer->ConstructL(ClientRect());
AddToStackL(iAppContainer);
break;
default:
break;
}
//_LIT(EmptyResource,"z:\\resource\\apps\\Empty.RSC");
//TInt irscOffset=CEikonEnv::Static()->AddResourceFileL(EmptyResource);
}
CEmptyUi::~CEmptyUi()
{
if ( iAppContainer )
{
RemoveFromStack( iAppContainer );
delete iAppContainer;
}
if ( iAppContainer2 )
{
RemoveFromStack( iAppContainer2 );
delete iAppContainer2;
}
}
void CEmptyUi::DynInitMenuPaneL(
TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
{
}
TKeyResponse CEmptyUi::HandleKeyEventL(
const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
{
return EKeyWasNotConsumed;
}
void CEmptyUi::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
case EAknSoftkeyExit:
case EEikCmdExit:
case EAknCmdExit:
Exit();
break;
case EEmptyCmdTest:
{
HBufC* helloText;
helloText = iEikonEnv->AllocReadResourceL( R_EXAMPLE_TEXT_HELLO );
iEikonEnv->InfoMsg( *helloText );
delete helloText;
break;
}
case EEmptyCmdHello:
{
HBufC* helloText;
helloText = iEikonEnv->AllocReadResourceL( R_EXAMPLE_TEXT_HELLO );
CleanupStack::PushL( helloText );
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
informationNote->ExecuteLD( *helloText );
CleanupStack::PopAndDestroy();
break;
}
case EEmptyCmdSwith:
{
if(iEView)
{
RemoveFromStack(iAppContainer2);
iAppContainer = new (ELeave) CEmptyContainer;
iAppContainer->SetMopParent(this);
iAppContainer->ConstructL(ClientRect());
AddToStackL(iAppContainer);
iEView=EFalse;
}
else
{
RemoveFromStack(iAppContainer);
iAppContainer2 = new (ELeave) CEmptyContainer2;
iAppContainer2->SetMopParent(this);
iAppContainer2->ConstructL(ClientRect(),iAppContainer2);
AddToStackL(iAppContainer2);
iEView = ETrue;
}
}
default:
break;
}
}
/*CArrayFix <TCoeHelpContext>* CEmptyUi::SwithL() const
{
CArrayFixFlat <TCoeHelpContext>* array =
new ( ELeave )CArrayFixFlat <TCoeHelpContext> ( 1 );
CleanupStack::PushL( array );
_LIT(KContextChinese,"ContextChinese");
array->AppendL( TCoeHelpContext(KUidEmpty, KContextChinese) );
CleanupStack::Pop( array );
return array;
}
*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -