1. Christopher Craft
  2. PowerBuilder
  3. Sunday, 31 January 2021 19:52 PM UTC

This seems really simple but I seem to be missing something - how do you sort the items in a RibbonMenu? I add items as windows are opening but I want them to be sorted by the Text when the user clicks the button.

Thanks,

Chris Craft

Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Monday, 1 February 2021 09:28 AM UTC
  2. PowerBuilder
  3. # 1

Hi Chris,

 

This feature is not supported at present.

Currently, the order of the RibbonMenu relates to the RibbonMenuItem index that is added to the RibbonMenu. You can refer to the documentation in the link below about the InsertItem, InsertItemFirst, InsertItemLast, SetItem of the RibbonMenu.

https://docs.appeon.com/pb2019r3/objects_and_controls/ch02s98.html 


You can also sort the text content in the RibbonMenuItem object via ASC code, and then implement this functionality via using SetMenu and GetMenu to reset the current RibbonMenu.

https://docs.appeon.com/pb2019r3/powerscript_reference/ch02s04s740.html 


BTW, I suggest you submit a ticket on our support ticketing system (https://www.appeon.com/standardsupport/newbug) so that we could better track and transfer it to the product team to handle this request. Thanks in advance.

 

Regards,

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 1 February 2021 07:28 AM UTC
  2. PowerBuilder
  3. # 2

If you are using the InsertItem() or InsertRecentItem() functions, these functions have an index parameter. The easiest way of accomplishing what you want, is to first check on the items that already show in the menu and then calculate the Index and use that in the function call to achieve the correct position.

controlname.InsertRecentItem ( Long Index, String Text, String Clicked )

 

Argument

Description

controlname

The name of the RibbonApplicationMenu control into which you want to insert a recent menu item.

Index

The index number of the recent menu item before which you are inserting a recent menu item. If index is invalid, an error would occur and this operation would return -1.

Text

The text that displays in the recent menu item.

Clicked

The name of the Clicked user event to be bound with the recent menu item. The Clicked user event for the recent menu item (RibbonMenuItem with "Recent(2)" type) must have two long parameters for receiving the handle of the application button and the index number of the recent menu item. For details, see Clicked in PowerScript Reference.

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.