#if !defined(AFX_EFFECTLISTTREECTRL_H__1C0F1312_C9C6_4AE8_830F_200EF03906BD__INCLUDED_)
#define AFX_EFFECTLISTTREECTRL_H__1C0F1312_C9C6_4AE8_830F_200EF03906BD__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EffectListTreeCtrl.h : header file
//
#include <GosFx\GosFx.hpp>
#include <GosFx\EffectLibrary.hpp>

/////////////////////////////////////////////////////////////////////////////
// CEffectListTreeCtrl window

class CEffectListTreeCtrl : public CTreeCtrl
{
// Construction
public:
	CEffectListTreeCtrl();
	HTREEITEM selitm;
	CString MakeUnique(CString &str);
	bool InList(CString &str,HTREEITEM itm=TVI_ROOT);
	void UpdatePlayIcons();
	void UpdatePlayIcons(HTREEITEM itm);
	void ClearPlayIcons(HTREEITEM itm=TVI_ROOT);
	CImageList IList;
	CPoint cmousepos;
	// Attributes
public:

// Operations
public:

	enum {
		  IDX_SHAPE=0,
		  IDX_NULL,
		  IDX_POINTCLOUD,
		  IDX_SHAPECLOUD,
		  IDX_PERTCLOUD,
		  IDX_DEBRISCLOUD,
		  IDX_EFFECTCLOUD,
		  IDX_LASER,
		  IDX_TUBE,
		  IDX_LIGHT,
		  IDX_FLARE,
		  IDX_CARD,
		  IDX_CARDCLOUD,
		  IDX_SHARDCLOUD,
		  IDX_SPRITECLOUD,
		  IDX_SHAPESEL,
		  IDX_NULLSEL,
		  IDX_POINTCLOUDSEL,
		  IDX_SHAPECLOUDSEL,
		  IDX_PERTCLOUDSEL,
		  IDX_DEBRISCLOUDSEL,
		  IDX_LASERSEL,
		  IDX_TUBESEL,
		  IDX_LIGHTSEL,
		  IDX_FLARESEL,
		  IDX_CARDSEL,
		  IDX_CARDCLOUDSEL,
		  IDX_SHARDCLOUDSEL,
		  IDX_SPRITECLOUDSEL,
		  IDX_EFFECTCLOUDSEL,
		  IDX_TOTALICONS
			};

	int IconIdx[IDX_TOTALICONS];	
	// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CEffectListTreeCtrl)
	//}}AFX_VIRTUAL

// Implementation
public:
	void CopySelectedIntoLib(gosFX::EffectLibrary *fxLib);
	void CopySelectedIntoLib(gosFX::EffectLibrary *fxLib,HTREEITEM itm);

	void SortEvents(gosFX::Effect::Specification *spec);
	int ListChildren(gosFX::Effect::Specification *spec,gosFX::Effect::Specification **speclist);
	void DeleteEffect(gosFX::Effect::Specification *spec);
	int DuplicateEffect(int efnum);
	virtual ~CEffectListTreeCtrl();
	int EffectsInBranch(gosFX::Effect::Specification *spec,int par=0);
	void DeleteSelectedEffect();
	gosFX::Effect::Specification *GetParentEffect(gosFX::Effect::Specification *spec);
	void DetachReferences(gosFX::Effect::Specification *spec,gosFX::Effect::Specification *parspec);


	void ScaleSelectedEffect(float sfact,bool recurse=false,bool bright=false);
	void ScaleAllEffects(float sfact,bool bright=false);
	void ScaleEffectTree(HTREEITEM itm,float sfact,bool bright);
	void ScaleEffect(gosFX::Effect::Specification *spec,float sfact,bool bright);

	int IdxBlank,IdxPlay;

	void MakeAllNamesUnique();
void InitImages();

int NewSpriteCloud();
int NewBeam();
int NewNullEffect();
int NewDebrisCloud(); 
int NewCardCloud(); 
int NewPertcloud(); 
int NewPointCloud(); 
int NewShapeCloud(); 
int NewShardCloud(); 
int NewSingletonCard(); 
int NewSingletonShape(); 
int NewSingletonFlare(); 
int NewEffectCloud(); 
int NewTube(); 
int NewPointLight(); 

int GetIconIdx(Stuff::RegisteredClass::ClassID id,bool selected=false);

	// Generated message map functions
protected:
	//{{AFX_MSG(CEffectListTreeCtrl)
	afx_msg void OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_EFFECTLISTTREECTRL_H__1C0F1312_C9C6_4AE8_830F_200EF03906BD__INCLUDED_)
