From: Leon W. <moo...@us...> - 2004-12-02 18:40:41
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27534 Modified Files: OutputEdit.cpp Log Message: Added CTRL+A support to select all the text in the EditBox. Index: OutputEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/OutputEdit.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OutputEdit.cpp 28 Oct 2004 13:43:28 -0000 1.5 --- OutputEdit.cpp 2 Dec 2004 18:40:29 -0000 1.6 *************** *** 376,386 **** BOOL COutputEdit::PreTranslateMessage(MSG* pMsg) { ! // This is to prevent a common bug in MFC. ! // Pressing Escape in an ES_MULTILINE Edit Box causes a WM_CLOSE to ! // the parent window. That is not the desired behavior. ! // We pretend to have handled the message, so nothing happens ! // when the escape it pressed in our Edit control. ! if( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE ) return TRUE; return CEdit::PreTranslateMessage(pMsg); } --- 376,395 ---- BOOL COutputEdit::PreTranslateMessage(MSG* pMsg) { ! if( pMsg->message == WM_KEYDOWN ) ! { ! // Catching of the VK_ESCAPE is to prevent a common bug in MFC. ! // Pressing Escape in an ES_MULTILINE Edit Box causes a WM_CLOSE to ! // the parent window. That is not the desired behavior. ! // We pretend to have handled the message, so nothing happens ! // when the escape it pressed in our Edit control. ! if( VK_ESCAPE == pMsg->wParam ) return TRUE; + // If the user pressed CTRL+A, we select all the text in the edit box. + if( 'A' == pMsg->wParam && GetKeyState( VK_CONTROL ) ) + { + SetSel( 0, -1 ); + return TRUE; + } + } return CEdit::PreTranslateMessage(pMsg); } |