Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Removing Toolbar button focus
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Removing Toolbar button focus

 Post Reply Post Reply
Author
Message
g_j_a_i_n View Drop Down
Groupie
Groupie
Avatar

Joined: 27 August 2005
Status: Offline
Points: 94
Post Options Post Options   Thanks (0) Thanks(0)   Quote g_j_a_i_n Quote  Post ReplyReply Direct Link To This Post Topic: Removing Toolbar button focus
    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


 
2005-09-07_030032_ToolbarButtons.zip
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
g_j_a_i_n View Drop Down
Groupie
Groupie
Avatar

Joined: 27 August 2005
Status: Offline
Points: 94
Post Options Post Options   Thanks (0) Thanks(0)   Quote g_j_a_i_n Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
g_j_a_i_n View Drop Down
Groupie
Groupie
Avatar

Joined: 27 August 2005
Status: Offline
Points: 94
Post Options Post Options   Thanks (0) Thanks(0)   Quote g_j_a_i_n Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.