chxavrecentclipspopuplist.cpp

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

CPP
112
字号
/************************************************************************
 * chxavrecentclipspopuplist.cpp
 * -----------------------------
 *
 * Synopsis:
 * Contains the class implementation of CHXAvRecentClipsPopupList.  This 
 * put up a dialog with the recently played clips.
 *
 *
 *
 * Target:
 * Symbian OS
 *
 *
 * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
 *
 *****************************************************************************/

// Symbian includes...
#include <avkon.mbg>

// Helix includes...

// Includes from this project...
#include "chxavcleanupstack.h"
#include "chxavmisc.h"
#include "chxavrecentclipspopuplist.h"
#include "chxavcleanstring.h"
#include "realplayer.mbg"


CHXAvRecentClipsPopupList::CHXAvRecentClipsPopupList(TInt& idxSelected)
: m_pListBox(0)
, m_idxSelected(idxSelected)
{
}

CHXAvRecentClipsPopupList::~CHXAvRecentClipsPopupList()
{
    HX_DELETE(m_pListBox);
}

////////////////////////////////////////////////
//
void CHXAvRecentClipsPopupList::ConstructL(CHXAvURLList *recentClips)
{
    // create listbox that this popup list uses/manages
    m_pListBox 	= new (ELeave) CAknSingleGraphicPopupMenuStyleListBox;
    
    CAknPopupList::ConstructL(m_pListBox, R_AVKON_SOFTKEYS_OK_BACK,
	AknPopupLayouts::EMenuGraphicWindow);
    
    m_pListBox->ConstructL(this, CEikListBox::ELeftDownInViewRect);
    m_pListBox->CreateScrollBarFrameL(ETrue);
    m_pListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
	CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);

    // XXXLCM are EMbmRealplayerFile_local, EMbmRealplayerFile_mmc not used? check mbm
    // see CHXAvMisc::ClipTypeIconIndex; order is important
     static const CHXAvMisc::ImageInfo images[] =
    { 
        {EMbmRealplayerQgn_prop_phone_small,        EMbmRealplayerQgn_prop_phone_small_mask     }, 
        {EMbmRealplayerFile_network,      EMbmRealplayerFile_network_mask   }, 
        {EMbmRealplayerQgn_prop_mmc_small,          EMbmRealplayerQgn_prop_mmc_small_mask       }, 
        {EMbmRealplayerFile_mmc_broken,   EMbmRealplayerFile_mmc_broken_mask}  
    };
   

    // create icon array for list items
    CAknIconArray* pIcons = CHXAvMisc::AllocIconsL(images, ARRAY_COUNT(images));
    AUTO_PUSH_POP(pIcons);

    // transfer icon array ownership to list box
    m_pListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL(pIcons);

    // not sure what this does
    m_pListBox->ItemDrawer()->SetItemMarkPosition(0);
    m_pListBox->ItemDrawer()->SetItemMarkReplacement(_L("0"));

    // set the title to "select clip:"
    SetTitleL(CHXAvCleanString(R_PROMPT_SELECT_CLIP)());

    // create list
    CHXAvNameDisplayTrait trait(true /*hide extensions*/);
    CDesCArrayFlat* pItems = CHXAvMisc::AllocGrPopupListItemsL(recentClips, &trait);
    AUTO_PUSH_POP(pItems);
    HX_ASSERT(pItems->Count() > 0);

    // transfer list ownership to listbox
    CTextListBoxModel* pModel = m_pListBox->Model();
    pModel->SetItemTextArray(pItems);
    pModel->SetOwnershipType(ELbmOwnsItemArray);

    // make sure nothing is selected; first item is current
    m_pListBox->ClearSelection();
    m_pListBox->SetCurrentItemIndex(0);

}

//////////////////////////////
//
void
CHXAvRecentClipsPopupList::AttemptExitL(TBool aAccept)
{
    m_idxSelected = m_pListBox->CurrentItemIndex();
    CAknPopupList::AttemptExitL(aAccept);
}




⌨️ 快捷键说明

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