//---------------------------------------------------------------------------

#ifndef PreStylePanelH
#define PreStylePanelH

#include "StylePanel.h"
//---------------------------------------------------------------------------
class TPreStylePanel : public TStylePanel
{
private:
	int m_nIECount[2][2];

	TCommonItem* GetSegmentHoverItem( TCommonItem* pItem, int& iHoverLine );
	TSegmentItem* InsertSegment( int index, TSegmentItem* pSrcSeg );
	void MoveSegment( int indFrom, int indTo );
	void SwapSegments( TSegmentItem* pItem1, TSegmentItem* pItem2 );
	bool QuerySegmentDelete( UINT idLoc, UINT idStyle, int sType, int sNo );
	bool QueryStyleSave();
//	void InstrumentChanged( TCommonItem *pItem );

protected:
	virtual void Init();
	virtual bool StartDrag();
	virtual void HandleDropEvent( int iState=0 );
	virtual bool HandleHoverEvent(TPoint ptMouse);
	virtual void DeleteItem( TCommonItem *pItem, int iLine );
	virtual void RestoreItems();
	virtual bool CanVSplit(){ return true; };

	virtual void __fastcall DoImportSegment(TObject* Sender);
	virtual void __fastcall DoChangeFontProg(TObject* Sender);
	virtual void __fastcall DoChangeTexture(TObject* Sender);

public:
	__fastcall TPreStylePanel(System::Classes::TComponent* AOwner);

	virtual void __fastcall SetStyleItem( TStyleItem* pStyItem );
	virtual bool __fastcall GetPrebeat( BYTE* pData, int& nSize );
	void __fastcall NewStyle( TObject *Sender );
	bool __fastcall CheckModified();

	void SetPreStyle( UINT idLoc, UINT idStyle );
	void AddTempSegment( TSegmentItem* pSeg );
	TStyleItem* GetStyleItem() { return (TStyleItem*)m_aItems->First(); };
	int GetIECount( int sType, int cType ) { return m_nIECount[sType][cType]; };
};

#endif
