From: Leon W. <moo...@us...> - 2004-12-02 18:39:50
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27247 Modified Files: OpenDocsListCtrl.cpp OpenDocsListCtrl.h Log Message: Added support for the Return and Delete key to respectivaly trigger a Show and Close event. Index: OpenDocsListCtrl.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/OpenDocsListCtrl.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OpenDocsListCtrl.h 12 Jul 2004 20:56:02 -0000 1.3 --- OpenDocsListCtrl.h 2 Dec 2004 18:39:40 -0000 1.4 *************** *** 64,67 **** --- 64,69 ---- // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(COpenDocsListCtrl) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); //}}AFX_VIRTUAL Index: OpenDocsListCtrl.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/OpenDocsListCtrl.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OpenDocsListCtrl.cpp 16 Sep 2004 23:12:37 -0000 1.4 --- OpenDocsListCtrl.cpp 2 Dec 2004 18:39:40 -0000 1.5 *************** *** 356,357 **** --- 356,374 ---- return NULL; } + + BOOL COpenDocsListCtrl::PreTranslateMessage(MSG* pMsg) + { + if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_DELETE) + { + // The delete key will trigger an close event. + OnOpendocsClose(); + return TRUE; + } + if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) + { + // The return key will trigger the show event. + OnOpendocsShow(); + return TRUE; + } + return CListCtrl::PreTranslateMessage(pMsg); + } |