// FormExMenu.h: interface for the CFormExMenu class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FORMEXMENU_H__DD381E06_A230_4068_ACCD_9995ADD5C6FF__INCLUDED_)
#define AFX_FORMEXMENU_H__DD381E06_A230_4068_ACCD_9995ADD5C6FF__INCLUDED_

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

class CFormExMenu : public CMenu  
{
	DECLARE_DYNCREATE(CFormExMenu)
public:
	typedef shared_ptr<CFormExMenu> PCFormExMenu;
private:

	HFONT m_hFont;
	CWnd* m_pParent;
	vector<PCFormExMenu> m_SubMenuVector; //CTypedPtrArray<CPtrArray, PCFormExMenu> m_pSubMenu;

	CImageList m_Images;
	BOOL m_bHasPictures;
	BOOL m_bHasCheck;
	COLORREF m_crSelected;
	COLORREF m_crSelectedBr;
	COLORREF m_crSelectedFont;
	COLORREF m_crBrush;
	COLORREF m_crFont;

	CFormExMenu(HFONT hFont);
	CFormExMenu();
	
public:
	static PCFormExMenu Create(HFONT hFont, CWnd* pParent);
	static PCFormExMenu Create(HFONT hFont, PCFormExMenu pParentMenu);

	virtual ~CFormExMenu();
private:

	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
public:

	// TODO скорее всего, интерфейс AppendMenu должен быть без параметров по умолчанию !!
	//BOOL AppendMenu(UINT nFlags, PCFormExMenu pSubMenu = PCFormExMenu((CFormExMenu*)NULL), LPCTSTR lpszNewItem = NULL);
	BOOL AppendMenu(UINT nFlags, PCFormExMenu pSubMenu, LPCTSTR lpszNewItem);

	void Init(CBLContext* pCont, CPictureHolder7* pPictureHolder7);
	void Init(CBLContext* pCont);

	void SetChecked(BOOL newCheckedFlag) { m_bHasCheck = newCheckedFlag; };

private:
	void InnerConstruct( HFONT hFont );
	void Copy(const CFormExMenu& SourceMenu);
};

#endif // !defined(AFX_FORMEXMENU_H__DD381E06_A230_4068_ACCD_9995ADD5C6FF__INCLUDED_)
