📄 dialogappui.cpp
字号:
/*
* ============================================================================
* Name : CDialogAppUi from DialogAppUi.cpp
* Part of : Dialog
* Created : 2006-1-8 by Hewei
* Implementation notes:
* Initial content was generated by Series 60 AppWizard.
* Version :
* Copyright: Myself
* ============================================================================
*/
// INCLUDE FILES
#include "DialogAppUi.h"
#include "DialogContainer.h"
#include <Dialog.rsg>
#include "dialog.hrh"
#include <avkon.hrh>
#include <stringloader.h>
#include <aknnotewrappers.h>
// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CDialogAppUi::ConstructL()
//
// ----------------------------------------------------------
//
void CDialogAppUi::ConstructL()
{
BaseConstructL();
iAppContainer = new (ELeave) CDialogContainer;
iAppContainer->SetMopParent( this );
iAppContainer->ConstructL( ClientRect() );
AddToStackL( iAppContainer );
}
// ----------------------------------------------------
// CDialogAppUi::~CDialogAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CDialogAppUi::~CDialogAppUi()
{
if (iAppContainer)
{
RemoveFromStack( iAppContainer );
delete iAppContainer;
}
}
// ------------------------------------------------------------------------------
// CDialogAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
// This function is called by the EIKON framework just before it displays
// a menu pane. Its default implementation is empty, and by overriding it,
// the application can set the state of menu items dynamically according
// to the state of application data.
// ------------------------------------------------------------------------------
//
void CDialogAppUi::DynInitMenuPaneL(
TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
{
}
// ----------------------------------------------------
// CDialogAppUi::HandleKeyEventL(
// const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CDialogAppUi::HandleKeyEventL(
const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
{
return EKeyWasNotConsumed;
}
// ----------------------------------------------------
// CDialogAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CDialogAppUi::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EAknSoftkeyBack:
case EEikCmdExit:
{
Exit();
break;
}
case EDialogCmdAppShowDlg:
{
if(CSimpleDialog::RunDlgLD())
{
}
break;
}
// TODO: Add Your command handling code here
case EDialogCmdAppDlgNote:
{
HBufC* noteText;
noteText=StringLoader::LoadLC(R_NOTE_TEXT);
CAknInformationNote* note=new(ELeave)CAknInformationNote();
note->ExecuteLD(*noteText);
CleanupStack::PopAndDestroy(noteText);
break;
}
case EDialogCmdAppForm:
{
CMyForm* form=CMyForm::NewL();
form->ExecuteLD(R_MYFORM_DIALOG);
break;
}
case EDialogCmdAppNote1:
{
CAknNoteDialog* note=new (ELeave)CAknNoteDialog(CAknNoteDialog::EConfirmationTone,
CAknNoteDialog::EShortTimeout);
note->PrepareLC(R_CONFIRMATIONNOTE_SELF_DEFINE_NOTE);
TInt number=5;
note->SetTextPluralityL(number>1);
note->SetTextNumberL(number);
note->RunLD();
break;
}
case EDialogCmdAppDataQuery:
{
TBuf<20> FileName;
CAknTextQueryDialog* QueryDialog=CAknTextQueryDialog::NewL(FileName);
CleanupStack::PushL(QueryDialog);
HBufC* prompt=StringLoader::LoadLC(R_DATA_QUERY_PROMPT);
QueryDialog->SetPromptL(*prompt);
CleanupStack::PopAndDestroy(prompt);
CleanupStack::Pop(QueryDialog);
if(QueryDialog->ExecuteLD(R_DATA_QUERY_DIALOG))
{
}
}
case EDialogCmdAppListQuery:
{
TInt Index(0);
CAknListQueryDialog* listquery=new(ELeave)CAknListQueryDialog(&Index);
listquery->PrepareLC(R_LIST_QUERY_DIALOG);
listquery->SetItemTextArray(iAppContainer->GetItemList());
listquery->SetOwnershipType(ELbmDoesNotOwnItemArray);
if(listquery->RunLD())
{
}
}
default:
break;
}
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -