📄 numericeditorappui.cpp
字号:
/**
*
* @brief Definition of CNumericEditorAppUi
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/
// INCLUDE FILES
// Class include
#include "NumericEditorAppUi.h"
// System includes
#include <eikmenup.h> // CEikMenuPane
#include <NumericEditor.rsg>
// User includes
#include "NumericEditorContainer.h" // CNumericEditorContainer
#include "NumericEditor.hrh" // commands
// ================= MEMBER FUNCTIONS =======================
/**
* Symbian OS 2nd phase constructor. Constructs the application's container,
* setting itself as the container's MOP parent, and adds it to the control
* stack.
*/
void CNumericEditorAppUi::ConstructL()
{
BaseConstructL();
iAppContainer = CNumericEditorContainer::NewL(ClientRect());
iAppContainer->SetMopParent(this);
AddToStackL(iAppContainer);
}
/**
* Destructor.
* Removes the application's container from the stack and deletes it.
*/
CNumericEditorAppUi::~CNumericEditorAppUi()
{
if (iAppContainer)
{
RemoveFromStack(iAppContainer);
delete iAppContainer;
}
}
/**
* From CEikAppUi, takes care of command handling.
*
* @param aCommand command to be handled
*/
void CNumericEditorAppUi::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
case ENumericEditorCmdNew:
{
iAppContainer->NewEmployeeL();
break;
}
case ENumericEditorCmdOpen:
{
iAppContainer->OpenEmployeeL();
break;
}
case ENumericEditorCmdDelete:
{
iAppContainer->DeleteEmployeeL();
break;
}
case EAknSoftkeyBack:
case EEikCmdExit:
{
Exit();
break;
}
default:
break;
}
}
void CNumericEditorAppUi::DynInitMenuPaneL (TInt aResourceId, CEikMenuPane* aMenuPane)
{
if (aResourceId == R_NUMERICEDITOR_MENU_PANE)
{
TBool dimOpenAndDelete = (iAppContainer->NumberOfEmployees() <= 0);
aMenuPane->SetItemDimmed(ENumericEditorCmdOpen, dimOpenAndDelete);
aMenuPane->SetItemDimmed(ENumericEditorCmdDelete, dimOpenAndDelete);
}
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -