summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo2001-02-22 02:16:38 +0000
committerleo2001-02-22 02:16:38 +0000
commitfa8c666962290365f5b29f8e84f86ab129255143 (patch)
tree7fc42a1f0090f40d6406cbfc29d2095b36e0d37d
parent1ed1d967b4973cf6c7b8eb6f0d160b2f6ddd713a (diff)
New shortcuts: Home/End keys will change the Pieces List selection
git-svn-id: http://svn.leocad.org/trunk@252 c7d43263-9d01-0410-8a33-9dba5d9f93d6
-rw-r--r--docs/CHANGES.txt4
-rw-r--r--win/Cadview.cpp28
-rw-r--r--win/Mainfrm.h14
-rw-r--r--win/Pieceprv.h4
4 files changed, 43 insertions, 7 deletions
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index 300dc5c..b111409 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -1,5 +1,9 @@
This is a changelog for developers only, not for ordinary users.
+21/02/2000
+ - New shortcuts: Home/End keys will change the Pieces List selection (win32).
+ - Fixed the creation and destruction of the MainWnd under win32.
+
19/02/2000
- The "Mouse moves in 3D" option now applies to rotations too.
diff --git a/win/Cadview.cpp b/win/Cadview.cpp
index 744f8ce..44b7e36 100644
--- a/win/Cadview.cpp
+++ b/win/Cadview.cpp
@@ -14,6 +14,8 @@
#include "system.h"
#include "camera.h"
#include "view.h"
+#include "MainFrm.h"
+#include "PiecePrv.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -926,6 +928,32 @@ void CCADView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
nKey = nChar - VK_NUMPAD0 + 0x30;
} break;
+
+ // select the next/previous piece on the pieces list
+ case VK_HOME:
+ case VK_END:
+ {
+ CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd ();
+ CPiecesList& pList = pMain->m_wndPiecesBar.m_wndPiecesList;
+ LV_FINDINFO lvfi;
+ int sel;
+
+ lvfi.flags = LVFI_PARAM;
+ lvfi.lParam = (LPARAM)pMain->m_wndPiecesBar.m_wndPiecePreview.GetPieceInfo ();
+ sel = pList.FindItem (&lvfi);
+
+ if (sel != -1)
+ {
+ if (nChar == VK_HOME)
+ sel--;
+ else
+ sel++;
+
+ pList.SetItemState (sel, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
+ pList.EnsureVisible (sel, FALSE);
+ }
+
+ } break;
}
project->OnKeyDown(nKey, GetKeyState (VK_CONTROL) < 0, GetKeyState (VK_SHIFT) < 0);
diff --git a/win/Mainfrm.h b/win/Mainfrm.h
index 8b54ab5..24d3319 100644
--- a/win/Mainfrm.h
+++ b/win/Mainfrm.h
@@ -47,12 +47,14 @@ public:
virtual void Dump(CDumpContext& dc) const;
#endif
-protected: // control bar embedded members
- CCADStatusBar m_wndStatusBar;
- CFlatToolBar m_wndStandardBar;
- CFlatToolBar m_wndToolsBar;
- CFlatToolBar m_wndAnimationBar;
- CPiecesBar m_wndPiecesBar;
+ // control bar embedded members
+ CCADStatusBar m_wndStatusBar;
+ CFlatToolBar m_wndStandardBar;
+ CFlatToolBar m_wndToolsBar;
+ CFlatToolBar m_wndAnimationBar;
+ CPiecesBar m_wndPiecesBar;
+
+protected:
CModifyDialog m_wndModifyDlg;
CBMPMenu m_bmpMenu;
diff --git a/win/Pieceprv.h b/win/Pieceprv.h
index 11d8312..6420a5f 100644
--- a/win/Pieceprv.h
+++ b/win/Pieceprv.h
@@ -21,7 +21,9 @@ public:
// Attributes
public:
BOOL m_bZoomPreview;
- void SetPieceInfo(PieceInfo* pInfo);
+ void SetPieceInfo (PieceInfo* pInfo);
+ PieceInfo* GetPieceInfo () const
+ { return m_pPieceInfo; }
// Operations
public: