📄 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();//获取当前选中项索引
void SetSelected(TInt aIndex);//设置指定索引为选中项
void AppendAnItem(const TDesC& aBody);//添加条目到列表项结尾处
void AppendAnItem(CNDListItem *anItem);
void DeleteAnItem(TInt aIndex);
void DeleteSelectItem();
private:
RPointerArray<CNDListItem> iDataArray; //保存数据的数组
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;} //释放内存
#endif // __UserListboxCONTAINER_H__
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -