Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Hot key handling fails in view when using a Ribbon
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Hot key handling fails in view when using a Ribbon

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

Joined: 28 October 2004
Location: The Netherlands
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote Insad Quote  Post ReplyReply Direct Link To This Post Topic: Hot key handling fails in view when using a Ribbon
    Posted: 06 April 2017 at 10:18am
The following was created as a support ticket on March 22, 2017.
Until now, even after sending some mail to support@codejock.com, nobody at CodeJock support seemed to bother to look at the ticket (Issue# 35721) or even answer my email.
Therefor I submit the same here, hoping to get an answer within the two weeks I'm already waiting..

Take the sample from the TKP: Samples\Ribbon\RibbonMDISample
Replace the CRichEditView with a CXTResizeFormView and put two buttons on that view.
Button 1 has the caption '&File button' and button 2 has the caption '&Weird or what'.
Add a button click handler to both buttons and just show a messagebox in the handler.

Now when run the application and set the focus to the view (check by using the tab key to see that one of the buttons has the focus).
Now press Alt-W and notice that the handler for button 2 is executed.
When pressing Alt-F the expected result would be that the handler for button 1 is executed.
Instead of that, the ribbonbar selects the File menu.

This means that the ribbonbar gets the preference over the active view! Which, TMHO, is a bug :(

In our application the problem is even worse because the view runs on another thread an in that case both handlers are executed: First the ribbonbar, which sets the thread state to the ribbonbar, and then the one in my view. This is a road to disaster because the thread state is not reset, meaning that the event-handler for the view is executed in the wrong thread state!

Can you please advise on how to fix this as soon as possible. When the sample works I think I can get it to work in our application as well, but the default behavior is already wrong..

Some more info on how I have tested the issue:
TKP versions tested: 16.4.0, 17.2.0 and 17.3.0 (all reproduce the issue)
VC versions tested: VS2013 and VS2015
Tested TKP as DLL and statically linked, NON-unicode

Products in use: XTP version 13.4.2/15.3.1/16.4.0/17.3.0
Platforms: Win2003(R2)/Win2008(R2)/Win7/Win2011/Win8(.1)/Win2012(R2)/Win10 (x86/x64)
Langs: VC++ (MFC) 6/2005/2008/2013/2015/2017
Back to Top
BobC View Drop Down
Groupie
Groupie


Joined: 28 April 2017
Location: Longmont, CO
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote BobC Quote  Post ReplyReply Direct Link To This Post Posted: 28 April 2017 at 6:25pm
Not sure I would classify this as a bug in Codejock since Alt-F is a pre-defined hotkey in Windows.

Since CXTPResizeFormView is derived from CView, I can think of two approaches that might solve your problem: 1) derive your own class from CXTPResizeFormView and override PreTranslateMessage, or  2) derive and add an OnChildNotify handler.
Back to Top
Insad View Drop Down
Groupie
Groupie
Avatar

Joined: 28 October 2004
Location: The Netherlands
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote Insad Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2017 at 10:39am
Still no response Cry

I know you guys are busy with the v18 of TKP, but can someone please be so kind to respond to a ticket created on March 22..

That's more than 2 months without anyone from support watching?

Best regards,

Insad

Products in use: XTP version 13.4.2/15.3.1/16.4.0/17.3.0
Platforms: Win2003(R2)/Win2008(R2)/Win7/Win2011/Win8(.1)/Win2012(R2)/Win10 (x86/x64)
Langs: VC++ (MFC) 6/2005/2008/2013/2015/2017
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.219 seconds.