/*=============================================================================
 *
 *  Filename:           DlgState.hpp : implementation file
 *  Version:            1.0
 *  Date:				02/01/97
 *  Author:             Marc Trabucato & V.L.
 *
 *  Description:		Definition of a FormView Dialog class for animaction
 *						parameters
 *
 *===========================================================================*/

#ifndef __DLGSTATE_HPP__
#define __DLGSTATE_HPP__

/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/

#include "TAct_res.h"

class TAction_Interface;
class CPA_State;
class CPA_Family;
class CPA_Action;
class State_ModifTransitionExtended;

typedef enum tdeDisplayType_
{
    E_dt_All,
    E_dt_Prohibited,
    E_dt_Allowed
} tdeDisplayType;

/*=============================================================================
* CDlgstate class
=============================================================================*/
class CDlgState : public CFormView
{
  protected:
    TAction_Interface*  m_p_oParentDLL;
	BOOL				m_bFirstShow;
	CDC					m_oAllowedDC;
	CDC					m_oProhibitedDC;
	CBitmap				m_oAllowedBitmap;
	CBitmap				m_oProhibitedBitmap;
//ANNECY CT 11/02/98{
	CDC					m_oFluidDC;
	CBitmap				m_oFluidBitmap;
//ENDANNECY CT}
    CFont               m_oBoldFont;
    BOOL                m_bAllFamilies;
    tdeDisplayType      m_eTransitionTypeDisplay;
  protected:
    CDlgState();       // protected constructor used by dynamic creation
    DECLARE_DYNCREATE(CDlgState)

  // Form Data
  public:
    //{{AFX_DATA(CDlgState)
    enum { IDD = IDD_DLG_STATE };
	//}}AFX_DATA

  // Attributes
  public:
	BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
				DWORD dwRequestedStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
				CCreateContext* pContext);
  // Operations
  public:
    void fn_vSetCurrentState    ( CPA_State *_p_oState );
    void mfn_vSetCurrentFamily  ( CPA_Family *_p_oFamily );
    void mfn_vFillFamilyList    ( void );
    void mfn_vFillStateList     (CPA_State *_p_oState);
    void mfn_vFillAnimationList (CPA_Family *_p_oFamily);
    void mfn_vFillMecaList      ( void );
    void fn_vSetParentDLL       ( TAction_Interface *_p_oDLL)  { m_p_oParentDLL = _p_oDLL; }
    void mfn_vStateChanged      ( CPA_State  *_p_oState , tdeChangingState _eChange);

  // Overrides
	// ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CDlgState)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL

  // Implementation
  protected:
    ~CDlgState();
	#ifdef _DEBUG
		virtual void AssertValid() const;
		virtual void Dump(CDumpContext& dc) const;
	#endif

	void OnBtExtendfamily							( void );
	void OnBtExtendaction							( void );
	void OnBtExtendselection						( void );
    void mfn_vOnDrawItemComboBoxNextState           ( LPDRAWITEMSTRUCT lpDIS );
    void mfn_vOnDrawItemListBoxAction               ( LPDRAWITEMSTRUCT lpDIS );
    void mfn_vOnDrawItemComboBoxInterruptState      ( LPDRAWITEMSTRUCT lpDIS );
    BOOL mfn_bOnLButtonDownListBoxAction            ( MSG *pMsg );
    BOOL mfn_bOnRButtonDownListBoxAction            ( MSG *pMsg );
    void mfn_vFillInterruptActionList               ( void );
    BOOL mfn_bOnChangeTransitions                   ( int _iIndex );
    void mfn_vSetTransitions                        ( tdeTransitionState _eState );
    int  SelectStringExact                          ( CComboBox *_pCB, const CString _csEntry );
	void mfn_vSetDisplayTransition					( tdeDisplayType _eDisplay );
	BOOL mfn_bGetTSIAndActionFromIndex				( int _iIndex, tdstTransitionStateInfo **_pp_stTSI, CPA_Action **_pp_oAction);
	void fn_vExtendTransitions						( State_ModifTransitionExtended *_p_oModif );
	void mfn_vDisplayCustomBits						( CPA_State  *_p_oState );

    // Generated message map functions
    //{{AFX_MSG(CDlgState)
	afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
	afx_msg void OnDestroy();
	afx_msg void OnDeltaposSpinReplay(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDeltaposSpinSpeed(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnChangeReplay(); 
	afx_msg void OnChangeSpeed(); 
    afx_msg void OnCheckDefault();
    afx_msg void OnCheckDisplay();
	afx_msg void OnSelchangeComboAnimation();
	afx_msg void OnSelchangeComboInterruptstate();
	afx_msg void OnSelchangeComboNextstate();
	afx_msg void OnSelchangeComboMechanic();
	afx_msg void OnSelchangeListInterruptaction();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnBtMore();
	afx_msg void OnSelchangeComboFamily();
	afx_msg void OnCBClicked(UINT nID);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#endif // __DLGSTATE_HPP__
