15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Accelerators kill tree label edit

Jim Barry -- Jim.Barry@ilp.com
Tuesday, October 22, 1996


Environment: VC++ 4.1, Win32s/Win95

Hi folks,

Just noticed a problem with accelerators and tree control label editing.   
If you have the usual cut/copy/paste/undo accelerators then MFC routes   
these to the active view, even if the view is a CTreeView in label edit   
mode. This means that the label edit does not receive the standard   
cut/paste keystrokes. For now, I have just removed the appropriate   
accelerators, but this is hardly ideal. Is there a better solution,   
perhaps along the lines of creating a CWnd object for the label edit box   
with an overriden PreTranslateMessage? Has anybody tried this? Is MFC   
likely to correct this problem in the future?

Cheers,

Jim Barry
Interactive Leaning Productions
Newcastle upon Tyne, UK
http://www.ilp.com  



Roger Onslow/Newcastle/Computer Systems Australia/
Wednesday, October 23, 1996

>Just noticed a problem with accelerators and tree control label editing.   
>If you have the usual cut/copy/paste/undo accelerators then MFC routes   
>these to the active view, even if the view is a CTreeView in label edit   
>mode. This means that the label edit does not receive the standard   
>cut/paste keystrokes. For now, I have just removed the appropriate   
>accelerators, but this is hardly ideal. Is there a better solution,   
>perhaps along the lines of creating a CWnd object for the label edit box   
>with an overriden PreTranslateMessage? Has anybody tried this? Is MFC   
>likely to correct this problem in the future?

This is a well know problem (eg. if you put an edit control on a view or 
toolbar) and solutions are documented in MSDN (and probably in VC KB -- I'd 
need to check where and let you know).

There are various solutions, some involving making changes to 
PreTranslateMessage, or in the actual handlers for OnEditCut etc.

I cannot look up exact articles/references at the moment, but eMail me if you 
cannot find appropricat articles.

Roger




| Вернуться в корень Архива |