//--------------------------------------------------------------------------- #ifndef ShowBarsPanelUnitH #define ShowBarsPanelUnitH #include "SkinScrollBarUnit.h" #include #define BAR_HEADER 0x01 #define BAR_TITLE 0x02 #define BAR_DATA 0x04 #define COLOR_BORDER RGB(164,115,70) //--------------------------------------------------------------------------- class TShowBarsPanel : public Extctrls::TPanel { private: //背景及小节栏图片 TBitmap *m_imgBackground, *m_imgBarTitle; // int m_sFont7, // m_sFont8, // m_sFont9, // m_sFont14, // m_sFont16; void CalcViewArea(); void DrawBars(); MESSAGE void __fastcall WMEraseBkgnd(Winapi::Messages::TWMEraseBkgnd &Message); MESSAGE void __fastcall WMSize(Winapi::Messages::TWMSize &Message); MESSAGE void __fastcall WMVScroll(Winapi::Messages::TWMScroll &Message); MESSAGE void __fastcall WMMouseWheel(TWMMouseWheel &Message); BEGIN_MESSAGE_MAP MESSAGE_HANDLER(WM_ERASEBKGND, TWMEraseBkgnd, WMEraseBkgnd) MESSAGE_HANDLER(WM_SIZE, TWMSize, WMSize) MESSAGE_HANDLER(WM_VSCROLL, TWMVScroll, WMVScroll) MESSAGE_HANDLER(WM_MOUSEWHEEL, TWMMouseWheel, WMMouseWheel) END_MESSAGE_MAP(Vcl::Extctrls::TPanel) protected: //显示相关 int m_nRowShow, m_nBeginShowRow, m_nColumnNum, m_nRowNum, m_nBarNum, m_nBarWidth, m_nBarHeight, m_nDataWidth, m_nDataHeight, m_nRowGapHeight, m_nTitleHeight, m_nBarDrawHeight, m_nLeftBound, m_nLeftOriBound, m_nRightBound, m_nTopBound; TSkinScrollBar *m_sbVert; //录音/播放相关 bool m_bPlaying; int m_iPlayBar, m_iPlayPoint; virtual void __fastcall CreateWnd(); virtual void __fastcall Paint(void); virtual void __fastcall BarPosChanged(){}; virtual void __fastcall SetBarTitle( int iBar, String& strText ){}; virtual void __fastcall DrawBarBkgnd( int iBar, int left, int top ){}; virtual void __fastcall DrawBarContext( int iBar, int left, int top ){}; virtual void __fastcall DrawBarOperation( int iBar, int left, int top ){}; virtual void __fastcall DrawChord( TRect& rcDraw, int iChord ); void GetChordKey( int iChord, int& iMainKey, int& iAjustKey, int& iType ); public: inline void Play( bool bPlay ) { m_bPlaying=bPlay; }; inline bool IsPlaying() { return m_bPlaying; }; void InitialVars(int nBarNum); void SetPlayPoint( int iBar, int iPoint ); void InvalidateBar( int iBar, int iBeginPoint, int iEndPoint, int iArea=BAR_DATA ); void ScrollView( int nPos, bool bRedraw=true ); DWORD HitTest( int X, int Y, int& iHitType, bool bAbsorb=true, bool bIgnoreBound=false ); __fastcall virtual TShowBarsPanel(System::Classes::TComponent* AOwner); __fastcall ~TShowBarsPanel(); }; #endif