1. Thierry Garrigues
  2. PowerBuilder
  3. Thursday, 9 April 2020 12:24 PM UTC

Hi

With the new ribbonbar control of PowerBuiler 2019 r2, I use the getitembytag function to search objects in the ribbonbar and access their properties. I also have menus associated with button (LargeButton).

The getItemByTag function does not work with these menus (RibbonMenuItem).

What other method can I use to find these menus by the Tag?

Thank for you help

Thierry

Thierry Garrigues Accepted Answer Pending Moderation
  1. Thursday, 9 April 2020 15:38 PM UTC
  2. PowerBuilder
  3. # 1

Hi Marco

To use the getitem function you need to know the itemHandle. I only have its Tag...

Regards

Thierry

Comment
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Thursday, 9 April 2020 15:31 PM UTC
  2. PowerBuilder
  3. # 2

Hello Thierry,

can't you use rbb.GetItem() and then take the returned itemHandle to cast the PowerObject to a ribbonMenuItem object?

Best,

.m

Comment
There are no comments made yet.
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Friday, 10 April 2020 06:41 AM UTC
  2. PowerBuilder
  3. # 3

Hi Thierry,

 

It is not supported to use the RibbonMenuItem object in the GetItemByTag function in RibbonBar controls. 

You can refer to the following link.

https://docs.appeon.com/appeon_online_help/pb2019r2/powerscript_reference/ch10s269.html

But I will record it as a new enhancement / requirement request and will transfer it to our product team for consideration.

 

BTW, you can work it around via the following code example:

String 			ls_menuTag, ls_text, ls_tag
Integer			li_Return
Long			ll_i
RibbonMenuItem 		lr_MenuItem
RibbonMenu		lr_menu
RibbonLargeButtonItem 	lr_LargeButton

li_Return = rbb_1.GetItemByTag ("LargeButtonTag", lr_LargeButton)
li_Return  = rbb_1.getmenubybuttonhandle( lr_LargeButton.itemhandle , lr_menu)
If lr_menu.getitemcount( ) > 0 Then
	For ll_i = 1 To lr_menu.getitemcount( )
		lr_menu.getitem( ll_i, lr_MenuItem)
		ls_text = lr_MenuItem.text
		ls_tag = lr_MenuItem.tag
	Next 
End If 

Regards,

 

Comment
  1. Thierry Garrigues
  2. Friday, 10 April 2020 07:05 AM UTC
Hi Mark

I know this point of the documentation and I thank you for creating an evolution request.

In my case I only know the Tag of the menu and not the Tag of the button.

I am looking for an elegant solution but if I have no choice I will memorize the Tag of the button to find the menu.

Regards

Thierry

  1. Helpful
  1. Mark Lee @Appeon
  2. Friday, 10 April 2020 07:18 AM UTC
Hi Thierry,



I fully understand your situation. And I will transfer your thought to our product team for consideration.



Regards,
  1. Helpful
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.