From 3ca8b0bcc000c94da18af7bc1a408d4055662c1c Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 23 Sep 2005 21:14:12 +0000 Subject: Removed option to zoom the piece preview. git-svn-id: http://svn.leocad.org/trunk@420 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- win/Piecebar.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'win/Piecebar.cpp') diff --git a/win/Piecebar.cpp b/win/Piecebar.cpp index 21283c9..bbcc808 100644 --- a/win/Piecebar.cpp +++ b/win/Piecebar.cpp @@ -29,7 +29,6 @@ CPiecesBar::CPiecesBar() m_bGroups = (i & PIECEBAR_GROUP) != 0; m_bCombo = (i & PIECEBAR_COMBO) != 0; m_bNumbers = (i & PIECEBAR_PARTNUMBERS) != 0; - m_wndPiecePreview.m_bZoomPreview = (i & PIECEBAR_ZOOMPREVIEW) != 0; m_nCurGroup = 1; m_sizeMin = CSize(222, 200); @@ -916,8 +915,27 @@ void CPiecesBar::OnContextMenu(CWnd* pWnd, CPoint point) CMenu menuPopups; menuPopups.LoadMenu(IDR_POPUPS); CMenu* pMenu = menuPopups.GetSubMenu(0); + if (pMenu) + { + HTREEITEM Item = m_PiecesTree.GetSelectedItem(); + bool CategorySelected = false; + + if (Item != NULL) + { + PiecesLibrary *Lib = project->GetPiecesLibrary(); + CString CategoryName = m_PiecesTree.GetItemText(Item); + int CategoryIndex = Lib->FindCategoryIndex((const char*)CategoryName); + + if (CategoryIndex != -1) + CategorySelected = true; + } + + pMenu->EnableMenuItem(ID_PIECEBAR_REMOVECATEGORY, MF_BYCOMMAND | (CategorySelected ? MF_ENABLED : MF_GRAYED)); + pMenu->EnableMenuItem(ID_PIECEBAR_EDITCATEGORY, MF_BYCOMMAND | (CategorySelected ? MF_ENABLED : MF_GRAYED)); + pMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON, point.x, point.y, AfxGetMainWnd()); + } } } -- cgit v1.2.3