From 5b9d0aeff33127ec7401791371d604341f7b00fd Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 28 Feb 2006 06:28:42 +0000 Subject: Drag and drop new pieces from the category tree. git-svn-id: http://svn.leocad.org/trunk@499 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- win/Piecebar.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'win/Piecebar.cpp') diff --git a/win/Piecebar.cpp b/win/Piecebar.cpp index 0a0c0f1..bd1734a 100644 --- a/win/Piecebar.cpp +++ b/win/Piecebar.cpp @@ -684,7 +684,7 @@ int CPiecesBar::OnCreate(LPCREATESTRUCT lpCreateStruct) if (CControlBar::OnCreate(lpCreateStruct) == -1) return -1; - m_PiecesTree.Create(WS_VISIBLE|WS_TABSTOP|WS_BORDER|TVS_SHOWSELALWAYS|TVS_HASBUTTONS|TVS_DISABLEDRAGDROP|TVS_HASLINES|TVS_LINESATROOT, + m_PiecesTree.Create(WS_VISIBLE|WS_TABSTOP|WS_BORDER|TVS_SHOWSELALWAYS|TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT, CRect(0,0,0,0), this, IDW_PIECESTREE); m_wndColorsList.Create(LBS_MULTICOLUMN|LBS_NOINTEGRALHEIGHT|LBS_NOTIFY| @@ -1012,6 +1012,20 @@ BOOL CPiecesBar::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) m_wndPiecePreview.PostMessage(WM_PAINT); } } + else if (Notify->hdr.code == TVN_BEGINDRAG) + { + PieceInfo* Info = (PieceInfo*)Notify->itemNew.lParam; + + if (Info != NULL) + { + lcGetActiveProject()->BeginPieceDrop(Info); + + // Force a cursor update. + CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd(); + CView* pView = pFrame->GetActiveView(); + pView->PostMessage(WM_LC_SET_CURSOR, 0, 0); + } + } else if (Notify->hdr.code == TVN_ITEMEXPANDING) { if (Notify->action == TVE_EXPAND) -- cgit v1.2.3