?? dialogcontainer.cpp
字號:
/*
* ============================================================================
* Name : CDialogContainer from DialogContainer.h
* 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 "DialogContainer.h"
#include "dialog.rsg"
#include <stringloader.h>
#include <aknnotedialog.h>
#include <akniconarray.h>
#include <dialog.mbg>
#include <aknselectionlist.h>
// ================= MEMBER FUNCTIONS =======================
// ---------------------------------------------------------
// CDialogContainer::ConstructL(const TRect& aRect)
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CDialogContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();
SetItemListArrayL();
CAknNoteDialog* note=new(ELeave)CAknNoteDialog(CAknNoteDialog::EConfirmationTone,
CAknNoteDialog::EShortTimeout);
note->PrepareLC(R_CONFIRMATIONNOTE_SELF_DEFINE_NOTE);
note->SetTextPluralityL(ETrue);
note->RunLD();
SetRect(aRect);
ActivateL();
}
// Destructor
CDialogContainer::~CDialogContainer()
{
if (iListQueryItemArray)
{
iListQueryItemArray->Reset();
delete iListQueryItemArray;
}
}
// ---------------------------------------------------------
// CDialogContainer::SizeChanged()
// Called by framework when the view size is changed
// ---------------------------------------------------------
//
void CDialogContainer::SizeChanged()
{
// TODO: Add here control resize code etc.
// iDialog->SizeChanged();
}
// ---------------------------------------------------------
// CDialogContainer::CountComponentControls() const
// ---------------------------------------------------------
//
TInt CDialogContainer::CountComponentControls() const
{
return 0; // return nbr of controls inside this container
}
// ---------------------------------------------------------
// CDialogContainer::ComponentControl(TInt aIndex) const
// ---------------------------------------------------------
//
CCoeControl* CDialogContainer::ComponentControl(TInt aIndex) const
{
switch ( aIndex )
{
case 0:
// return iDialog;
default:
return NULL;
}
}
// ---------------------------------------------------------
// CDialogContainer::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CDialogContainer::Draw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();
// TODO: Add your drawing code here
// example code...
gc.SetPenStyle( CGraphicsContext::ENullPen );
gc.SetBrushColor( KRgbGray );
gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
gc.DrawRect( aRect );
}
// ---------------------------------------------------------
// CDialogContainer::HandleControlEventL(
// CCoeControl* aControl,TCoeEvent aEventType)
// ---------------------------------------------------------
//
void CDialogContainer::HandleControlEventL(
CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
{
// TODO: Add your control event handler code here
}
//TKeyResponse CDialogContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode& aType)
//{
// return iDialog->OfferKeyEventL(aKeyEvent,aType);
//}
void CDialogContainer::SaveL()
{
// CAknWaitNoteWrapper* waitNote=CAknWaitNoteWrapper::NewL();
// CleanupStack::PushL(static_cast<CBase*>(waitNote));
//}
//if(!waitNot->ExecuteL(R_WAATTING_NOTE,*this))
//{
//}
//CleanupStack::PopAndDestroy(waitNote);
}
void CDialogContainer::SetItemListArrayL()
{
iListQueryItemArray = new (ELeave) CDesCArrayFlat(5);
_LIT (KStringHeader, "Item %d");
TBuf <16> aString;
for (TInt i = 1; i<= 5; i++)
{
aString.Format(KStringHeader(), i);
iListQueryItemArray->AppendL (aString);
}
}
CDesCArrayFlat* CDialogContainer::GetItemList()
{
return iListQueryItemArray;
}
// End of File
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -