00001
00002
00003
00004
00005
00006 #if !defined(AFX_FSODMENU_H__96CA51C4_937D_4832_A83D_65A4A3C7E117__INCLUDED_)
00007 #define AFX_FSODMENU_H__96CA51C4_937D_4832_A83D_65A4A3C7E117__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif
00012
00013 #include "plugins.h"
00014
00015 #define ODMENU_CHECKIMAGE_CHECK (-1)
00016 #define ODMENU_CHECKIMAGE_RADIO (-2)
00017
00018 struct fsODMenuItemData
00019 {
00020 CString strMenuText;
00021 BOOL bMenuBar;
00022 BOOL bBold;
00023 int iImage;
00024 int iCheckImage;
00025 };
00026
00027 typedef wgMenuItemImage fsSetImage;
00028
00029 struct fsSetText
00030 {
00031 UINT nIDItem;
00032 LPCSTR pszText;
00033
00034 fsSetText (UINT nID, LPCSTR psz) : nIDItem (nID), pszText (psz) {}
00035 };
00036
00037 class fsODMenu
00038 {
00039 public:
00040
00041 void Attach (CMenu* pMenu, BOOL bMainMenu);
00042
00043 void Detach();
00044
00045 void OnDrawItem (LPDRAWITEMSTRUCT pdis);
00046 void OnMeasureItem (LPMEASUREITEMSTRUCT pmis);
00047
00048 void SetImageList (CImageList* pList, CImageList *pDisList);
00049
00050 int InsertMenu (CMenu* pMenu, int iWhere, CMenu *pMenuWhere = NULL);
00051
00052 void RemoveMenu (int iWhere, int iCount, CMenu *pMenuWhere = NULL);
00053
00054 void InsertMenuItem (CMenu* pMenu, LPCSTR pszItem, UINT nID, UINT uWhere, BOOL bByPos);
00055
00056 fsODMenuItemData* AddItem (CMenu *pMenu, UINT nID, LPCSTR pszItem);
00057
00058 void RemoveMenuItem (CMenu* pMenu, UINT nID, BOOL bByPos);
00059
00060 void SetMenuItemsText (CMenu* pMenu, fsSetText* pTexts, UINT nSize, BOOL bByPos);
00061
00062 void SetMenuItemText (CMenu* pMenu, LPCSTR pszText, UINT nID, BOOL bByPos = FALSE);
00063
00064 void SetImages (fsSetImage* pImages, int cImages, CMenu* pMenu = NULL, BOOL fByPos = FALSE);
00065
00066 fsODMenu();
00067 virtual ~fsODMenu();
00068
00069 protected:
00070
00071 void AttachMenu (CMenu* pMenu, BOOL bMenuBar = FALSE);
00072
00073 fsODMenuItemData* AttachMenuItem (CMenu *pMenu, UINT iPos, BOOL bByPos = TRUE);
00074
00075 void DetachMenu (CMenu* pMenu);
00076
00077 void DetachMenuItem (CMenu *pMenu, UINT iPos, BOOL bByPos = TRUE);
00078
00079 void DrawCheckMark (CDC *dc, RECT& rc, BOOL bSelected, BOOL bGrayed);
00080
00081 HMENU CopyMenu (HMENU hMenu);
00082
00083
00084 CImageList* m_pImages, *m_pDisImages;
00085 CFont m_font;
00086 UINT m_cyIcon;
00087 UINT m_cxIcon;
00088 CFont m_fontBold;
00089 HMENU m_hMenu;
00090 };
00091
00092 #endif