home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / appwiz / hierwiz / usreditc.cpp < prev    next >
C/C++ Source or Header  |  1998-03-05  |  1KB  |  56 lines

  1. // usreditc.cpp : implementation file
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and Microsoft
  9. // QuickHelp and/or WinHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "hierwiz.h"
  15. #include "UsrEditC.h"
  16.  
  17. #ifdef _DEBUG
  18. #undef THIS_FILE
  19. static char BASED_CODE THIS_FILE[] = __FILE__;
  20. #endif
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CUsrEditClass
  24.  
  25. CUsrEditClass::CUsrEditClass()
  26. {
  27. }
  28.  
  29. CUsrEditClass::~CUsrEditClass()
  30. {
  31. }
  32.  
  33.  
  34. BEGIN_MESSAGE_MAP(CUsrEditClass, CEdit)
  35.     //{{AFX_MSG_MAP(CUsrEditClass)
  36.     ON_WM_KEYDOWN()
  37.     //}}AFX_MSG_MAP
  38. END_MESSAGE_MAP()
  39.  
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CUsrEditClass message handlers
  43.  
  44. void CUsrEditClass::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
  45. {
  46. // We need to trap the tab key and replace it with the tab character because otherwise Windows
  47. // assumes that we are tabbing from the edit control to the next one in the tabbing order.
  48.     if (VK_TAB == nChar )
  49.     {
  50.         ReplaceSel("\t") ;
  51.         return ;
  52.     }
  53.  
  54.     CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
  55. }
  56.