#ifndef __CCmdUI_h
#define __CCmdUI_h

class MfcCmdUI        // simple helper class
{
public:
// Attributes
	UINT m_nID;
	UINT m_nIndex;          // menu item or other index

	// if a menu item
	MfcMenu* m_pMenu;         // NULL if not a menu
	MfcMenu* m_pSubMenu;      // sub containing menu item
							// if a popup sub menu - ID is for first in popup

	// if from some other window
	MfcWnd* m_pOther;         // NULL if a menu or not a MfcWnd

// Operations to do in ON_UPDATE_COMMAND_UI
	virtual void Enable(BOOL bOn = TRUE);
	virtual void SetCheck(int nCheck = 1);   // 0, 1 or 2 (indeterminate)
	virtual void SetRadio(BOOL bOn = TRUE);
	virtual void SetText(LPCTSTR lpszText);

// Advanced operation

// Implementation
	BOOL m_bEnableChanged;
	BOOL m_bContinueRouting;
	UINT m_nIndexMax;       // last + 1 for iterating m_nIndex

	MfcMenu* m_pParentMenu;   // NULL if parent menu not easily determined
							//  (probably a secondary popup menu)
};

#endif//__CCmdUI_h
