From 342008b552f16892b5abfe86eadce9feee4d0da0 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 8 Mar 2005 20:12:51 +0000 Subject: Allowed more commands to have their shortcuts changed, Fixed a memory leak in the BMP Menu class. git-svn-id: http://svn.leocad.org/trunk@387 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- win/Bmpmenu.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'win/Bmpmenu.cpp') diff --git a/win/Bmpmenu.cpp b/win/Bmpmenu.cpp index 2f0864e..67bfb0a 100644 --- a/win/Bmpmenu.cpp +++ b/win/Bmpmenu.cpp @@ -95,7 +95,8 @@ CBMPMenu::CBMPMenu() m_bitmapBackground = RGB(192,192,192); //gray m_bitmapBackgroundFlag=FALSE; GetCPInfo(CP_ACP,&CPInfo); - m_List.Create (IDB_VIEWPORTS, 41, 0, RGB (192,192,192)); + if (!m_List.m_hImageList) + m_List.Create (IDB_VIEWPORTS, 41, 0, RGB (192,192,192)); } CBMPMenu::~CBMPMenu() @@ -1410,3 +1411,18 @@ BOOL CBMPMenu::ChangeMenuItemShortcut(const char *Shortcut, UINT nID) return (CMenu::ModifyMenu(nID,mdata->nFlags,nID,(LPCTSTR)mdata)); } +BOOL CBMPMenu::DeleteMenu(UINT nPosition, UINT nFlags) +{ + if (nFlags == MF_BYPOSITION) + m_MenuList.RemoveAt(nPosition); + else + { + int nLoc; + + CBMPMenu *psubmenu = FindMenuOption(nPosition, nLoc); + if (psubmenu && nLoc >= 0) + psubmenu->m_MenuList.RemoveAt(nLoc); + } + + return (CMenu::DeleteMenu(nPosition, nFlags)); +} -- cgit v1.2.3