Files
AccompanyCube/StyleSelListBoxUnit.h
2026-06-13 00:10:11 +08:00

73 lines
1.9 KiB
C++

//---------------------------------------------------------------------------
#ifndef StyleSelListBoxUnitH
#define StyleSelListBoxUnitH
#include "SkinListBoxUnit.h"
#include "GlobalUnit.h"
#include<vector>
using namespace std;
//---------------------------------------------------------------------------
namespace StyleSelectListBoxUnit
{
//---------------------------------------------------------------------------
class TListBox : public TSkinListBox
{
private:
TBitmap *m_imgBackground;
TBitmap *m_imgBackgroundLine;
TBitmap *m_imgSelectedFlag;
TBitmap *m_imgSelectedBkg;
TBitmap * m_pBitmapHot ;
TBitmap * m_pBitmapNml;
TBitmap * m_imgDwnLoadHot;
TBitmap * m_imgDwnLoadNml;
TBrush * m_brImg;
TFont * m_pFntText;
COLORREF m_clrSelected,
m_clrBevelRaise,
m_clrBevelLower;
int m_iPlayItemIndex;
protected:
virtual void __fastcall DrawItem(int Index, const System::Types::TRect &Rect, Winapi::Windows::TOwnerDrawState State);
MESSAGE void __fastcall WMPaint(Winapi::Messages::TWMPaint &Message);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_PAINT, TWMPaint, WMPaint)
END_MESSAGE_MAP(TSkinListBox)
public:
__fastcall virtual TListBox(System::Classes::TComponent* AOwner);
__fastcall ~TListBox();
virtual void __fastcall Clear(void);
void SetPlayItemIndex(int iPlayItemIndex = -1);
void SetItemIndex(const vector<int> vcItemIndex,const int iCutPage);
void SetItemIconState(const int iItemIndex,const int iIconState);
void ResetItemsData(vector<DEFTSTYLEINFO> vcItemsData,const int iCutPage,vector<int> vcItemsIndex,bool bIsReDraw);
void ReDrawItemsState(vector<int> vcItemIndexs,bool bIsReDraw);
void DrawDownLoadImgState(const TRect rtArea,const int iImgIndex,TBitmap * tBitmap);
private:
vector<int> m_vciItemIndex;
int m_iCurPage;
int m_iItemIndex;
int m_iItemState;
int m_iHotItemIndex;
int m_iDLoadItemIndex;
vector<DEFTSTYLEINFO> m_vcItemsData;
// vector<DEFTSTYLEINFO> m_vcOldItemsData;
};
}
using namespace StyleSelectListBoxUnit;
#endif