#if !defined(AFX_DLGLOGIN_H__123443F3_968D_11D3_9E47_00C026EE2281__INCLUDED_)
#define AFX_DLGLOGIN_H__123443F3_968D_11D3_9E47_00C026EE2281__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "resource.h"
#include <apl_gui.h>
#include "DlgSelectBase.h"
#include "aplNetStepData.h"
#include <afxwin.h>
#include <afxcmn.h>


// DlgLogin.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CDlgLogin dialog

class CEditPwd :public CEdit
{
public:
	CaplToolTip m_ToolTip;

	void CheckCapsLock();
	DECLARE_MESSAGE_MAP()
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
};


class CDlgLogin : public CaplTranslateDialog
{
// Construction
protected:
	CBitmap m_bmp;
	bool m_started_uname;
public:
//	CString m_reg_username;
//	bool is_connection_user;
	CDlgLogin(CWnd* pParent = NULL);   // standard constructor
	int m_cur_select_connection;
	CString m_cur_name;
	CaplNetStepData* m_data;
	CString	m_Username;
	CString m_type_license;

	bool m_bExitAfterClose;  // Выйти из приложения после закрытия окна

	void FillListConnect();
	bool MoveWnd(CWnd& wnd, int dx = 0, int dy = 0);
	void SetKeyboardLayuotInfo();

	static void AppendString2List(CStringArray &reg_user_list, CString &username);

// Dialog Data
	//{{AFX_DATA(CDlgLogin)
	enum { IDD = IDD_DLG_LOGDATA_NEW };
	CEditPwd	m_CtrlEditPwd;
	CStatic	m_StaticUsername;
	CStatic	m_StaticPassword;
	CStatic	m_StaticConnection;
	CaplButton	m_CtrlOk;
	CaplButton	m_CtrlCancel;
	CButton	m_CtrlTune;
	//CStatic	m_StaticLicense;
	CStatic	m_StaticLicenseAnnotation;
	//CComboBox	m_SelectTypeLicense;
	CComboBox	m_CtrlEditSelectUsername;
	CComboBox	m_SelectConnection;
	CComboBox m_CmbDomain;
	CStatic	m_logo;
	CString	m_Pwd;
	CString	m_StaticNameConnection;
	CStatic m_KeyboardLayout;
	//}}AFX_DATA

	BOOL m_IsSaveLoginData;
	CString m_Domain;
	DWORD m_NumDays;

	CString m_sOsUser;
	CString m_sOsDomain;

	void CheckClearFlagSave();
	void ChangeUserControls();


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

// Implementation
protected:
	CToolTipCtrl m_tt;
	// Generated message map functions
	//{{AFX_MSG(CDlgLogin)
	virtual BOOL OnInitDialog();
	afx_msg void OnTune();
	virtual void OnOK();
	afx_msg void OnSelchangeSelectConnection();
	afx_msg BOOL PreTranslateMessage(MSG* pMsg);
	afx_msg void OnStnClickedStaticUsername();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnTimer(UINT_PTR nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:

	afx_msg void OnCbnSelchangeEditSelectUsername();
	afx_msg void OnCbnEditchangeEditSelectUsername();
	CButton m_CtrlSaveLoginData;
	CEdit m_CtrlNumDays;
	CButton m_CtrlIsDomain;
	BOOL m_bIsCurrDomainUser;
	afx_msg void OnBnClickedChk();
};

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

#endif // !defined(AFX_DLGLOGIN_H__123443F3_968D_11D3_9E47_00C026EE2281__INCLUDED_)
