summaryrefslogtreecommitdiff
path: root/win/Bmpmenu.h
diff options
context:
space:
mode:
authorleo2004-11-19 19:51:14 +0000
committerleo2004-11-19 19:51:14 +0000
commit7a4d9fd9e4c0b651c64c912b1d42c9f38fef2a2b (patch)
tree0d8fe8298577580d94d1e7f0e327fa49847ec880 /win/Bmpmenu.h
parent0f5654b264e729918f48fc4c95aba636d673ed3a (diff)
Added support for custom user shortcut keys.
git-svn-id: http://svn.leocad.org/trunk@363 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win/Bmpmenu.h')
-rw-r--r--win/Bmpmenu.h170
1 files changed, 80 insertions, 90 deletions
diff --git a/win/Bmpmenu.h b/win/Bmpmenu.h
index b32e01e..8866ea7 100644
--- a/win/Bmpmenu.h
+++ b/win/Bmpmenu.h
@@ -57,101 +57,91 @@ typedef enum {Normal,TextOnly} HIGHLIGHTSTYLE;
class CBMPMenu : public CMenu // Derived from CMenu
{
-// Construction
+ // Construction
public:
-CBMPMenu();
-// Attributes
+ CBMPMenu();
+ // Attributes
protected:
-CTypedPtrArray<CPtrArray, CBMPMenuData*> m_MenuList; // Stores list of menu items
-// When loading an owner-drawn menu using a Resource, CBMPMenu must keep track of
-// the popup menu's that it creates. Warning, this list *MUST* be destroyed
-// last item first :)
-CImageList m_List;
-
-CTypedPtrArray<CPtrArray, CBMPMenu*> m_SubMenus; // Stores list of sub-menus
-// Operations
+ CTypedPtrArray<CPtrArray, CBMPMenuData*> m_MenuList; // Stores list of menu items
+ // When loading an owner-drawn menu using a Resource, CBMPMenu must keep track of
+ // the popup menu's that it creates. Warning, this list *MUST* be destroyed
+ // last item first :)
+ CImageList m_List;
+
+ CTypedPtrArray<CPtrArray, CBMPMenu*> m_SubMenus; // Stores list of sub-menus
+ // Operations
public:
-// Overrides
-// ClassWizard generated virtual function overrides
-//{{AFX_VIRTUAL(CCustomMenu)
-//}}AFX_VIRTUAL
-// Implementation
+ // Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CCustomMenu)
+ //}}AFX_VIRTUAL
+ // Implementation
public:
- static BOOL IsNewShell(void);
- void SetBitmapBackground(COLORREF color);
- void SetDisableOldStyle(void);
- void UnSetDisableOldStyle(void);
- BOOL GetDisableOldStyle(void);
- void UnSetBitmapBackground(void);
- int AddBitmapToImageList(CImageList *list,UINT nResourceID);
- BOOL LoadFromToolBar(UINT nID,UINT nToolBar,int& xoffset);
- void InsertSpaces(void);
- static LRESULT FindKeyboardShortcut(UINT nChar,UINT nFlags,CMenu *pMenu);
- static void UpdateMenu(CMenu *pmenu);
- BOOL IsMenu(CMenu *submenu);
- void DrawCheckMark(CDC *pDC,int x,int y,COLORREF color);
- void DrawRadioDot(CDC *pDC,int x,int y,COLORREF color);
- CBMPMenu *FindMenuOption(int nId,int& nLoc);
- CBMPMenuData *FindMenuOption(wchar_t *lpstrText);
- BOOL GetMenuText(UINT id,CString &string);
- CImageList *checkmaps;
- BOOL checkmapsshare;
- int m_selectcheck;
- int m_unselectcheck;
- void LoadCheckmarkBitmap(int unselect,int select);
- void DitherBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth,
- int nHeight, HBITMAP hbm, int nXSrc, int nYSrc);
- void DitherBlt2(CDC *drawdc, int nXDest, int nYDest, int nWidth,
- int nHeight, CBitmap &bmp, int nXSrc, int nYSrc);
- HBITMAP LoadSysColorBitmap(int nResourceId);
-
-virtual ~CBMPMenu(); // Virtual Destructor
-// Drawing:
-virtual void DrawItem( LPDRAWITEMSTRUCT); // Draw an item
-virtual void MeasureItem( LPMEASUREITEMSTRUCT ); // Measure an item
-
-// Customizing:
-
-void SetIconSize (int, int); // Set icon size
-
-BOOL AppendODMenuA(LPCSTR lpstrText,
-UINT nFlags = MF_OWNERDRAW,
-UINT nID = 0,
-int nIconNormal = -1); // Owner-Drawn Append
-
-BOOL AppendODMenuW(wchar_t *lpstrText,
-UINT nFlags = MF_OWNERDRAW,
-UINT nID = 0,
-int nIconNormal = -1); // Owner-Drawn Append
-
-
-BOOL ModifyODMenuA(const char *lpstrText,UINT nID=0,int nIconNormal=-1);
-BOOL ModifyODMenuA(const char *lpstrText,const char *OptionText,int nIconNormal);
-BOOL ModifyODMenuW(wchar_t *lpstrText,UINT nID=0,int nIconNormal=-1);
-BOOL ModifyODMenuW(wchar_t *lpstrText,wchar_t *OptionText,int nIconNormal);
-CBMPMenuData *NewODMenu(UINT pos,UINT nFlags,UINT nID,CString string);
-void SynchronizeMenu(void);
-void CBMPMenu::InitializeMenuList(int value);
-void CBMPMenu::DeleteMenuList(void);
-CBMPMenuData *CBMPMenu::FindMenuList(UINT nID);
-virtual BOOL LoadMenu(LPCTSTR lpszResourceName); // Load a menu
-virtual BOOL LoadMenu(int nResource); // ...
-void AddFromToolBar(CToolBar* pToolBar, int nResourceID);
-BOOL Draw3DCheckmark(CDC *dc, const CRect& rc,BOOL bSelected,
- HBITMAP hbmCheck);
-BOOL LoadToolbar(UINT nToolBar);
-BOOL LoadToolbars(const UINT *arID,int n);
-
-// Destoying:
-
-virtual BOOL DestroyMenu();
-
-// Generated message map functions
+ static BOOL IsNewShell(void);
+ void SetBitmapBackground(COLORREF color);
+ void SetDisableOldStyle(void);
+ void UnSetDisableOldStyle(void);
+ BOOL GetDisableOldStyle(void);
+ void UnSetBitmapBackground(void);
+ int AddBitmapToImageList(CImageList *list,UINT nResourceID);
+ BOOL LoadFromToolBar(UINT nID,UINT nToolBar,int& xoffset);
+ void InsertSpaces(void);
+ static LRESULT FindKeyboardShortcut(UINT nChar,UINT nFlags,CMenu *pMenu);
+ static void UpdateMenu(CMenu *pmenu);
+ BOOL IsMenu(CMenu *submenu);
+ void DrawCheckMark(CDC *pDC,int x,int y,COLORREF color);
+ void DrawRadioDot(CDC *pDC,int x,int y,COLORREF color);
+ CBMPMenu *FindMenuOption(int nId,int& nLoc);
+ CBMPMenuData *FindMenuOption(wchar_t *lpstrText);
+ BOOL GetMenuText(UINT id,CString &string);
+ CImageList *checkmaps;
+ BOOL checkmapsshare;
+ int m_selectcheck;
+ int m_unselectcheck;
+ void LoadCheckmarkBitmap(int unselect,int select);
+ void DitherBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HBITMAP hbm, int nXSrc, int nYSrc);
+ void DitherBlt2(CDC *drawdc, int nXDest, int nYDest, int nWidth, int nHeight, CBitmap &bmp, int nXSrc, int nYSrc);
+ HBITMAP LoadSysColorBitmap(int nResourceId);
+
+ virtual ~CBMPMenu(); // Virtual Destructor
+ // Drawing:
+ virtual void DrawItem( LPDRAWITEMSTRUCT); // Draw an item
+ virtual void MeasureItem( LPMEASUREITEMSTRUCT ); // Measure an item
+
+ // Customizing:
+
+ void SetIconSize (int, int); // Set icon size
+
+ BOOL AppendODMenuA(LPCSTR lpstrText, UINT nFlags = MF_OWNERDRAW, UINT nID = 0, int nIconNormal = -1); // Owner-Drawn Append
+ BOOL AppendODMenuW(wchar_t *lpstrText, UINT nFlags = MF_OWNERDRAW, UINT nID = 0, int nIconNormal = -1); // Owner-Drawn Append
+
+ BOOL ChangeMenuItemShortcut(const char *Shortcut, UINT nID);
+ BOOL ModifyODMenuA(const char *lpstrText,UINT nID=0,int nIconNormal=-1);
+ BOOL ModifyODMenuA(const char *lpstrText,const char *OptionText,int nIconNormal);
+ BOOL ModifyODMenuW(wchar_t *lpstrText,UINT nID=0,int nIconNormal=-1);
+ BOOL ModifyODMenuW(wchar_t *lpstrText,wchar_t *OptionText,int nIconNormal);
+ CBMPMenuData *NewODMenu(UINT pos,UINT nFlags,UINT nID,CString string);
+ void SynchronizeMenu(void);
+ void CBMPMenu::InitializeMenuList(int value);
+ void CBMPMenu::DeleteMenuList(void);
+ CBMPMenuData *CBMPMenu::FindMenuList(UINT nID);
+ virtual BOOL LoadMenu(LPCTSTR lpszResourceName); // Load a menu
+ virtual BOOL LoadMenu(int nResource); // ...
+ void AddFromToolBar(CToolBar* pToolBar, int nResourceID);
+ BOOL Draw3DCheckmark(CDC *dc, const CRect& rc,BOOL bSelected, HBITMAP hbmCheck);
+ BOOL LoadToolbar(UINT nToolBar);
+ BOOL LoadToolbars(const UINT *arID,int n);
+
+ // Destoying:
+
+ virtual BOOL DestroyMenu();
+
+ // Generated message map functions
protected:
-int m_iconX,m_iconY;
-COLORREF m_bitmapBackground;
-BOOL m_bitmapBackgroundFlag;
-BOOL disable_old_style;
+ int m_iconX,m_iconY;
+ COLORREF m_bitmapBackground;
+ BOOL m_bitmapBackgroundFlag;
+ BOOL disable_old_style;
};
#endif