Print Page | Close Window

Removing Toolbar button focus

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2852
Printed Date: 08 November 2025 at 9:48pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Removing Toolbar button focus
Posted By: g_j_a_i_n
Subject: Removing Toolbar button focus
Date Posted: 07 September 2005 at 3:00am

Hello,

I have an application where each toolbar button shows a menu.

When i click on each button consecutively, the buttons do not lose focus. It remains highlighted (orange color)

See the attached image.

Please let me know how the focus can be removed when the user moves from one button to another.

Another related problem is that if a dialog is shown on clicking the toolbar button, the focus is not gone until the dialog box is closed.

Please let me know the solution for this problem.

Regards,
Gautam Jain


 
uploads/gjain/2005-09-07_030032_ToolbarButtons.zip - 2005-09-07_030032_ToolbarButtons.zip



Replies:
Posted By: Oleg
Date Posted: 08 September 2005 at 3:51am

As you can see DialogSample code, you must add

ON_MESSAGE(WM_KICKIDLE, OnKickIdle)

LRESULT CDialogSampleDlg::OnKickIdle(WPARAM, LPARAM)
{
 m_wndToolBar.SendMessage(WM_IDLEUPDATECMDUI, TRUE);
 return 0;
}

 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: g_j_a_i_n
Date Posted: 08 September 2005 at 4:24am


Oleg,

I tried what you suggested, but it did not work.

Mine is a MainFrame, so WM_KICKIDLE is not kicked by default. So I used SendMessage in my CWinApp::OnIdle function to send WM_KICKIDLE message

Still the toolbar button remains focused.

In my first post I attached a GIF file. Please have a look at it.

It is very urgent.

Regards,
Gautam Jain


Posted By: Oleg
Date Posted: 08 September 2005 at 6:37am

This sceenshot give m nothing, I need project to see what you do, to debug/test.

Create new simple application, copy logic from your one and attach here.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: g_j_a_i_n
Date Posted: 08 September 2005 at 11:39pm


Oleg. I fixed the problem by calling pControl->SetPressed(FALSE) immediately after TrackPopupMenu.

So once the menu is closed, the button (pControl) is set back to normal state.

Thanks for your care.

Regards,
Gautam Jain




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net