#if !defined(AFX_TPDIALOG_H__63421EAA_6D46_4736_A736_E1148B14958A__INCLUDED_)
#define AFX_TPDIALOG_H__63421EAA_6D46_4736_A736_E1148B14958A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TPDialog.h : header file
//
#include "resource.h"

#include "aplNetStepData.h"
#include "aplStepManager.h"
#include "apl_gui.h"
#include "common.h"

class CaplWorkFlowManager;
class CaplAutorizationManager;
/////////////////////////////////////////////////////////////////////////////
// CTPDialog dialog

class CTPDialog : public CaplTranslateDialog
{
// Construction
public:
	BOOL m_bReadOnly;
	CTPDialog(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CTPDialog)
	enum { IDD = IDD_TASK_PROT_DIALOG };
	CComboBox	m_rolesCtrl;
	CButton	m_setRoleCtrl;
	CaplButton	m_clearPerformer;
	CaplButton	m_clearManager;
	CaplButton	m_selPer;
	CaplButton	m_selMgr;
	CEdit	m_name;
	CEdit	m_id;
	CEdit	m_mEdit;
	CEdit	m_hEdit;
	CEdit	m_dEdit;
	CStatic	m_per_wnd;
	CStatic	m_mgr_wnd;
	CButton	m_addBtn;
	CaplButton	m_cancelBtn;
	CaplButton	m_okBtn;
	CComboBox	m_actCB;
	CSpinButtonCtrl	m_mSpin;
	CSpinButtonCtrl	m_hSpin;
	CSpinButtonCtrl	m_dSpin;
	int		m_iDay;
	int		m_iHour;
	int		m_iMin;
	int		m_iActivity;
	CString	m_sId;
	CString	m_sName;
	CString	m_sManager;
	CString	m_sPerformer;
	BOOL	m_bSetRole;
	int		m_iDefaultRole;
	//}}AFX_DATA
	CaplWorkFlowManager* m_wf_mgr;
	
	CaplAPI* m_api;
	CaplInstance* m_proc_tmpl;
	CaplInstance* m_process;
	CaplInstance* m_prot;
	aplExtent m_activities;
	aplExtent* m_tp;//прототипы

	CArray<CTaskInfo, CTaskInfo>* m_prototypes;
	CArray<CTaskInfo, CTaskInfo> m_new_prototypes;
	CTaskInfo m_prot_info;
	
	CWnd* m_buddyWndD;
	CWnd* m_buddyWndH;
	CWnd* m_buddyWndM;

	aplExtent m_perExt;
	aplExtent m_mgrExt;
	CaplInstance* m_manager;
	CaplInstance* m_performer;
	aplExtent m_performers;
	
	bool m_bCanEditRole;
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTPDialog)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CTPDialog)
	afx_msg void OnDeltaposSpinD(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDeltaposSpinM(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDeltaposSpinH(NMHDR* pNMHDR, LRESULT* pResult);
	virtual BOOL OnInitDialog();
	virtual void OnOK();
	virtual void OnCancel();
	afx_msg void OnTpAddButton();
	afx_msg void OnSelchangeTpManager();
	afx_msg void OnSelchangeTpActivity();
	afx_msg void OnSelchangeTpPerformer();
	afx_msg void OnChangeTpDurDay();
	afx_msg void OnChangeTpDurHour();
	afx_msg void OnChangeTpDurMin();
	afx_msg void OnTpManagerSelect();
	afx_msg void OnTpPerformerSelect();
	afx_msg void OnTpClearManager();
	afx_msg void OnTpClearPerformer();
	afx_msg void OnChangeRoleCheck();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_TPDIALOG_H__63421EAA_6D46_4736_A736_E1148B14958A__INCLUDED_)
