summaryrefslogtreecommitdiff
path: root/win/Piecebar.cpp
diff options
context:
space:
mode:
authorleo2006-02-28 06:28:42 +0000
committerleo2006-02-28 06:28:42 +0000
commit5b9d0aeff33127ec7401791371d604341f7b00fd (patch)
tree3a666451638649cc480a965015278526d5511ee3 /win/Piecebar.cpp
parente97f6cc38e2acb596554c2714a68369df294e80f (diff)
Drag and drop new pieces from the category tree.
git-svn-id: http://svn.leocad.org/trunk@499 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win/Piecebar.cpp')
-rw-r--r--win/Piecebar.cpp16
1 files changed, 15 insertions, 1 deletions
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)