#if !defined(AFX_MANUFACTIONDLG_H__21F66ED0_7657_4F79_8B59_BC487218B8BF__INCLUDED_)
#define AFX_MANUFACTIONDLG_H__21F66ED0_7657_4F79_8B59_BC487218B8BF__INCLUDED_

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

#include "aplCharactView.h"
#include "aplApprovalView.h"
#include "aplDocsView.h"
#include "aplAccessView.h"
#include "afxwin.h"
/////////////////////////////////////////////////////////////////////////////
// CBPDlg dialog

class CBPDlg : public CResizableDialog
{
// Construction
public:
	CBPDlg(CWnd* pParent = NULL);   // standard constructor
	void SetReadOnlyItems();
	bool SaveChanges();
	void CreateSubBP();
// Dialog Data
	//{{AFX_DATA(CBPDlg)
	enum { IDD = IDD_MANUF_ACTION };
	CaplButton	m_btn_add;
	CStatic	m_st_action_ico;
	CaplButton	m_undo_check_out_ctrl;
	CaplButton	m_check_in_ctrl;
	CaplButton	m_check_out_ctrl;
	CEdit	m_act_label_ctrl;
	CStatic	m_act_parent_text_ctrl;
	CEdit	m_act_parent_ctrl;
	CButton	m_context_sel;
	CEdit	m_context_names;
	CStatic	m_context_text;
	CComboBox	m_type_ctrl;
	CStatic	m_st_bp_name;
	CaplButton	m_cancel_btn;
	CaplButton	m_bottom_btn;
	CaplButton	m_top_btn;
	CaplButton	m_ok_btn;
	CListCtrl	m_elements;
	CEdit	m_act_descr_ctrl;
	CEdit	m_act_name_ctrl;
	CEdit	m_act_id_ctrl;
	CEdit	m_act_code_ctrl;
	CString	m_act_id;
	CString	m_act_name;
	CString	m_act_descr;
	CString	m_act_code;
	CString	m_act_label;
	CaplTabCtrl	m_Tab;
	CaplButton	m_bPropsProps;
	CaplButton	m_bPropsDel;
	CaplButton	m_bPropsAdd;
	CButton m_customized_ctrl;
	CButton m_optional_ctrl;
	//}}AFX_DATA
	CaplNetStepData *m_data;
	CaplBPManager *m_bp_mgr;
	CaplInstance *m_bp,*m_base_bp,*m_item,*m_context,*m_type;
	bool m_context_changed;
	aplExtent m_bp_ref_contexts;
	long m_creation_mode;
	bool m_ReadOnly;
	bool m_changed_aggr;
	bool m_add_mode;
	CaplInstance *m_bp_ref;

	CaplAPI*		m_api;
	CString			m_csAccessString;

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

	BOOL			SetAnchors(void);
	void			SetSize(int cy);
	BOOL			InitViews(void);
	void			ChangeViewBtnsState(BOOL bDis,BOOL bHide);
	void			GetAccessString(void);



// Implementation
protected:
	void UpdateElements();
	void SetFromInst();
	CBitmap m_name_bmp;
	CBitmap m_name_qm_bmp;
	CBitmap m_ico_bmp;
	bool m_bIsAdmin;
	bool PointToVal(CPoint *point, int &i,CaplInstance **inst);
	// Generated message map functions
	//{{AFX_MSG(CBPDlg)
	virtual BOOL OnInitDialog();
	virtual void OnOK();
	afx_msg void OnElTop();
	afx_msg void OnElBottom();
	afx_msg void OnDblclkElements(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSelchangeActType();
	afx_msg void OnStActionName();
	afx_msg void OnContextSel();
	afx_msg void OnCheckOut();
	afx_msg void OnCheckIn();
	afx_msg void OnUndoCheckOut();
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	afx_msg void OnAddBp();
	afx_msg void OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnBPropsAdd();
	afx_msg void OnBPropsDel();
	afx_msg void OnBPropsProps();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()	
};

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

#endif // !defined(AFX_MANUFACTIONDLG_H__21F66ED0_7657_4F79_8B59_BC487218B8BF__INCLUDED_)
