?? userlistboxcontainer.h
字號:
#ifndef __REDCONTAINER_H__
#define __REDCONTAINER_H__
// INCLUDES
#include <aknview.h>
#include <e32base.h>
class CNDListItem;
class CUserListboxContainer : public CCoeControl
{
public: // Constructors and destructor
CUserListboxContainer();
virtual ~CUserListboxContainer();
void ConstructL(const TRect& aRect);
TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType);
private: // Functions from base classes
void SizeChanged();
TInt CountComponentControls() const;
CCoeControl* ComponentControl( TInt aIndex ) const;
void Draw( const TRect& aRect ) const;
void GetAppPath(TDes& aPath);
void Reset();
//////////////////////////////////////////////////////////自定義
public:
TInt Selected();//獲取當(dāng)前選中項索引
void SetSelected(TInt aIndex);//設(shè)置指定索引為選中項
void AppendAnItem(const TDesC& aBody);//添加條目到列表項結(jié)尾處
void AppendAnItem(CNDListItem *anItem);
void DeleteAnItem(TInt aIndex);
void DeleteSelectItem();
private:
RPointerArray<CNDListItem> iDataArray; //保存數(shù)據(jù)的數(shù)組
TInt iSeleIndex; //選擇索引
TInt iDrawIndex;
TInt iIndex;
TInt iScrollIndex;
//////////////////////////////////////////////////////////
};
class CNDListItem:public CBase //MDU
{
private:
HBufC *ipBody;
TBool iSelect;
public:
~CNDListItem();
static CNDListItem *NewL();
static CNDListItem *NewLC();
void SetBody(const TDesC &aBody);
HBufC *GetBody() const;
void SetSelect(const TBool aSelect);
TBool GetSelect() const;
private:
CNDListItem();
void ConstructL();
};
#define MOMERAY_FREE(a) if(a){delete a; a = NULL;} //釋放內(nèi)存
#endif // __UserListboxCONTAINER_H__
// End of File
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -