#if !defined(AFX_CHANGESTREEDLG_H__54CAD861_0B3C_4CEB_9BA0_288655D39576__INCLUDED_)
#define AFX_CHANGESTREEDLG_H__54CAD861_0B3C_4CEB_9BA0_288655D39576__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CChangesTreeDlg dialog

class CChangeItemData:public CItemData
{
public:
	CChangeItemData():CItemData(){m_bLast= true;}
	CChangeItemData(CaplInstance *_inst, HTREEITEM _item, HTREEITEM _fictive, bool _last)
		:CItemData(_inst, _item, _fictive){m_bLast= _last;}
	~CChangeItemData(){};
	
	bool m_bLast;
};

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

// Dialog Data
	//{{AFX_DATA(CChangesTreeDlg)
	enum { IDD = IDD_CHANGE_TREE_DIALOG };
	CTreeCtrl	m_chngTreeCtrl;
	CaplButton	m_ok_btn;
	CaplButton	m_cancel_btn;
	//}}AFX_DATA
	
	CaplAPI* m_api;
	CaplInstance* m_change;
	CImageList m_imageList;
    
	CaplTAggr <CChangeItemData*, CChangeItemData*, APLAGGR_LIST|APLAGGR_AUTOKILLREF> m_items;
	
	aplExtent m_inCashExt;//документы, бизнес-процессы и изделия, для которых считаны изменения
	aplExtent m_rolebackExt;//при ОК эти изменения откатываются
	
	void FillChangesTree(HTREEITEM item= TVI_ROOT);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CChangesTreeDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CChangesTreeDlg)
	virtual void OnOK();
	virtual void OnCancel();
	virtual BOOL OnInitDialog();
	afx_msg void OnItemexpandedCtTree(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnRclickCtTree(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_CHANGESTREEDLG_H__54CAD861_0B3C_4CEB_9BA0_288655D39576__INCLUDED_)
