Browse Source

forward delete key if selection is at the end of search box to delete the selected clip

scott brogden 8 years ago
parent
commit
6ebc8a3451
1 changed files with 21 additions and 1 deletions
  1. 21 1
      SymbolEdit.cpp

+ 21 - 1
SymbolEdit.cpp

@@ -4,6 +4,7 @@
 #include "stdafx.h"
 #include "SymbolEdit.h"
 #include "cp_main.h"
+#include "QListCtrl.h"
 
 // CSymbolEdit
 
@@ -116,6 +117,25 @@ BOOL CSymbolEdit::PreTranslateMessage(MSG* pMsg)
 				return TRUE;
 			}
 		}
+		else if (pMsg->wParam == VK_DELETE)
+		{
+			int startChar;
+			int endChar;
+			this->GetSel(startChar, endChar);
+			CString cs;
+			this->GetWindowText(cs);
+			//if selection is at the end then forward this on to the parent to delete the selected clip
+			if(startChar == cs.GetLength() &&
+				endChar == cs.GetLength())
+			{ 
+				CWnd *pWnd = GetParent();
+				if (pWnd)
+				{
+					pWnd->SendMessage(NM_DELETE, pMsg->wParam, pMsg->lParam);
+					return TRUE;
+				}
+			}
+		}
 		break;
 	}
 	}
@@ -457,4 +477,4 @@ void CSymbolEdit::OnMouseMove(UINT nFlags, CPoint point)
 	}
 
 	CEdit::OnMouseMove(nFlags, point);
-}
+}