1. Christopher Craft
  2. PowerBuilder
  3. Sunday, 21 February 2021 17:43 PM UTC

I am trying to simply add a Recent item to my application menu.  Following is my code but it doesn't work.

...

GetApplicationButton(lRBAppButton)
lRBAppButton.GetMenu(lRBAppMenu)
FOR llNdx = 1 TO llUpper
   lsText = lds.Object.Company_Name[llNdx]
   lRBAppMenu.InsertRecentItemLast(lsText, 'ue_recent')
NEXT

...

This is not populating my recent list.  The examples in PB are not very good.  They simply declare a local variable and call the function. Is that right? Seems like you would need to get the menu first?

Help:
Long ll_Return RibbonApplicationMenu lr_AppMenu ll_Return = lr_AppMenu.InsertRecentItemLast ("RecentItem1", "Ue_RecentItem1Clicked")


Thanks for any help,

Chris Craft

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

Hi Chris,

 

Yes, you need to set the menu and the button after you are done.

lRBAppButton.SetMenu(lRBAppMenu)

rbb_1.SetApplicationButton(lRBAppButton)

   

Note: The recent menu can have only one level; and can contain no more than 9 items.

You can refer to the following link for detail:

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

 

For the GetRecentItem method in the index parameter, it means the index of the recent menu item which you want to obtain. This value could be any value from 1 – 9. If you want to ignore this parameter,  we still haven't provided this functionality yet.

 

The description of GetRecentItem is: Gets the recent menu item of the application menu. Only apply to RibbonApplicationMenu controls.

The description of GetItem is: Gets an item according to its handle.

 

You can refer to the following link for detail. This method (GetItem) can apply to RibbonMenu controls (Syntax 4) as well as RibbonBar controls (Syntax 5).

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

 

Regards,

 

Comment
  1. Christopher Craft
  2. Monday, 22 February 2021 15:38 PM UTC
I guess I would have thought that since the recent items menu only exists on the application menu then any of those calls (Get, Set, Insert, etc) you would not need to get a pointer to it first. Just calling it on the RibbonBar control should do it. Not a big deal but it was just odd to me.



The 9 max is a bummer. I will log a request to have that changed.



Thank you Ken for your responses,

Chris Craft
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 22 February 2021 17:44 PM UTC
Hi Chris;

Thank you for your enhancement request on Ticket # 6123 to enlarge the Recent Menu Item larger than 9. I have now forwarded this over to Engineering.

Regards ... Chris
  1. Helpful
There are no comments made yet.
Christopher Craft Accepted Answer Pending Moderation
  1. Sunday, 21 February 2021 18:26 PM UTC
  2. PowerBuilder
  3. # 1

Couple more questions though.  I would think if you have a GetRecentItem() function then you would not need to get a pointer to the Menu - There is only 1 Recent menu so why would I need that?

GetApplicationButton(lRBAppButton)
lRBAppButton.GetMenu(lRBAppMenu)
lRBAppMenu.GetRecentItem(al_Index, lRBMenuItem)

Also, when adding the recent item the event that fires has 2 arguments - handle and index.  Shouldn't the handle be the Application Menu since that is the only place it exists?  Just trying to understand the difference between GetRecentItem and GetItem. 

Thanks again,

Chris Craft

Comment
There are no comments made yet.
Christopher Craft Accepted Answer Pending Moderation
  1. Sunday, 21 February 2021 17:49 PM UTC
  2. PowerBuilder
  3. # 2

Well, I just figured it out.  You need to set the menu and the button after you are done.

...

lRBAppButton.SetMenu(lRBAppMenu)
SetApplicationButton(lRBAppButton)

 

Seems like Help should have all those statements.  Oh well.

Chris Craft

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.