summaryrefslogtreecommitdiff
path: root/win/cadbar.cpp
diff options
context:
space:
mode:
authorleo2006-02-26 07:27:13 +0000
committerleo2006-02-26 07:27:13 +0000
commit4e11b17e7365ba4bb8bedddc96576562cd635d75 (patch)
tree4597155b45fa3fdc7e336189a02f8336da6c1eba /win/cadbar.cpp
parentd780eb6826a0e0d98f8457259cd922b7bdce6cda (diff)
Better menu title class.
git-svn-id: http://svn.leocad.org/trunk@496 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win/cadbar.cpp')
-rw-r--r--win/cadbar.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/win/cadbar.cpp b/win/cadbar.cpp
index 721900a..a6093f3 100644
--- a/win/cadbar.cpp
+++ b/win/cadbar.cpp
@@ -70,20 +70,21 @@ void CCADStatusBar::OnLButtonDown(UINT nFlags, CPoint point)
if (rect.PtInRect(point))
{
ClientToScreen(&point);
- CTitleMenu menuPopups;
+ CMenu menuPopups;
menuPopups.LoadMenu(IDR_POPUPS);
- CTitleMenu* pMenu = (CTitleMenu*)menuPopups.GetSubMenu(7);
+ CTitleMenu TitleMenu;
+ TitleMenu.Attach(menuPopups.GetSubMenu(7)->Detach());
int SXY, SZ;
lcGetActiveProject()->GetSnapIndex(&SXY, &SZ);
- pMenu->SetMenuTitle(ID_SNAP_XY, "XY Snap");
- pMenu->SetMenuTitle(ID_SNAP_Z, "Z Snap");
+ TitleMenu.SetMenuTitle(ID_SNAP_XY, "XY Snap");
+ TitleMenu.SetMenuTitle(ID_SNAP_Z, "Z Snap");
- pMenu->CheckMenuRadioItem(2, 11, SXY + 2, MF_BYPOSITION);
- pMenu->CheckMenuRadioItem(14, 23, SZ + 14, MF_BYPOSITION);
+ TitleMenu.CheckMenuRadioItem(2, 11, SXY + 2, MF_BYPOSITION);
+ TitleMenu.CheckMenuRadioItem(14, 23, SZ + 14, MF_BYPOSITION);
- pMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON, point.x, point.y, AfxGetMainWnd());
+ TitleMenu.TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON, point.x, point.y, AfxGetMainWnd());
}
CStatusBar::OnLButtonDown(nFlags, point);