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

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


Zoom Control Combo

Andrew Kondrashow -- recoder@world.std.com
Tuesday, January 21, 1997

Environment: MSVC 4.1 Win95

I'm trying to reproduce a combo-box embedded into toolbar similar
to 'Zoom Control' in MS Word. I have a notification handler in my
view class and it's called fine. The problem is : I can't pass focus
back to the active view after user press 'Enter'. I belive that it's easy
task and there are samples of this. Can someone point me them ?
Thanks !

Andrew Kondrashov
recoder@world.std.com




Paul Martinsen -- pmartinsen@hort.cri.nz
Tuesday, January 28, 1997

[Mini-digest: 2 responses]

> Environment: MSVC 4.1 Win95
> 
> I'm trying to reproduce a combo-box embedded into toolbar similar
> to 'Zoom Control' in MS Word. I have a notification handler in my
> view class and it's called fine. The problem is : I can't pass focus
> back to the active view after user press 'Enter'. I belive that it's easy
> task and there are samples of this. Can someone point me them ?
> Thanks !
I'm working on a control similar to the multiple undo dropdowns in 
word, and had a similar problem: I have a object derived from a 
button which gets the focus. In OnSetFocus, I save the window handle 
of the window which last had focus, then when I'm finished with the 
drop down, I call ::SetFocus(m_hwndOldFocus);

Hope this is of some help,
Paul.
Paul Martinsen.
---------------------------------------------------------------
PhD Student.    p.martinsen@auckland.ac.nz
Deparment of Electrical and Electronic Engineering
University of Auckland.               Hort+Research
Private Bag                           Ruakura Research Centre
Auckland                              Hamilton.
New Zealand                           New Zealand.
---------------------------------------------------------------
-----From: Kostya Sebov 

>   Environment: MSVC 4.1 Win95
>
>   I'm trying to reproduce a combo-box embedded into toolbar similar
>   to 'Zoom Control' in MS Word. I have a notification handler in my
>   view class and it's called fine. The problem is : I can't pass focus
>   back to the active view after user press 'Enter'. I belive that it's easy
>   task and there are samples of this. Can someone point me them ?
>   Thanks !
>
>   Andrew Kondrashov
>   recoder@world.std.com
>
>

If the problem is only settign the focus, why don't you just call
CWnd::SetFocus from within your view's notification handler?

HTH,

--- 
Kostya Sebov. 
----------------------------------------------------------------------------
Tel: (38 044) 266-6387 | Fax: (38 044) 266-6195 | E-mail: sebov@is.kiev.ua



Dulepov Dmitry -- dima@ssm6000.samsung.ru
Monday, February 24, 1997

        [Mailer: "Groupware E-Mail". Version 1.03.000]

>        [From: Andrew Kondrashov
>
>I'm trying to reproduce a combo-box embedded into toolbar similar
>to 'Zoom Control' in MS Word. I have a notification handler in my
>view class and it's called fine. The problem is : I can't pass focus
>back to the active view after user press 'Enter'. I belive that it's easy
>task and there are samples of this. Can someone point me them ?
>Thanks !

Look at CBN_CLOSEUP description and add a handler to your view. Use SetFocus() to set the focus to your view.



Dmitry A. Dulepov
Samsung Electronics Co., Ltd.
Russian Research Center
Phone: +7 (095) 213-9207
Fax: +7 (095) 213-9196
E-mail: dima@src.samsung.ru
====================================





Become an MFC-L member | Вернуться в корень Архива |