EditMove.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // EditMove.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "BarCode.h"
  5. #include "EditMove.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // EditMove
  13. EditMove::EditMove()
  14. {
  15. }
  16. EditMove::~EditMove()
  17. {
  18. }
  19. BEGIN_MESSAGE_MAP(EditMove, CEdit)
  20. //{{AFX_MSG_MAP(EditMove)
  21. ON_WM_KEYDOWN()
  22. //}}AFX_MSG_MAP
  23. END_MESSAGE_MAP()
  24. /////////////////////////////////////////////////////////////////////////////
  25. // EditMove message handlers
  26. void EditMove::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
  27. {
  28. CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
  29. if((nChar==VK_LEFT)||(nChar==VK_RIGHT))
  30. {
  31. CWnd*pw=GetParent();
  32. if(nChar==VK_LEFT) pw->PostMessage(WM_USER,-1);
  33. if(nChar==VK_RIGHT) pw->PostMessage(WM_USER,+1);
  34. }
  35. else
  36. if((nChar==VK_UP)||(nChar==VK_DOWN))
  37. {
  38. CWnd*pw=GetParent();
  39. if(nChar==VK_UP) pw->PostMessage(WM_USER+1,-1);
  40. if(nChar==VK_DOWN) pw->PostMessage(WM_USER+1,+1);
  41. }
  42. }