summaryrefslogtreecommitdiff
path: root/win/Piecebar.cpp
diff options
context:
space:
mode:
authorleo2005-09-23 21:14:12 +0000
committerleo2005-09-23 21:14:12 +0000
commit3ca8b0bcc000c94da18af7bc1a408d4055662c1c (patch)
treee25d3a925d264cb84b1f6dc9c9972ee54b1332b9 /win/Piecebar.cpp
parentd259a4634f874b2f54c9ffa4dc842a3b3db21ae1 (diff)
Removed option to zoom the piece preview.
git-svn-id: http://svn.leocad.org/trunk@420 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win/Piecebar.cpp')
-rw-r--r--win/Piecebar.cpp20
1 files changed, 19 insertions, 1 deletions
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());
+ }
}
}