1. Mark Winsor
  2. PowerBuilder
  3. Thursday, 4 March 2021 18:57 PM UTC

It appears that you can set the visible property of a ribbon bar category item but it seems to have no effect. It stays visible. I tried this. I tried it from the open event of the frame and I tried to post to a user event after the open. It stays visible. I could delete and insert but then I would have to recreate all of the pieces in the category. Surely I'm doing something wrong. Anyone have any ideas?

 

RibbonCategoryItem lr_Category
rbb_1.GetItemByTag ("CategoryOrderTest", ref lr_Category)
lr_Category.visible = false

Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Friday, 5 March 2021 05:14 AM UTC
  2. PowerBuilder
  3. # 1

Hi Mark,

Arthur is right.

You need to reset the object to the Ribbonbar control. You can refer to the code below:

 

RibbonCategoryItem lr_Category

rbb_1.GetItemByTag ("CategoryOrderTest", lr_Category)

lr_Category.visible = false

rbb_1.setcategory(lr_Category.itemhandle , lr_Category)

 

Following are the related documents for your references.

https://docs.appeon.com/pb2019r3/pbug/ch04s04.html#Accessing_the_ribbon_items_in_the_hierarchy 

The RibbonBar control is a container. The RibbonBar control, as well as the item controls it contains, have a hierarchical relationship. The item controls cannot exist independently and must be placed on top of the parent object; therefore, to get an item control, you need to search from the top level (RibbonBar control), or to search by tag. The control you get is a copy (not a reference), and after the copy is modified, it needs to be set back to the parent object, and then to the RibbonBar control, for the change to take effect.

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

 

Regards,

Comment
  1. Ravi Kumar
  2. Monday, 21 November 2022 14:20 PM UTC
This logic working for me, Thank you @Mark Lee
  1. Helpful
There are no comments made yet.
Arthur Hefti Accepted Answer Pending Moderation
  1. Friday, 5 March 2021 04:33 AM UTC
  2. PowerBuilder
  3. # 2

Hi 

you have to set it as well.

RibbonCategoryItem lr_Category
rbb_1.GetItemByTag ("CategoryOrderTest", ref lr_Category)
lr_Category.visible = false

rbb_1.SetItem( lr_Category )

Regards
Arthur

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.