chxavinfolistpopup.cpp
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:2k
源码类别:
Symbian
开发平台:
Visual C++
- /*============================================================================*
- *
- * (c) 1995-2002 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- *============================================================================*/
- #include "chxavmisc.h"
- #include "chxavinfolist.h"
- #include "chxavcleanupstack.h"
- #include "chxavinfolistpopup.h"
- ///////////////////////////////////
- // ctor
- CHXAvInfoListPopup::CHXAvInfoListPopup()
- : m_pDisplayLines(0)
- {
- }
- ///////////////////////////////////
- // dtor
- CHXAvInfoListPopup::~CHXAvInfoListPopup()
- {
- HX_DELETE(m_pDisplayLines);
- }
- ///////////////////////////////////
- //
- void CHXAvInfoListPopup::ConstructL(const TDesC& title, CHXAvInfoList* pList)
- {
- SetTitleL(title);
- m_pListBox = new (ELeave) CAknSingleHeadingPopupMenuStyleListBox;
- m_pDisplayLines = pList; // assume ownership
- }
- ///////////////////////////////////
- //
- void CHXAvInfoListPopup::ConstructL(const TDesC& title, const MDesCArray* pCaptions, const MDesCArray* pFields)
- {
- CHXAvInfoList* pList = new (ELeave) CHXAvInfoList();
- pList->AddLinesL(pCaptions, pFields);
- ConstructL(title, pList);
- }
- ///////////////////////////////////
- //
- void CHXAvInfoListPopup::SetTitleL(const TDesC& title)
- {
- m_spTitle = title.AllocL();
- }
- ///////////////////////////////////
- // run then delete this on exit
- void CHXAvInfoListPopup::ExecuteLD()
- {
- // delete this on exit
- AUTO_PUSH_POP_DEL(this);
- CAknPopupList* pPopup = CAknPopupList::NewL(m_pListBox.Ptr(),
- R_AVKON_SOFTKEYS_OK_EMPTY, //R_AVP_SOFTKEYS_OK,
- AknPopupLayouts::EMenuGraphicHeadingWindow);
- // save cleanupstack init until LD
- {
- AUTO_PUSH_POP(pPopup);
- TInt flags = EAknListBoxViewerFlags;
- m_pListBox->ConstructL(pPopup, flags);
- m_pListBox->CreateScrollBarFrameL(ETrue);
- m_pListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
- if( m_spTitle )
- {
- pPopup->SetTitleL(*m_spTitle);
- }
- // transfer ownership of item array to the list box
- m_pListBox->Model()->SetItemTextArray(m_pDisplayLines);
- m_pDisplayLines = 0;
- }
- pPopup->ExecuteLD(); // self-destroying
- }