chxavinfolistpopup.cpp

来自「symbian 下的helix player源代码」· C++ 代码 · 共 86 行

CPP
86
字号

/*============================================================================*
 *
 * (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
    
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?