#if !defined(AFX_SELECTPROCESSTEMPLDLG_H__792EFEB1_9009_46A1_B1BB_2522E7E1900E__INCLUDED_)
#define AFX_SELECTPROCESSTEMPLDLG_H__792EFEB1_9009_46A1_B1BB_2522E7E1900E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SelectProcessTemplDlg.h : header file
//
#include <apl_gui.h>
#include "resource.h"
#include "aplWfTemplateFrame.h"
#include "WfSelTemplatesTree.h"
#include "afxwin.h"
/////////////////////////////////////////////////////////////////////////////
// CSelectProcessTemplDlg dialog

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

// Dialog Data
	//{{AFX_DATA(CSelectProcessTemplDlg)
	enum { IDD = IDD_SEL_WF_TEMPLATE };
	CaplButton	m_delete_btn;
	CaplButton	m_change_btn;
	CaplButton	m_create_copy_btn;
	CaplButton	m_create_new_btn;
	CStatic	m_graph_ramka;
	CaplButton	m_ok_btn;
	CaplButton	m_cancel_btn;
	CEdit m_FindEdit;
	CaplButton m_FindBtn;
	CaplButton m_FindTopBtn;
	CaplButton m_FindBottomBtn;
	CEdit m_filtrEdit;
	CaplButton m_FiltrBtn;


	//}}AFX_DATA

	bool m_bEditorMode;
	int  m_iEditorResultMode;  
	// 0 - отмена;
	// 1- создать новый;
	// 2-создать копию ;
	// 3-начать редактирование
	// 4- удалить
	// 5 - свойства

	CFrameWnd *m_frame;
	CSplitterWnd m_splitter;
	CaplWfTemplateFrame *m_templates_frame;
	CWfSelTemplatesTree *m_templates_tree;

	CaplAPI *m_api;
	CaplWorkFlowManager *m_wf_mgr;
	aplExtent m_templates;
	CaplInstance *m_sel_template;
	CaplInstance *m_sel_activity;
	bool m_bShowAllTemplates;

	long m_SelectMode;

	CImageList m_il;

	void ExitFromTree(int code);

	void FindInTre(int delta);

	// filter templates by author (must be current user)
	void FilterTemplates();

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

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CSelectProcessTemplDlg)
	virtual BOOL OnInitDialog();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	virtual void OnOK();
	afx_msg void OnCreateNew();
	afx_msg void OnCreateCopy();
	afx_msg void OnChange();
	afx_msg void OnDelete();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedFind();
	afx_msg void OnBnClickedFindBottom();
	afx_msg void OnBnClickedFindTop();
	afx_msg void OnBnClickedFiltr();
	afx_msg void OnDestroy();
};

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

#endif // !defined(AFX_SELECTPROCESSTEMPLDLG_H__792EFEB1_9009_46A1_B1BB_2522E7E1900E__INCLUDED_)
