瀏覽代碼

ctrl-c/v/z/x/a work now in the search edit box

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@739 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 11 年之前
父節點
當前提交
d9891d799c
共有 1 個文件被更改,包括 23 次插入0 次删除
  1. 23 0
      EditWithButton.cpp

+ 23 - 0
EditWithButton.cpp

@@ -55,6 +55,29 @@ void CEditWithButton::PreSubclassWindow( )
 
 BOOL CEditWithButton::PreTranslateMessage( MSG* pMsg )
 {
+	// TODO: Add your specialized code here and/or call the base class
+	// Intercept Ctrl + Z (Undo), Ctrl + X (Cut), Ctrl + C (Copy), Ctrl + V (Paste) and Ctrl + A (Select All)
+	// before CEdit base class gets a hold of them.
+	if (pMsg->message == WM_KEYDOWN && ::GetKeyState(VK_CONTROL) < 0)
+		switch (pMsg->wParam)
+	{
+		case 'Z':
+			Undo();
+			return TRUE;
+		case 'X':
+			Cut();
+			return TRUE;
+		case 'C':
+			Copy();
+			return TRUE;
+		case 'V':
+			Paste();
+			return TRUE;
+		case 'A':
+			SetSel(0, -1);
+			return TRUE;
+	}
+
 	switch(pMsg->message) 
 	{
 	case WM_KEYDOWN: