1. Brian Marshall
  2. PowerBuilder
  3. Monday, 21 October 2024 13:49 PM UTC

PB 2022 R3

We replaced our menu with a ribbonbar control on the window.  When we disable a button it cannot be clicked, which is the behavior we want.  However, if there is a shortcut defined for the button, the ribbon bar on the first open window is controlling if the shortcut fires the event associated with the ribbon bar item on any other open window that the user is currently working with.

For example we have two windows open.  The first window opened has a RibbonLargeButtonItem with enabled=false.  The second window we opened has a ribbon bar with the same button with enabled = true.  Clicking the button on the first window does nothing, clicking the same button on the second window executes our code.  This works as expected.

In the same scenario when we are on either window the shortcut we have defined for the RibbonLargeButtonItem does not execute our code.  We can get the shortcut to work on the second window if we close the first window. When we get the parent window when using a shortcut, it returns the first window we opened.  When using clicking the button, the parent window is the window with the ribbon bar item they clicked.

Our expectation was that the shortcut would behave the same way as the user clicking the ribbon bar item.  

Any help would be appreciated.

 

 

Peter Pang @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 22 October 2024 03:13 AM UTC
  2. PowerBuilder
  3. # 1

Yes, Tomáš is right.

 

Hi Brian,

Thanks for reporting this problem to us.
We can reproduce this problem. It’s a known issue internally in Appeon and it’s because the operating system always triggers the first registered control when it encounters conflicting shortcuts among multiple controls. At present, the engineer has not found a good solution, we will inform you here timely if later they find one.

For the time being, you can use the following workarounds:
1. Register different shortcuts for different windows (seems like this doesn't fit your project).
2. Put the Ribbonbar control on the MDI window. Shortcuts respond to the current child window via user events. For the implementation, please refer to the Source button in the Example Graph App case that comes with PB, and the main code is in the ue_buttonclicked user event of the rbb_1 control in the w_mdi window object.


Best Regards,
Peter

Comment
There are no comments made yet.
Tomáš Podzimek Accepted Answer Pending Moderation
  1. Monday, 21 October 2024 17:37 PM UTC
  2. PowerBuilder
  3. # 2

Hi,

I ran into the same problem two years ago. The only good solution is to have one ribbon bar in an application (MDI frame) and switch the content according to the current window.

I tried to have one ribbon per form and it didn't work well.

There is still an open ticket for this problem (#9315, private), but I don't think it will be fixed.

Regards,

Tomáš

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.