Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtControlBar Bug ? Collapse All
Subject Author Date
tera tera May 1, 2009 - 4:18 AM


There is time when a focus is not set by child control even if I click CExtControlBar.

When I clicked non-client areas of Bar.

void CLogCtrl::OnSetFocus(CWnd* pOldWnd) {  CRichEditCtrl::OnSetFocus(pOldWnd); }


Please revise it.  


Technical Support May 2, 2009 - 12:40 PM

We tried to reproduce this but the rich editor receives the focus gain event. Please provide us with more details about what exactly we should do to reproduce this?

tera tera May 2, 2009 - 4:56 PM


caption of the docking bar of the non-focus,

Do not click it.

You drag it.

Then a focus is not transmitted

This reproduces even control except richEdit.


I am troubled. 

If you do not understand it, please ask me a question again.

Technical Support May 3, 2009 - 2:22 PM

Yes you are right. The caption of a control bar indicates the active state of the bar. If the bar is active, then the user performs or has finished some action with the bar. The active bar state does not always mean focusing of its child window. The CExtControlBar::IsBarWindowActive() method returns theactive state of the control bar. The active state is a property which is supported independently of the focused state of the bar’s child window.

tera tera May 3, 2009 - 6:08 PM


In CExtControlBar, I stick CView.

However, a focus is not set in drag.

The input of the key does not come in CView even if I perform key input for CView because a focus is not set.

I am troubled.

Please teach a good method.


Technical Support May 4, 2009 - 11:33 AM

Yes, you are absolutely right. Please let us explain you the following two situations:

Situation 1: User just clicks on the caption of the CExtControlBar window. As result, the bar becomes active, its caption is highlighted as active and its child window becomes focused. That is what the user expects from click on the bar’s caption.

Situation 2: User changes location of the CExtControlBar window via drag-n-dropping its caption. As result, the bar is activated, it’s caption is highlighted but it’s child window does not become focused because drag-n-dropping is not the same as click on bar’s caption. The bar drag-n-dropping and resizing are needed to change layout of control bar windows. These actions may be needed to make the view window larger or smaller. But these actions are not for focusing bar’s child window.

The CExtControlBar::_Dragging_OnStop() internal virtual method is invoked when the bar drag-n-dropping is complete. You can override this method and set the focus to the bar window and it will focus its child window automatically