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

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

Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Friday, 10 April 2020 06:41 AM
  2. PowerBuilder
  3. # 1
0
Votes
Undo

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
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. Thierry Garrigues
  2. Friday, 10 April 2020 07:05 AM
Hi Thierry,



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



Regards,
  1. Mark Lee @Appeon
  2. Friday, 10 April 2020 07:18 AM
There are no comments made yet.
Thierry Garrigues Accepted Answer Pending Moderation
  1. Thursday, 9 April 2020 15:38 PM
  2. PowerBuilder
  3. # 2
0
Votes
Undo

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
  2. PowerBuilder
  3. # 3
0
Votes
Undo

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.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.