summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo2005-09-23 21:14:12 +0000
committerleo2005-09-23 21:14:12 +0000
commit3ca8b0bcc000c94da18af7bc1a408d4055662c1c (patch)
treee25d3a925d264cb84b1f6dc9c9972ee54b1332b9
parentd259a4634f874b2f54c9ffa4dc842a3b3db21ae1 (diff)
Removed option to zoom the piece preview.
git-svn-id: http://svn.leocad.org/trunk@420 c7d43263-9d01-0410-8a33-9dba5d9f93d6
-rw-r--r--win/LeoCAD.rc9
-rw-r--r--win/Mainfrm.cpp20
-rw-r--r--win/Piecebar.cpp20
-rw-r--r--win/Pieceprv.cpp6
-rw-r--r--win/Pieceprv.h1
-rw-r--r--win/resource.h6
6 files changed, 34 insertions, 28 deletions
diff --git a/win/LeoCAD.rc b/win/LeoCAD.rc
index 6251874..505e86f 100644
--- a/win/LeoCAD.rc
+++ b/win/LeoCAD.rc
@@ -363,8 +363,11 @@ IDR_POPUPS MENU DISCARDABLE
BEGIN
POPUP "0"
BEGIN
+ MENUITEM "New Category...", ID_PIECEBAR_NEWCATEGORY
+ MENUITEM "Remove Category", ID_PIECEBAR_REMOVECATEGORY
+ MENUITEM "Edit Category...", ID_PIECEBAR_EDITCATEGORY
+ MENUITEM SEPARATOR
MENUITEM "Preview Pieces", ID_PIECEBAR_PREVIEW
- MENUITEM "Zoom Preview", ID_PIECEBAR_ZOOMPREVIEW
MENUITEM "Group Pieces", ID_PIECEBAR_GROUP
MENUITEM "Show ComboBox", ID_PIECEBAR_COMBOBOX
MENUITEM "Show Numbers", ID_PIECEBAR_NUMBERS
@@ -2044,6 +2047,7 @@ END
STRINGTABLE DISCARDABLE
BEGIN
+ ID_ACTION_PAN "Pan\nPan"
ID_ACTION_ROTATE_VIEW "Rotate view\nRotate View"
ID_ACTION_ROLL "Roll view\nRoll"
ID_ZOOM_EXTENTS "Zoom extents (hold CTRL to zoom all views)\nZoom Extents"
@@ -2054,6 +2058,7 @@ END
STRINGTABLE DISCARDABLE
BEGIN
ID_ACTION_SELECT "Select objects with the mouse\nSelect"
+ ID_ACTION_SELECT_REGION "Select objects with the mouse\nSelect Region"
ID_ACTION_INSERT "Add pieces to the project\nInsert"
ID_ACTION_LIGHT "Add a positional light source\nPositional Light"
ID_ACTION_SPOTLIGHT "Add a spotlight\nSpotlight"
@@ -2064,7 +2069,6 @@ BEGIN
ID_ACTION_PAINT "Change piece color\nPaint"
ID_ACTION_ZOOM "Zoom in or out\nZoom"
ID_ACTION_ZOOM_REGION "Zoom region\nZoom Region"
- ID_ACTION_PAN "Pan\nPan"
END
STRINGTABLE DISCARDABLE
@@ -2119,7 +2123,6 @@ STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_IMPORTPIECE "Import a piece from LDraw"
ID_VIEW_NEWVIEW "Creates a new view window"
- ID_ACTION_SELECT_REGION "Select objects with the mouse\nSelect Region"
END
#endif // English (U.S.) resources
diff --git a/win/Mainfrm.cpp b/win/Mainfrm.cpp
index 195ad92..3475b07 100644
--- a/win/Mainfrm.cpp
+++ b/win/Mainfrm.cpp
@@ -110,8 +110,8 @@ BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_MESSAGE(WM_SETMESSAGESTRING, OnSetMessageString)
ON_WM_DROPFILES()
//}}AFX_MSG_MAP
- ON_COMMAND_RANGE(ID_PIECEBAR_ZOOMPREVIEW, ID_PIECEBAR_SUBPARTS, OnPieceBar)
- ON_UPDATE_COMMAND_UI_RANGE(ID_PIECEBAR_ZOOMPREVIEW, ID_PIECEBAR_SUBPARTS, OnUpdatePieceBar)
+ ON_COMMAND_RANGE(ID_PIECEBAR_GROUP, ID_PIECEBAR_SUBPARTS, OnPieceBar)
+ ON_UPDATE_COMMAND_UI_RANGE(ID_PIECEBAR_GROUP, ID_PIECEBAR_SUBPARTS, OnUpdatePieceBar)
// Global help commands
ON_COMMAND(ID_HELP_FINDER, CFrameWnd::OnHelpFinder)
ON_COMMAND(ID_HELP, CFrameWnd::OnHelp)
@@ -479,7 +479,6 @@ LONG CMainFrame::UpdateSettings(UINT /*lParam*/, LONG /*wParam*/)
m_wndPiecesBar.m_bGroups = (i & PIECEBAR_GROUP) != 0;
m_wndPiecesBar.m_bCombo = (i & PIECEBAR_COMBO) != 0;
m_wndPiecesBar.m_bNumbers = (i & PIECEBAR_PARTNUMBERS) != 0;
- m_wndPiecesBar.m_wndPiecePreview.m_bZoomPreview = (i & PIECEBAR_ZOOMPREVIEW) != 0;
RECT rc;
m_wndPiecesBar.GetClientRect(&rc);
@@ -542,11 +541,6 @@ void CMainFrame::OnPieceBar(UINT nID)
{
switch (nID)
{
- case ID_PIECEBAR_ZOOMPREVIEW:
- {
- m_wndPiecesBar.m_wndPiecePreview.m_bZoomPreview = !m_wndPiecesBar.m_wndPiecePreview.m_bZoomPreview;
- m_wndPiecesBar.m_wndPiecePreview.PostMessage(WM_PAINT);
- } break;
case ID_PIECEBAR_GROUP:
{
m_wndPiecesBar.m_bGroups = !m_wndPiecesBar.m_bGroups;
@@ -571,7 +565,7 @@ void CMainFrame::OnPieceBar(UINT nID)
} break;
}
- if ((nID != ID_PIECEBAR_ZOOMPREVIEW) && (nID != ID_PIECEBAR_SUBPARTS))
+ if (nID != ID_PIECEBAR_SUBPARTS)
{
RECT rc;
m_wndPiecesBar.GetClientRect(&rc);
@@ -587,7 +581,6 @@ void CMainFrame::OnPieceBar(UINT nID)
if (m_wndPiecesBar.m_bGroups) u |= PIECEBAR_GROUP;
if (m_wndPiecesBar.m_bCombo) u |= PIECEBAR_COMBO;
if (m_wndPiecesBar.m_bNumbers) u |= PIECEBAR_PARTNUMBERS;
- if (m_wndPiecesBar.m_wndPiecePreview.m_bZoomPreview) u |= PIECEBAR_ZOOMPREVIEW;
theApp.WriteProfileInt("Settings", "Piecebar Options", u);
}
@@ -595,13 +588,6 @@ void CMainFrame::OnUpdatePieceBar(CCmdUI* pCmdUI)
{
switch (pCmdUI->m_nID)
{
- case ID_PIECEBAR_ZOOMPREVIEW:
- {
- if (m_wndPiecesBar.m_bPreview)
- pCmdUI->SetCheck(m_wndPiecesBar.m_wndPiecePreview.m_bZoomPreview);
- else
- pCmdUI->Enable(FALSE);
- } break;
case ID_PIECEBAR_GROUP:
pCmdUI->SetCheck(m_wndPiecesBar.m_bGroups); break;
case ID_PIECEBAR_PREVIEW:
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());
+ }
}
}
diff --git a/win/Pieceprv.cpp b/win/Pieceprv.cpp
index 5cd68ca..707edc3 100644
--- a/win/Pieceprv.cpp
+++ b/win/Pieceprv.cpp
@@ -83,10 +83,8 @@ void CPiecePreview::OnPaint()
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- if (m_bZoomPreview)
- m_pPieceInfo->ZoomExtents(30.0f, (float)aspect);
- else
- gluLookAt (-5, -5, 4, 0, 0, 0, 0, 0, 1);
+ gluLookAt (-5, -5, 4, 0, 0, 0, 0, 0, 1);
+ m_pPieceInfo->ZoomExtents(30.0f, (float)aspect);
float pos[4] = { 0, 0, 10, 0 }, *bg = project->GetBackgroundColor();
glLightfv(GL_LIGHT0, GL_POSITION, pos);
diff --git a/win/Pieceprv.h b/win/Pieceprv.h
index 6420a5f..de003be 100644
--- a/win/Pieceprv.h
+++ b/win/Pieceprv.h
@@ -20,7 +20,6 @@ public:
// Attributes
public:
- BOOL m_bZoomPreview;
void SetPieceInfo (PieceInfo* pInfo);
PieceInfo* GetPieceInfo () const
{ return m_pPieceInfo; }
diff --git a/win/resource.h b/win/resource.h
index ebf83ec..6104707 100644
--- a/win/resource.h
+++ b/win/resource.h
@@ -495,7 +495,6 @@
#define ID_FILE_EXPORT_WAVEFRONT 32833
#define ID_FILE_EXPORT_LDRAW 32834
#define ID_FILE_EXPORT_POVRAY 32835
-#define ID_PIECEBAR_ZOOMPREVIEW 32836
#define ID_PIECEBAR_GROUP 32837
#define ID_PIECEBAR_PREVIEW 32838
#define ID_PIECEBAR_NUMBERS 32839
@@ -671,6 +670,9 @@
#define ID_VIEW_NEWVIEW 33153
#define ID_VIEW_STEP_DELETE 33154
#define ID_LIBDLG_FILE_TEXTURES 33157
+#define ID_PIECEBAR_NEWCATEGORY 33159
+#define ID_PIECEBAR_EDITCATEGORY 33160
+#define ID_PIECEBAR_REMOVECATEGORY 33161
#define ID_VIEW_PIECES_BAR 59425
#define ID_VIEW_TOOLS_BAR 59426
#define ID_VIEW_ANIMATION_BAR 59427
@@ -682,7 +684,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 238
-#define _APS_NEXT_COMMAND_VALUE 33159
+#define _APS_NEXT_COMMAND_VALUE 33162
#define _APS_NEXT_CONTROL_VALUE 1247
#define _APS_NEXT_SYMED_VALUE 121
#endif