⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dialogcontainer.cpp

📁 《基于symbian os 的手机开发与应用》 源代码 何伟 著
💻 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 + -