#if !defined(AFX_SELECTACCESSAGENT_H__006DDD9F_D19A_4DDB_A08E_E4877E315B1A__INCLUDED_)
#define AFX_SELECTACCESSAGENT_H__006DDD9F_D19A_4DDB_A08E_E4877E315B1A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SelectAccessAgent.h : header file
//
#include "resource.h"
#include "aplNetStepData.h"
#include <apl_gui.h>



// Порядковые номера иконок
#define ICON_GROUPE 0
#define ICON_USER 1
#define ICON_CUR_GROUPE 4
#define ICON_CUR_USER 5
#define ICON_NON_GROUPE_USERS 7


/////////////////////////////////////////////////////////////////////////////
// CSelectAccessAgent dialog

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

	POINT m_ptMinTrackSize;		// min tracking size
	POINT m_pLastSize;
	
// Dialog Data
	//{{AFX_DATA(CSelectAccessAgent)
	enum { IDD = IDD_SELECT_ACCESS_AGENT };
	CStatic	m_CtrlStatic1;
	CaplButton	m_CtrlAdd;
	CaplButton	m_CtrlCancel;
	CComboBox	m_CtrlCmbAccess;
	CTreeCtrl	m_TreeAccessAgents;
	CaplButton	m_btnFBegin;
	CaplButton	m_btnFBack;
	CaplButton	m_btnFForward;
	CEdit	m_edFindStr;

	//}}AFX_DATA

	void CreateTree();
	bool Attach(CaplNetStepData* data);

	void MoveCtrl(CWnd &wnd, int cx, int cy, bool isMove = true);
		
	aplExtent m_ext_user, m_ext_workgroup;
	//aplExtent m_ext_out_user,m_ext_out_workgroup;
	aplExtent m_ext_out;
	//Указатель на StepData
	CaplNetStepData* m_data;
	aplAccessModeType m_res_access;
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSelectAccessAgent)
public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);

protected:
	// предотвращаем потерю модальности после диалога с бочками из aplSocketTransport
	CaplParentWndProcesser m_pwp;

	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL
	//BOOL OnToolTipShow( UINT id, NMHDR * pNMHDR, LRESULT * pResult ); ЯАИ:  Перенесено в CaplTranslateDialog
// Implementation
protected:
	HTREEITEM m_non_groupe_item;
	CArray<HTREEITEM,HTREEITEM> m_list_items_group;
	CArray<HTREEITEM,HTREEITEM> m_list_items_users;
	// Generated message map functions
	//{{AFX_MSG(CSelectAccessAgent)
	virtual BOOL OnInitDialog();
	afx_msg void OnClickTreeAccessAgents(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnAddSa();
	afx_msg void OnFindForward();
	afx_msg void OnFindBack();
	afx_msg void OnButton4Beg();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnTvnSelchangedTreeAccessAgents(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnTimer(UINT_PTR nIDEvent);
};

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

#endif // !defined(AFX_SELECTACCESSAGENT_H__006DDD9F_D19A_4DDB_A08E_E4877E315B1A__INCLUDED_)
