1. Apoorva JUKANTI
  2. PowerBuilder
  3. Thursday, 2 November 2023 07:39 AM UTC

Planning to implement a new Ribbon bar in the application, 

1. What is the optimised way to implement a ribbon bar? Is it using the XML or Power script?

2. Is it possible to switch between the old menu and the new ribbon bar by clicking on a button?

 

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 2 November 2023 12:06 PM UTC
  2. PowerBuilder
  3. # 1

Hi Andreas;

 For a RB vs Menu app - I would have two MDI frame windows. One with a menu and the other with an RB. Then at runtime, open the corresponding frame windows with the feature your app user wants to see.

  For the menu at runtime, you can use the ChangeMenu() command to switch between a null menu object vs one that has menu items. Thus, achieving the hide & show effect. Combining the RB visible / non-visible code with the ChangeMenu command - you could achieve a dynamic switching effect.

Food for thought. ;-)

Regards... Chris 

Comment
  1. Andreas Mykonios
  2. Thursday, 2 November 2023 12:20 PM UTC
Hi Chris.

You are right. Never had tested with an empty menu. It works.

Andreas.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 2 November 2023 12:42 PM UTC
Excellent! :-)
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 2 November 2023 07:53 AM UTC
  2. PowerBuilder
  3. # 2

Hi.

For (2) take a look at the following contribution: RibbonBar Menu Generator - Appeon Community. This will help you to convert a traditional menu to an xml for ribbonbar control.

You cannot switch, as ribbonbar is a control positioned on a window. You can hide by make it invisible. This will leave a space on that window! You will have to "rearrange" controls on your window! Also you might be aware that a window may have both a menu and a ribbonbar control. While you can hide the ribbonbar control, menu cannot be removed. So switching while an application is running may be a difficult task. If you want an option that will take effect after you restart your application, this can be easily achieved (you can do that using inheritance and controlling an option to decide which window to open).

There is no "official" way to achieve that right now. It's on the roadmap for Powerbuilder 2025. But we don't know how it will work.

For (1), this should be what you prefer. If you want to use the designer then you should use xml. But you can export it as json! The ribbonbar control can load xml and json. If you need to alter the ribbonbar while your application is running, you should use the markup language (json or xml) that you are more familiar with.

Andreas.

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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.