GME  13
NameEdit.cpp
Go to the documentation of this file.
00001 // NameEdit.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "objectinspector.h"
00006 #include "InspectorDefs.h"
00007 #include "NameEdit.h"
00008 
00009 #ifdef _DEBUG
00010 #define new DEBUG_NEW
00011 #undef THIS_FILE
00012 static char THIS_FILE[] = __FILE__;
00013 #endif
00014 
00016 // CNameEdit
00017 
00018 CNameEdit::CNameEdit()
00019 {
00020 }
00021 
00022 CNameEdit::~CNameEdit()
00023 {
00024 }
00025 
00026 
00027 BEGIN_MESSAGE_MAP(CNameEdit, CEdit)
00028         //{{AFX_MSG_MAP(CNameEdit)
00029                 // NOTE - the ClassWizard will add and remove mapping macros here.
00030         //}}AFX_MSG_MAP
00031 END_MESSAGE_MAP()
00032 
00034 // CNameEdit message handlers
00035 
00036 LRESULT CNameEdit::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
00037 {
00038 
00039         if(message == WM_KEYDOWN)
00040         {
00041                 if(::IsWindowEnabled(GetSafeHwnd()))
00042                 {
00043                         switch(wParam)
00044                         {
00045                                 case VK_ESCAPE:
00046                                         {
00047                                                 GetParent()->SendMessage(MSG_NAME_EDIT_END_CANCEL);
00048                                                 GetParent()->SetFocus();                                        
00049                                         }break;
00050                                 case VK_RETURN:
00051                                         {
00052                                                 GetParent()->SendMessage(MSG_NAME_EDIT_END_OK);
00053                                                 GetParent()->SetFocus();
00054                                                 
00055                                         }break;
00056                                 default:
00057                                         ;
00058                         }       
00059                 }
00060         }       
00061         
00062         return CEdit::WindowProc(message, wParam, lParam);
00063 }
00064 
00065