// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MAINFRM_H__8F085AD8_94FE_11D3_BEF1_DCACE325AC16__INCLUDED_)
#define AFX_MAINFRM_H__8F085AD8_94FE_11D3_BEF1_DCACE325AC16__INCLUDED_

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


#include "PSMDoc.h"
#include "InfoBar.h"

#define APL_LANG_MENU_BASE ID_LANG_ID_BEGIN		// начальный номер элементов меню выбора языка

class CMainFrame : public CaplMDIFrameWnd 
{
public:
	CMainFrame();
protected: // create from serialization only
	DECLARE_DYNCREATE(CMainFrame)

// Attributes
protected:
	
	HCURSOR  m_hCursor;
	CBitmap m_BkBmp;
	CImageList m_il_ToolBar,m_il_TB1;
	CImageList m_il_ToolBar_d,m_il_TB1_d;
	int m_old_cx;
	
public:

	static int m_AutoDeliveMesTime;  // Интервал проверки, мин
	static int m_AutoDeliveTaskTime; // Интервал напоминания, мин

	static BOOL m_AutoDeliveMes;
	static BOOL m_AutoDeliveTask;
	static BOOL m_NotifyWithPersonalMonitor; // Показывать персональный монитор	
	
	UINT m_AutoDeliveMesTimer;
	UINT m_AlertTimer;

	// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMainFrame)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
	protected:
	virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL
	void GetDockState(CDockState& state) const;
	void SaveBarState(LPCTSTR lpszProfileName) const;

// Implementation
public:
	virtual ~CMainFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

public:  
	CStatusBar  m_wndStatusBar;
	CaplToolBar    m_wndToolBar;
	CaplToolBar    m_wndMainTB1;
	
	CaplReBar   m_wndReBar;
	CInfoBar m_InfoBar;
	CPSMDoc *m_last_open_doc;

	CString m_sModuleName; // Имя модуля (для отображения в заголовки при запуске в нестандартных режимах)

#ifdef ENABLE_ASH_MO
	bool m_bEnableAshMo; // Включение режима АСХ МО  (другая панель)
	CaplToolBar m_wndAshMoTB; // Для макета АСХ МО
	CaplReBar   m_wndReBarAshMoTB;
	CImageList m_il_ToolBarAshMo,m_il_ToolBarAshMo_d;
	CBitmap m_about_ash_mo;
#endif

	CMenu m_menu;
	BOOL m_ShowToolBarBitmap;

public:
	void SetAutoDeliveMes();
	void SetAlertTimer(UINT time);

	void SetStatusString(LPCTSTR str);
	
	void StartBusy();
	void StopBusy();

//	CArray<CMenu*, CMenu*> m_sub_menu;
	void AppendMainMenu(CPSMDoc* doc);

// Generated message map functions
protected:
	//{{AFX_MSG(CMainFrame)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnNavigatorPanel();
	afx_msg void OnUpdateNavigatorPanel(CCmdUI* pCmdUI);
	afx_msg void OnDestroy();
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
	afx_msg void OnShowToolbarBmp();
	afx_msg void OnClose();
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnCustMainTb();
	afx_msg void OnMenuXpStyle();
	afx_msg void OnUpdateMenuXpStyle(CCmdUI* pCmdUI);
	afx_msg void OnTreeXpStyle();
	afx_msg void OnUpdateTreeXpStyle(CCmdUI* pCmdUI);
	afx_msg void OnUpdateShowToolbarBmp(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
	afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
protected:
	virtual void OnUpdateFrameTitle(BOOL bAddToTitle);
public:
	afx_msg void OnViewToolbar();
	afx_msg void OnUpdateViewToolbar(CCmdUI *pCmdUI);
};

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_MAINFRM_H__8F085AD8_94FE_11D3_BEF1_DCACE325AC16__INCLUDED_)

