1. ATK Gimmy Susan
  2. PowerBuilder
  3. Monday, 18 May 2020 07:55 AM UTC

Good morning

I have a very simple ribbon menu (see attached xml)

How can I read the "tag" property of the elements included in the Master section?
(for example the tags of the item 'Customers')

Thanks for the reply

 

 

Gimmy

 

 

 

Attachments (1)
Accepted Answer
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 19 May 2020 06:57 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Gimmy,

You need to use the GetMasterItem method to get the master menu item of the application menu.

You can refer to the following link:

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

For your issue, you can use the following code example to test and see if it works:

 

RibbonApplicationButtonItem 				lr_AppButton
RibbonApplicationMenu 					lr_AppMenu
RibbonMenuItem 						lr_MenuItem
Integer 						li_Return, li_count, i 
string 							ls_tag, ls_text

ls_tag = "MyApp"  
li_Return = rbb_1.GetItemByTag (ls_tag, lr_AppButton)
li_Return = lr_AppButton.getmenu( lr_AppMenu)
li_count = lr_AppMenu.getmasteritemcount( )
for i = 1 to li_count	 
	li_Return = lr_AppMenu.GetMasterItem (i, lr_MenuItem)
	ls_text = lr_MenuItem.text
	ls_text = lr_MenuItem.tag	                         //Get the tag
	
	lr_MenuItem.text = ls_text + "1"			//change the text content	
	lr_AppMenu.setmasteritem( i, lr_MenuItem)		//reset the menuitem
next 

lr_AppButton.setmenu( lr_AppMenu)
rbb_1.setapplicationbutton( lr_AppButton)

 

BTW, The GetItemByTag and GetItem functions can be used to get items including ApplicationButton, TabButton, Category, Panel, Group, LargeButton, SmallButton, CheckBox, and ComboBox; but cannot get RibbonMenuItem, RibbonApplicationMenu, and RibbonMenu. To get RibbonMenuItem, you can use the GetItemGetMasterItem, and GetRecentItem functions. To get RibbonApplicationMenu and RibbonMenu, you can use the GetMenu and GetMenuByButtonHandle functions.

You can refer to the following link for detail.

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

Regards,

Comment
There are no comments made yet.
ATK Gimmy Susan Accepted Answer Pending Moderation
  1. Tuesday, 19 May 2020 09:07 AM UTC
  2. PowerBuilder
  3. # 1

Hi Mark Lee

Thanks for the time you have dedicated to me.
The suggestion was very instructive.

I solved it like this:

 

RibbonApplicationButtonItem lr_AppButton
RibbonApplicationMenu lr_AppMenu
RibbonMenuItem lr_MenuItem
Integer li_Return
string ls_textli_Return = rbb_1.getitem( al_handle, lr_AppButton)
li_Return = lr_AppButton.getmenu( lr_AppMenu)
li_Return = lr_AppMenu.GetMasterItem (al_index, lr_MenuItem)
ls_text = lr_MenuItem.Tag

 

 

 

regards

Comment
  1. Mark Lee @Appeon
  2. Wednesday, 20 May 2020 01:10 AM UTC
Hi Gimmy,



Glad to hear that. And thanks for sharing the information.

You are welcome!



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.