/*
* FX Tool Panel
* @version 3-07-05
* @author Joseph 'Pcjoe' Florencio
*/

//added by harSens
#pragma warning (disable:4786)
#pragma warning (disable:4530)

#ifndef FXTOOLPANEL_H
#define FXTOOLPANEL_H
#include<VGUI_Panel.h>
#include<VGUI_TablePanel.h>
#include<VGUI_HeaderPanel.h>
#include<VGUI_TextGrid.h>
#include<VGUI_Label.h>
#include "fxscript/fxsys.h"
#include "vgui_botmenu.h"

/*
* FX Panel
*/
class CFXPanel : public CTransparentPanel
{
public:
	// Constructor
	CFXPanel(std::string strTitle, int x,int y,int wide,int tall);

	// Align functions
	void alignLeft( int iLeftX );
	void alignRight( int iRightX );
	void alignBottom( int iBottomY );
	void alignTop( int iTopY );

	// Resize to content
	void resizeToContentWide( void );
	void resizeToContentTall( void );
	void resizeToContent( void );

	// Drag
	virtual void dragClick( void );
	virtual void dragRelease( void );

	// Drag Think
	virtual void dragThink( void );

	// Update
	virtual void Update( void ) { }

	// Update Event Data
	virtual void updateEventData( void ) { }

	// Reset
	virtual void Reset( void ) { }

	// Can Drag
	virtual bool canDrag( void ) { return true; }

	/*
	* Accessors
	*/
	// Title
	void setTitle( Label *pLabel ) { m_pTitle = pLabel; }
	Label *getTitle( void ) { return m_pTitle; }

	// Content Panel
	void setContentPanel( CTransparentPanel *pPanel ) { m_pContentPanel = pPanel; }
	CTransparentPanel *getContentPanel( void ) { return m_pContentPanel; }

	// Hide Button
	void setHideButton( CommandButton *pButton ) { m_pHideButton = pButton; }
	CommandButton *getHideButton( void ) { return m_pHideButton; }

	// Hide Status
	void setHideStatus( bool status ) { m_bHideStatus = status; }
	bool getHideStatus( void ) { return m_bHideStatus; }

	// Dragging Status
	void setDraggingStatus( bool drag ) { m_bDragging = drag; }
	bool getDraggingStatus( void ) { return m_bDragging; }

	// Start Dragging Vector
	void setDragStartPos( Vector2D vec ) { m_vecStartDrag = vec; }
	Vector2D getDragStartPos( void ) { return m_vecStartDrag; }

protected:
	CTransparentPanel	*m_pContentPanel;
	CommandButton		*m_pHideButton;
	Label				*m_pTitle;
	bool				m_bHideStatus;
	bool				m_bDragging;
	Vector2D			m_vecStartDrag;
};

// HACK HACK: Use this hacked class to re-enable setSize support
class CFXScrollPanel : public CTFScrollPanel
{
public:
	CFXScrollPanel(int x,int y,int wide,int tall);
	virtual void setSize(int wide,int tall) { ScrollPanel::setSize(wide,tall); }
};

/*
* Listbox - HACK HACK: Not enough time to learn regular listboxes, make one using an alteration of the scroll panel
*/
// Items List
struct fxlistboxitem_s
{	Label	*m_pLabel;
	int		m_iIndex;
};
class CFXListBox : public CFXScrollPanel
{
public:

	// Constructor
	CFXListBox(int x,int y,int wide,int tall);

	// Add item
	void addItem( int idx, std::string strText );

	// Realign items inside listbox
	void realignItems( void );

	// Remove item
	void removeItem( int idx );

	// Remove all items
	void removeAll( void );

	// Get mouse enter status
	bool getMouseEntered( void );

	// Get mouse over label select
	fxlistboxitem_s *getMouseOverLabelSelect( void );

	// Mouse Click (called by inputsignal)
	void mouseClick( void );

	// Get label by index
	Label *getLabelByIndex( int idx );

	// Update
	virtual void Update( void );

	// Reset
	virtual void Reset( void );

	// Select item
	void selectItem( int idx );

	// Mouse Over item
	void mouseOverItem( int idx );

	// Is Moused Over
	bool isSelected( int idx );

	// Is Moused Over
	bool isMousedOver( int idx );

	// Add Highlight
	void addHighlight( Label *pLabel, Color color );
	
	// Remove Highlight
	void removeHighlight( Label *pLabel );

	// Get Select Color
	virtual Color getSelectColor( void ) { return Color(0,255,0,100); }

	// Get Mouse Over Color
	virtual Color getMouseOverColor( void ) { return Color(255,0,0,100); }

public:
	/*
	* Accessors
	*/
	std::list<fxlistboxitem_s> *getItemList( void ) { return &m_Items; }

	// Row height
	void setRowHeight( int iHeight ) { m_iRowHeight = iHeight; }
	int getRowHeight( void ) { return m_iRowHeight; }

	// Selected Label
	void setSelectedLabel( int iLabel ) { m_iSelectedLabel = iLabel; }
	int getSelectedLabel( void ) { return m_iSelectedLabel; }

	// Mouse over Label
	void setMouseOverLabel( int iLabel ) { m_iMouseOverLabel = iLabel; }
	int getMouseOverLabel( void ) { return m_iMouseOverLabel; }
private:
	friend fxlistboxitem_s;
	std::list<fxlistboxitem_s>	m_Items;
	int		m_iRowHeight;
	int		m_iSelectedLabel;
	int		m_iMouseOverLabel;
};


/*
* FX Timeline
*/
class CTimelineMeter;
class CTimelineStrip;
class CTimelineStripContent;


// Timeline Strip Storage
class CTimelineStrip
{
public:
	// Constructor
	CTimelineStrip(CTimeline *pTimeline, Label *pLabel, CTimelineStripContent *pContent);

	// Add Timed Event
	void addTimedEvent( std::map<float,CTimedEvent*>::iterator iterItem );

	// Remove
	void Remove( void );

	// Update Content (correspond with timeline data)
	void updateContent( void );

	/*
	* Accessors
	*/
	// Label
	void setLabel( Label *pLabel ) { m_pLabel = pLabel; }
	Label *getLabel( void ) { return m_pLabel; }

	// Strip Content
	void setStripContent( CTimelineStripContent *pContent ) { m_pStripContent = pContent; }
	CTimelineStripContent *getStripContent( void ) { return m_pStripContent; }

	// Object Timeline
	void setObjectTimeline( CTimeline *pTimeline ) { m_pObjTimeline = pTimeline; }
	CTimeline *getObjectTimeline( void ) { return m_pObjTimeline; }	
private:
	Label					*m_pLabel;
	CTimelineStripContent	*m_pStripContent;
	CTimeline				*m_pObjTimeline;
};

class CFXTimeline_VGUI : public CFXPanel
{
public:
	// Constructor
	CFXTimeline_VGUI(std::string strTitle, int x,int y,int wide,int tall);

	// Refit timeline ( used to resize timeline after timestrips are added )
	void refitTimeline( void );

	// Update
	virtual void Update( void );

	// Update Event Data
	virtual void updateEventData( void );

	// Reset
	virtual void Reset( void );

	// Reset Strip List
	void resetStripList( void );

	// Realign Strips
	void realignStrips( void );

	// Play
	void Play( void );

	// Pause
	void Pause( void );

	/*
	* Accessors
	*/
	// In camera button
	void setInCameraButton( CommandButton *pButton ) { m_pInCam = pButton; }
	CommandButton *getInCameraButton( void ) { return m_pInCam; }

	// Save button
	void setSaveButton( CommandButton *pButton ) { m_pSave = pButton; }
	CommandButton *getSaveButton( void ) { return m_pSave; }

	// Load button
	void setLoadButton( CommandButton *pButton ) { m_pLoad = pButton; }
	CommandButton *getLoadButton( void ) { return m_pLoad; }

	// Pause button
	void setPauseButton( CommandButton *pButton ) { m_pPause = pButton; }
	CommandButton *getPauseButton( void ) { return m_pPause; }

	// Play button
	void setPlayButton( CommandButton *pButton ) { m_pPlay = pButton; }
	CommandButton *getPlayButton( void ) { return m_pPlay; }

	// Timeline data
	void setTimedEventDataPanel( ScrollPanel *pPanel ) { m_pTimedEventDataPanel = pPanel; }
	ScrollPanel *getTimedEventDataPanel( void ) { return m_pTimedEventDataPanel; }

	// Timeline meter
	void setTimelineMeter( CTimelineMeter *pMeter ) { m_pTimelineMeter = pMeter; }
	CTimelineMeter *getTimelineMeter( void ) { return m_pTimelineMeter; }

	// Current object
	void setCurrentObject( int iObject ) { m_iCurrentObject = iObject; }
	int getCurrentObject( void ) { return m_iCurrentObject; }

	// In Camera
	void setInCamera( bool status ) { m_bInCam = status; }
	bool getInCamera( void ) { return m_bInCam; }

	// Timeline strip list
	std::list<CTimelineStrip> *getTimelineStripList( void ) { return &m_TimelineStripList; }
private:
	CommandButton	*m_pInCam;
	CommandButton	*m_pSave;
	CommandButton	*m_pLoad;
	CommandButton	*m_pPause;
	CommandButton	*m_pPlay;
	ScrollPanel		*m_pTimedEventDataPanel;
	CTimelineMeter	*m_pTimelineMeter;
	int				m_iCurrentObject;
	bool			m_bInCam;
	std::list<CTimelineStrip> m_TimelineStripList;
};

// Timeline meter
typedef enum
{	TIMELINE_PAUSE=0,
	TIMELINE_PLAY
}TIMELINE_PLAY_STATUS;
class CTimelineMeter : public Panel
{
public:
	// Constructor
	CTimelineMeter(int x,int y,int wide,int tall);

	// Paint functions (paint draws timeline ticks, paintBackground draws red progress bar
	virtual void paint( void );
	virtual void paintBackground( void );

	// Calculate Max Width
	int calcMaxWidth( void );

	// Update
	virtual void Update( void );

	// Reset
	virtual void Reset( void );

	// Get time in respect to local X Coord
	float getTime( int iX );

	// Get coord in respect to time
	int getXCoord( float flTime );

	// Mouse functions
private:
	virtual void internalMousePressed(MouseCode code);
	virtual void internalMouseReleased(MouseCode code);
	virtual void internalCursorExited();

public:
	/*
	* Accessors
	*/
	// Total Time
	void setTotalTime( float flTime ) { m_flTotalTime = flTime; }
	float getTotalTime( void ) { return m_flTotalTime; }

	// Current Time
	void setCurrentTime( float flTime ) { m_flCurrentTime = flTime; }
	float getCurrentTime( void ) { return m_flCurrentTime; }

	// Scale (magnification)
	void setScale( float flScale ) { m_flScale = flScale; }
	float getScale( void ) { return m_flScale; }

	// Pixels per Second
	void setPixelsPerSecond( int iPixels ) { m_iPixelPerSecond = iPixels; }
	int getPixelsPerSecond( void ) { return m_iPixelPerSecond; }

	// Start/End offset
	void setSidesOffset( int iOffset ) { m_iSidesOffset = iOffset; }
	int getSidesOffset( void ) { return m_iSidesOffset; }

	// Dragging timeline ( setting time )
	void setDragging( bool bDragging ) { m_bDragging = bDragging; }
	bool getDragging( void ) { return m_bDragging; }

	// Play status
	void setPlayStatus( TIMELINE_PLAY_STATUS status ) { m_ePlayStatus = status; }
	TIMELINE_PLAY_STATUS getPlayStatus( void ) { return m_ePlayStatus; }

	// Last Time
	void setLastTime( float flTime ) { m_flLastTime = flTime; }
	float getLastTime( void ) { return m_flLastTime; }

private:
	float	m_flTotalTime;
	float	m_flCurrentTime;
	float	m_flScale;
	int		m_iPixelPerSecond;
	int		m_iSidesOffset;
	bool	m_bDragging;
	float	m_flLastTime;
	TIMELINE_PLAY_STATUS m_ePlayStatus;
};

// Timeline Strip Item
class CTimelineStripItem : public Label
{
public:
	// Constructor
	CTimelineStripItem(int x,int y,int wide,int tall);

	// Point Over Item
	bool pointOverItem( int x, int y );

	// Accesors
	void setTimedEvent( std::map<float,CTimedEvent*>::iterator iterTimedEvent ) { m_iterTimedEvent = iterTimedEvent; }
	std::map<float,CTimedEvent*>::iterator getTimedEvent( void ) { return m_iterTimedEvent; }
private:
	// Iterator this item is associated with
	std::map<float,CTimedEvent*>::iterator m_iterTimedEvent;
};

// Timeline Strip Content
class CTimelineStripContent : public Panel
{
public:
	// Constructor
	CTimelineStripContent(int x,int y,int wide,int tall);

	// Update
	void Update( void );

	// Align with Timelinemeter
	void realign( void );

	// Get Moused Over Item
	std::list<CTimelineStripItem>::iterator getMousedOverItem( void );

	// Add Item
	Label *addItem( std::map<float,CTimedEvent*>::iterator iterItem );

	// Remove Item
	void removeItem( std::map<float,CTimedEvent*>::iterator iterItem );

	// Finish dragging
	void finishDragging( void );

	// Accessors
	std::list<CTimelineStripItem> *getItemList( void ) { return &m_ItemList; }

	// FX Object
	void setFXObject( CFXObject *pObj ) { m_pObject = pObj; }
	CFXObject *getFXObject( void ) { return m_pObject; }

	// Dragging item ( moving along time )
	void setDragging( bool bDragging ) { m_bDragging = bDragging; }
	bool getDragging( void ) { return m_bDragging; }

	// Dragging item (actual item)
	void setDraggingItem( std::list<CTimelineStripItem>::iterator iterDrag ) { m_iterDragging = iterDrag; }
	std::list<CTimelineStripItem>::iterator getDraggingItem( void ) { return m_iterDragging; }

//private:
	// Mouse functions
	virtual void internalMousePressed(MouseCode code);
	virtual void internalMouseReleased(MouseCode code);

	// Object Timeline
	void setObjectTimeline( CTimeline *pTimeline ) { m_pObjTimeline = pTimeline; }
	CTimeline *getObjectTimeline( void ) { return m_pObjTimeline; }	
private:
	std::list<CTimelineStripItem>	m_ItemList;
	CFXObject	*m_pObject;
	bool		m_bDragging;
	std::list<CTimelineStripItem>::iterator m_iterDragging;
	CTimeline				*m_pObjTimeline;
};

/*
* FX Object Manager
*/
// Object Manager
class CCreateFXObject_VGUI;
class CEditFXObject_VGUI;
class CFXObjectManager_VGUI : public CFXPanel
{
public:
	// Constructor
	CFXObjectManager_VGUI(std::string strTitle, int x,int y,int wide,int tall);

	// Update
	virtual void Update( void );

	// Update Event Data
	virtual void updateEventData( void );

	// Reset
	virtual void Reset( void );

	/*
	* Accessors
	*/
	// Object List
	void setObjectList( CFXListBox *pListBox ) { m_pObjectList = pListBox; }
	CFXListBox *getObjectList( void ) { return m_pObjectList; }

	// Create button
	void setCreateButton( CommandButton *pCreate ) { m_pCreate = pCreate; }
	CommandButton *getCreateButton( void ) { return m_pCreate; }

	// Edit button
	void setEditButton( CommandButton *pEdit ) { m_pEdit = pEdit; }
	CommandButton *getEditButton( void ) { return m_pEdit; }

	// Delete Button
	void setDeleteButton( CommandButton *pDelete ) { m_pDelete = pDelete; }
	CommandButton *getDeleteButton( void ) { return m_pDelete; }

	// Create FX Panel
	void setCreateFXPanel( CCreateFXObject_VGUI *pPanel ) { m_pCreateFXPanel = pPanel; }
	CCreateFXObject_VGUI *getCreateFXPanel( void ) { return m_pCreateFXPanel; }

	// Edit FX Panel
	void setEditFXPanel( CEditFXObject_VGUI *pPanel ) { m_pEditFXPanel = pPanel; }
	CEditFXObject_VGUI *getEditFXPanel( void ) { return m_pEditFXPanel; }
private:
	CFXListBox		*m_pObjectList;
	CommandButton	*m_pCreate;
	CommandButton	*m_pEdit;
	CommandButton	*m_pDelete;
	CCreateFXObject_VGUI *m_pCreateFXPanel;
	CEditFXObject_VGUI	*m_pEditFXPanel;
};

// Edit FX Object Menu ( just time for now )
class CEditFXObject_VGUI : public CFXPanel
{
public:
	// Constructor
	CEditFXObject_VGUI(std::string strTitle, int x,int y,int wide,int tall);

	/*
	* Accessors
	*/

	// Time Start
	void setTimeStartText( CBotTextEntry *pTime ) { m_pTimeStart = pTime; }
	CBotTextEntry *getTimeStartText( void ) { return m_pTimeStart; }
	
	// Time End
	void setTimeEndText( CBotTextEntry *pTime ) { m_pTimeEnd = pTime; }
	CBotTextEntry *getTimeEndText( void ) { return m_pTimeEnd; }

	// Accept Button
	void setAcceptButton( CommandButton *pAccept ) { m_pAccept = pAccept; }
	CommandButton *getAcceptButton( void ) { return m_pAccept; }
	
private:
	CBotTextEntry	*m_pTimeStart;
	CBotTextEntry	*m_pTimeEnd;
	CommandButton	*m_pAccept;
};

// Create Object type
typedef enum
{	OBJECT_CREATE_MDL=1,
	OBJECT_CREATE_LOCAL,
	OBJECT_CREATE_WRL,
	OBJECT_CREATE_CAMERA,
	OBJECT_CREATE_SOUND
};
// Create FX Object Menu
class CCreateFXObject_VGUI : public CFXPanel
{
public:
	// Constructor
	CCreateFXObject_VGUI(std::string strTitle, int x,int y,int wide,int tall);

	// Update
	virtual void Update( void );

	/*
	* Accessors
	*/
	// Object Type List
	void setObjectTypeList( CFXListBox *pList ) { m_pObjectTypeList = pList; }
	CFXListBox	*getObjectTypeList( void ) { return m_pObjectTypeList; }

	// Name
	void setNameText( CBotTextEntry *pText ) { m_pName = pText; }
	CBotTextEntry *getNameText( void ) { return m_pName; }

	// Model Name
	void setModelText( CBotTextEntry *pText ) { m_pModelName = pText; }
	CBotTextEntry *getModelText( void ) { return m_pModelName; }

	// Sprite Name
	void setSpriteText( CBotTextEntry *pText ) { m_pSpriteName = pText; }
	CBotTextEntry *getSpriteText( void ) { return m_pSpriteName; }

	// Time Start
	void setTimeStartText( CBotTextEntry *pTime ) { m_pTimeStart = pTime; }
	CBotTextEntry *getTimeStartText( void ) { return m_pTimeStart; }
	
	// Time End
	void setTimeEndText( CBotTextEntry *pTime ) { m_pTimeEnd = pTime; }
	CBotTextEntry *getTimeEndText( void ) { return m_pTimeEnd; }

	// Create Button
	void setCreateButton( CommandButton *pCreate ) { m_pCreate = pCreate; }
	CommandButton *getCreateButton( void ) { return m_pCreate; }

	// Current selection
	void setCurrentSelection( int iSel ) { m_iCurrentSelection = iSel; }
	int getCurrentSelection( void ) { return m_iCurrentSelection; }
private:
	CFXListBox		*m_pObjectTypeList;
	CBotTextEntry	*m_pName;
	CBotTextEntry	*m_pModelName;
	CBotTextEntry	*m_pSpriteName;
	CBotTextEntry	*m_pTimeStart;
	CBotTextEntry	*m_pTimeEnd;
	CommandButton	*m_pCreate;
	int				m_iCurrentSelection;
};


/*
* FX Path Manager
*/
typedef enum
{	MAKEPOINT_NONE,
	MAKEPOINT_BEZIER,
	MAKEPOINT_LINEAR
}MAKEPOINT_STATUS;

class CFXPathManager_VGUI : public CFXPanel
{
public:
	// Constructor
	CFXPathManager_VGUI(std::string strTitle, int x,int y,int wide,int tall);

	// Update
	virtual void Update( void );

	// Update Event Data
	virtual void updateEventData( void );

	// Reset
	virtual void Reset( void );

	// Get selectable path point at cursor position
	CFXDataPoint *getSelectPathPoint( void );

	// Mouse Click
	void mouseClick( void );

	// Mouse Release
	void mouseRelease( void );

	/*
	* Accessors
	*/
	// Path List
	void setPathList( CFXListBox *pListBox ) { m_pPathList = pListBox; }
	CFXListBox *getPathList( void ) { return m_pPathList; }

	// Create button
	void setCreateButton( CommandButton *pCreate ) { m_pCreate = pCreate; }
	CommandButton *getCreateButton( void ) { return m_pCreate; }

	// Edit button
	void setEditButton( CommandButton *pEdit ) { m_pEdit = pEdit; }
	CommandButton *getEditButton( void ) { return m_pEdit; }

	// Delete Button
	void setDeleteButton( CommandButton *pDelete ) { m_pDelete = pDelete; }
	CommandButton *getDeleteButton( void ) { return m_pDelete; }

	// Linear Point Button
	void setLinearButton( CommandButton *pLinear ) { m_pLinearPoint = pLinear; }
	CommandButton *getLinearButton( void ) { return m_pLinearPoint; }

	// Bezier Point Button
	void setBezierButton( CommandButton *pBezier ) { m_pBezierPoint = pBezier; }
	CommandButton *getBezierButton( void ) { return m_pBezierPoint; }
	
	// Drag Point
	void setDragPoint( bool bDrag ) { m_bDragPoint = bDrag; }
	bool getDragPoint( void ) { return m_bDragPoint; }

	// Dragging Distance
	void setDragDist( float flDist ) { m_flDragDist = flDist; }
	float getDragDist( void ) { return m_flDragDist; }

	// Make Point Status
	MAKEPOINT_STATUS getMakePointStatus( void ) { return m_eMakePointStatus; }
	void setMakePointStatus( MAKEPOINT_STATUS eStatus ) { m_eMakePointStatus = eStatus; }

	// Cached vector points ( point creation )
	std::vector<vec3_t> *getVectorPoints( void ) { return &m_vecPoints; }

	// Point make stage
	void setPointMakeStage( int iStage ) { m_iPointMakeStage = iStage; }
	int getPointMakeStage( void ) { return m_iPointMakeStage; }

	// Temp vector dir ( for creating points )
	void setTempVecDir( vec3_t vecDir ) { m_vecDirTemp = vecDir; }
	vec3_t getTempVecDir( void ) { return m_vecDirTemp; }
private:
	CFXListBox		*m_pPathList;
	CommandButton	*m_pCreate;
	CommandButton	*m_pEdit;
	CommandButton	*m_pDelete;
	CommandButton	*m_pLinearPoint;
	CommandButton	*m_pBezierPoint;
	bool			m_bDragPoint;
	float			m_flDragDist;
	int				m_iPointMakeStage;
	MAKEPOINT_STATUS m_eMakePointStatus;
	std::vector<vec3_t> m_vecPoints;
	vec3_t			m_vecDirTemp;
};

/*
* FX Tool Bar
*/
typedef enum
{	TOOLBAR_SELECT=1,
	TOOLBAR_MOVE,
	TOOLBAR_ROTATE
}TOOLBAR_MODE;

class CFXToolBar_VGUI : public CFXPanel
{
public:
	// Constructor
	CFXToolBar_VGUI(std::string strTitle, int x,int y,int wide,int tall);

	/*
	* Accessors
	*/
	// Select
	void setSelectButton( CommandButton *pSelect ) { m_pSelect = pSelect; }
	CommandButton *getSelectButton( void ) { return m_pSelect; }

	// Move
	void setMoveButton( CommandButton *pMove ) { m_pMove = pMove; }
	CommandButton *getMoveButton( void ) { return m_pMove; }

	// Rotate
	void setRotateButton( CommandButton *pRotate ) { m_pRotate = pRotate; }
	CommandButton *getRotateButton( void ) { return m_pRotate; }

	// Increase Magnification
	void setIncMagButton( CommandButton *pIncMag ) { m_pIncMag = pIncMag; }
	CommandButton *getIncMagButton( void ) { return m_pIncMag; }

	// Decrease Magnification
	void setDecMagButton( CommandButton *pDecMag ) { m_pDecMag = pDecMag; }
	CommandButton *getDecMagButton( void ) { return m_pDecMag; }

	// Tool Mode
	void setToolMode( TOOLBAR_MODE toolmode ) { m_eToolMode = toolmode; }
	TOOLBAR_MODE getToolMode( void ) { return m_eToolMode; }
private:
	CommandButton	*m_pSelect;
	CommandButton	*m_pMove;
	CommandButton	*m_pRotate;
	CommandButton	*m_pIncMag;
	CommandButton	*m_pDecMag;
	TOOLBAR_MODE	m_eToolMode;
};

/*
* FX Tool Panel
*/
class CFXBaseTimeProp;
class CManagedWindow;
class CFXToolPanel_VGUI : public CMenuPanel
{	
	friend CManagedWindow;
public:
	// Constructor
	CFXToolPanel_VGUI( );

	// Realign all items
	void alignCheck( void );

	// Update
	virtual void Update( void );

	// Update Event Data
	void updateEventData( void );

	// Reset
	virtual void Reset( void );

	// Update Property Panels
	void updatePropPanels( void );

	// Add Property Panel
	void addPropPanel( CFXBaseTimeProp *pPanel );

	// Remove Property Panel
	void removePropPanel( CFXBaseTimeProp *pPanel );

	// Reset Property Panels
	void resetPropPanels( void );

	// Update Entity Movement/Rotational Status
//	void updateSelectedEnt( void );

	// Mouse functions, calls path manager for path selection
protected:
	virtual void internalMousePressed(MouseCode code);
	virtual void internalMouseReleased(MouseCode code);
	virtual void internalCursorExited();

public:
	/*
	* Accessors
	*/
	// Timeline
	void setTimeline( CFXTimeline_VGUI *pTime ) { m_pTimeline = pTime; };
	CFXTimeline_VGUI *getTimeline( void ) { return m_pTimeline; }

	// Object Manager
	void setObjectManager( CFXObjectManager_VGUI *pObject ) { m_pObjectManager = pObject; }
	CFXObjectManager_VGUI *getObjectManager( void ) { return m_pObjectManager; }

	// Path Manager
	void setPathManager( CFXPathManager_VGUI *pPath ) { m_pPathManager = pPath; }
	CFXPathManager_VGUI *getPathManager( void ) { return m_pPathManager; }

	// ToolBar
	void setToolBar( CFXToolBar_VGUI *pTool ) { m_pToolBar = pTool; }
	CFXToolBar_VGUI *getToolBar( void ) { return m_pToolBar; }

	// Event
	void setEvent( CFXEvent *pEvent ) { m_pEvent = pEvent; }
	CFXEvent *getEvent( void ) { return m_pEvent; }
	
	// Property Panels
	std::list<CFXBaseTimeProp*> *getPropertyPanels( void ) { return &m_PropertyPanels; }

	// Entering Text
	void setEnteringText( bool text ) { m_bEnteringText = text; }
	bool isEnteringText( void ) { return m_bEnteringText; }
	
	// Rotation Mode
/*	void setRotationMode( bool rotate ) { m_bRotateMode = rotate; }
	bool getRotationMode( void ) { return m_bRotateMode; }

	// Movement Mode
	void setMovementMode( bool movement ) { m_bMovementMode = movement; }
	bool getMovementMode( void ) { return m_bMovementMode; }

	// Property we're editing w/ rotation/movement mode
	void setPropertyEdit( CFXBaseTimeProp *pEdit ) { m_pPropEdit = pEdit; }
	CFXBaseTimeProp *getPropertyEdit( void ) { return m_pPropEdit; }

	// Rotation Circle Image
	void setRotationCircleImage( vgui::BitmapTGA *pImg ) { m_pRotationCircleImage = pImg; }
	vgui::BitmapTGA *getRotationCircleImage( void ) { return m_pRotationCircleImage; }

	// Rotation Circle Label
	void setRotationCircleLabel( Label *pLabel ) { m_pRotationCircleLabel = pLabel; }
	Label *getRotationCircleLabel ( void ) { return m_pRotationCircleLabel; }

	// Last Mouse Position
	void setLastMousePosition( Vector2D vecPos ) { m_vecLastMousePos = vecPos; }
	Vector2D getLastMousePosition( void ) { return m_vecLastMousePos; }

	// Is Dragging
	void setDragging( bool drag ) { m_bDragging = drag; }
	bool getDragging( void ) { return m_bDragging; }

	// Dragging mouse inside of rotation circle
	void setDragInside( bool draginside ) { m_bDragInside = draginside; }
	bool getDragInside( void ) { return m_bDragInside; }*/

protected:
	CFXTimeline_VGUI		*m_pTimeline;
	CFXObjectManager_VGUI	*m_pObjectManager;
	CFXPathManager_VGUI		*m_pPathManager;
	CFXToolBar_VGUI			*m_pToolBar;
	CFXEvent				*m_pEvent;
	std::list<CFXBaseTimeProp*> m_PropertyPanels;
	bool					m_bEnteringText;
/*	bool					m_bRotateMode;
	bool					m_bMovementMode;
	CFXBaseTimeProp			*m_pPropEdit;
	vgui::BitmapTGA			*m_pRotationCircleImage;
	Label					*m_pRotationCircleLabel;
	Vector2D				m_vecLastMousePos;
	bool					m_bDragging;
	bool					m_bDragInside;*/
};

#endif