📄 pushboxappui.cpp
字号:
/*
============================================================================
Name : pushBoxAppUi.cpp
Author :
Version :
Copyright : Your copyright notice
Description : Main application UI class (controller)
============================================================================
*/
// INCLUDE FILES
#include <avkon.hrh>
#include <aknnotewrappers.h>
#include <stringloader.h>
#include <pushBox.rsg>
#include <f32file.h>
#include <s32file.h>
#include "pushBox.pan"
#include "pushBoxAppUi.h"
#include "pushBoxAppView.h"
#include "pushBox.hrh"
// ============================ MEMBER FUNCTIONS ===============================
// -----------------------------------------------------------------------------
// CpushBoxAppUi::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CpushBoxAppUi::ConstructL()
{
// Initialise app UI with standard value.
BaseConstructL();
// Create view object
iAppView = CpushBoxAppView::NewL( ClientRect() );
}
// -----------------------------------------------------------------------------
// CpushBoxAppUi::CpushBoxAppUi()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CpushBoxAppUi::CpushBoxAppUi()
{
// No implementation required
}
// -----------------------------------------------------------------------------
// CpushBoxAppUi::~CpushBoxAppUi()
// Destructor.
// -----------------------------------------------------------------------------
//
CpushBoxAppUi::~CpushBoxAppUi()
{
if ( iAppView )
{
delete iAppView;
iAppView = NULL;
}
}
// -----------------------------------------------------------------------------
// CpushBoxAppUi::HandleCommandL()
// Takes care of command handling.
// -----------------------------------------------------------------------------
//
void CpushBoxAppUi::HandleCommandL( TInt aCommand )
{
switch( aCommand )
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
case EpushBoxCommand1:
{
// Load a string from the resource file and display it
HBufC* textResource = StringLoader::LoadLC( R_HEWB_COMMAND1_TEXT );
// Show the information Note with
// textResource loaded with StringLoader.
CAknInformationNote* informationNote = new ( ELeave ) CAknInformationNote;
informationNote->ExecuteLD( *textResource );
// Pop HBuf from CleanUpStack and Destroy it.
CleanupStack::PopAndDestroy( textResource );
}
break;
default:
Panic( EpushBoxUi );
break;
}
}
// -----------------------------------------------------------------------------
// Called by the framework when the application status pane
// size is changed. Passes the new client rectangle to the
// AppView
// -----------------------------------------------------------------------------
//
void CpushBoxAppUi::HandleStatusPaneSizeChange()
{
iAppView->SetRect( ClientRect() );
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -