1. Miller Rhodes
  2. PowerBuilder
  3. Wednesday, 10 May 2023 20:16 PM UTC

I have added my own RibbonBar to an MDI frame-based application.  However, I do not understand how the 'recent items' area gets populated in the ApplicationMenu area of the RibbonBar.  What I'm looking for would be analogous to what happens as you open multiple sheets and it creates a list of the open windows n the standard pfc menu under the 2nd option from the right ( which is usually the 'Window' option.

The picture below is from the Powerbuilder 2022 help just as an example of what I'd like to see happen.

 

 

I do not understand what mechanism populates the Recent Items and wondered if I am missing some code.

My real question is: Where do I look for the solution to this or how can I debug it?

 

Peter Pang @Appeon Accepted Answer Pending Moderation
  1. Thursday, 11 May 2023 03:16 AM UTC
  2. PowerBuilder
  3. # 1

Hi Miller,

 

The RibbonBar’s Recent Items need to be implemented with your own code. It only shows up when the Recent Title is set and it only shows the 9 latest items.

In the following example, we set the recent title and then add a Recentitem1. Ue_recentmenuclicked is an event on rbb_1.

RibbonApplicationButtonItem lr_AppButton
RibbonApplicationMenu lr_appMenu

If rbb_1.GetApplicationButton( lr_AppButton ) = 1 Then
         If lr_AppButton.GetMenu( lr_appMenu ) = 1 Then
                   lr_AppMenu.SetRecentTitle ( "Recently Opened Windows" )
                   lr_AppMenu.InsertRecentItemFirst ( "RecentItem1", "ue_recentmenuclicked" ) 
         End If
         lr_AppButton.SetMenu( lr_AppMenu )
         Rbb_1.SetApplicationbutton( lr_AppButton )
End If

 

//Ue_RecentMenuClicked user event must have two Long parameters for receiving the
//handle of Application Button and the index number of Recent Menu.
//Each MenuItem can bind with different events or the same event.

//In the following example, the same event is bound to get RibbonApplicationMenu.
event type long ue_recentmenuclicked(long itemhandle, long index);
Integer li_Return
RibbonApplicationMenu lr_Menu
RibbonMenuItem lr_MenuItem

li_Return = rbb_1.GetMenuByButtonHandle(ItemHandle,lr_Menu)
If li_Return = 1 Then
li_Return = lr_Menu.GetRecentItem(Index,lr_MenuItem)
//...
Else
Return 0
End If

Return 1
end event

 

Best Regards,

Peter

 

Comment
  1. Miller Rhodes
  2. Saturday, 20 May 2023 23:11 PM UTC
Thanks for the help! I am trying this now
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 10 May 2023 22:22 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Miller - 

Look at the PB Help topics named "RibbonApplicationMenu control" and "RibbonApplicationButtonItem control".

Best regards, John

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.