2019 R3 IDE and Runtimw 2556 built on 9/9/2020
So what is the winning combinations of commands that will loop through the submenu’s in the master menu?
Could it be that there is no way and I have to await enhanced features?
Below is the beginning of loop through categories and panels.
PowerObject lpo_object, lpo_object2
int li_Return, i, j, li_num_of_categories, li_master_items_count, li_submenu_master_items_count
Integer li_subcount, li_index, li_index2
RibbonLargeButtonItem lr_LargeButton
RibbonSmallButtonItem lr_SmallButton
RibbonMenuItem lr_MenuItem
RibbonCategoryItem lr_category
RibbonPanelItem lr_panel
RibbonMenu lr_Menu
RibbonApplicationButtonItem buttonitem
RibbonApplicationMenu appmenu
FOR j = 1 to ll_panel_count
li_Return = rbb_main.GetChildItemByIndex(lr_category.itemhandle, j, lr_panel)
ll_child_count = rbb_main.GetChildItemCount(lr_panel.itemhandle)
FOR i = 1 to ll_child_count
li_Return = rbb_main.GetChildItemByIndex(lr_panel.itemhandle,i, lpo_Object)
//LargeButton Visible and enable control
lr_LargeButton = lpo_Object
DO
IF lr_LargeButton.text = "Add Reservation" OR lr_LargeButton.text = "Dash Board" THEN
IF ls_s1=TRUE THEN
lr_LargeButton.Enabled = TRUE
Set 2nd MASTER ITEM enabled=TRUE
li_index = 2 // 2 master menu
//Gets a copy of MenuItem from the copy of ApplicationMenu
li_Return = appmenu.GetMasterItem(li_index, lr_MenuItem )
//Set master menu to enabled=TRUE
lr_MenuItem.Enabled=TRUE
non of the commands work below on the submenu's . I completely do not understand if or how it should work
li_submenu_master_items_count = appmenu.GetRecentItemCount()
li_Return = appmenu.SetRecentItem(li_index2, lr_MenuItem)
li_Return = appmenu.GetRecentItem (li_index2, lr_MenuItem)
//SAVE ALL CHANGES BACK
//For the change to take effect, sets the copy of MenuItem back to the copy of ApplicationMenu
li_Return = appmenu.SetMasterItem( li_index, lr_MenuItem )
//Then sets the copy of ApplicationMenu back to the copy of ApplicationButton
li_Return = buttonitem.Setmenu( appmenu )
//Finally sets the copy of ApplicationButton back to the RibbonBar control
li_Return = rbb_main.SetApplicationbutton( buttonitem )
// ApplicationButton master Items
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<RibbonBar BuiltinTheme="0" Font="FaceName:Tacoma; TextSize:10">
<RibbonItems>
<ApplicationButton Text="Application" Enabled="true" Tag="RibbonBar Demo" Visible="true">
<ApplicationMenu>
<Master>
<Item Text="Front Desk" PictureName="" Checked="false" Enabled="true" Tag="" Type="0" Visible="true" Clicked="">
<Item Text="Unit-Chart" PictureName="ChartBig!" Checked="false" Enabled="false" Shortcut="" Tag="Unit-Chart" Type="0" Visible="true" Clicked="ue_menuitemclicked"></Item>
<Item Text="Arrivals" PictureName="CustomerBig!" Checked="false" Enabled="false" Shortcut="" Tag="Arrivals" Type="0" Visible="true" Clicked="ue_menuitemclicked"></Item>
<Item Text="Departures" PictureName="AccountBig!" Checked="false" Enabled="false" Shortcut="" Tag="Departures" Type="0" Visible="true" Clicked="ue_menuitemclicked"></Item>
<Item Text="Arrivals + Departures" PictureName="TeamworkBig!" Checked="false" Enabled="false" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_menuitemclicked"></Item>
<Item Text="Dash Board" PictureName="AlignBig!" Checked="false" Enabled="false" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_menuitemclicked"></Item>
<Item Text="Add Reservation" PictureName="AddBig!" Checked="false" Enabled="false" Shortcut="R" Tag="Add Reservation" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Update Reservation" PictureName="TabHeaderSelectedBig!" Checked="false" Enabled="false" Shortcut="F2" Tag="Update and Delete Reservation" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Guest Stay Overs" PictureName="Cascade1!" Checked="false" Enabled="false" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Group" PictureName="TeamworkBig!" Checked="false" Enabled="false" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Walk-In" PictureName="CustomerBig!" Checked="false" Enabled="false" Shortcut="" Tag="Walk-In" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Check-In Guests" PictureName="CustomerBig!" Checked="false" Enabled="false" Shortcut="" Tag="Check-In" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Check-Out" PictureName="AccountBig!" Checked="false" Enabled="false" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Open Folios" PictureName="Cascade1!" Checked="false" Enabled="false" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Folio History" PictureName="CopyBig!" Checked="false" Enabled="false" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Balance Due" PictureName="AccountingNumberFormatBig!" Checked="false" Enabled="true" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Deposit" PictureName="CurrencyBig!" Checked="false" Enabled="true" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Guest Profiles" PictureName="EmployeeBig!" Checked="false" Enabled="true" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Service Out" PictureName="PropertiesBig!" Checked="false" Enabled="true" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Point of Sale" PictureName="OptionsBig!" Checked="false" Enabled="true" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="User LogOn" PictureName="AccountBig!" Checked="false" Enabled="true" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
<Item Text="Remote Support" PictureName="TelephoneBig!" Checked="false" Enabled="true" Shortcut="" Tag="" Type="0" Visible="true" Clicked="ue_mastermenuclicked"></Item>
</Item>
But I can seem to save the changes to the submenu's.
The master item saves correctly but not the changes to the submenu item’s
Below I tried using SetRecentItem. Still not working
//li_master_items_count = 2
FOR li_index = 1 TO li_master_items_count
appmenu.GetMasterItem (li_index, lr_MenuItem)
//MessageBox ("Item " + string (li_index), lr_MenuItem.text)
lr_MenuItem.enabled=TRUE
li_Return = appmenu.SetMasterItem( li_index, lr_MenuItem )
li_submenu_master_items_count = appmenu.GetMasterItemCount(li_index)
FOR j = 1 TO li_submenu_master_items_count
appmenu.GetMasterItem (li_index, j, lr_MenuItem)
lr_MenuItem.enabled=TRUE
li_Return = appmenu.SetRecentItem( j, lr_MenuItem )
//MessageBox("SubItem " + string (j), lr_MenuItem.text)
NEXT
// li_Return = appmenu.SetMasterItem( li_index, lr_MenuItem )
NEXT
//li_index = 3
// working update application button logic
//For the change to take effect, sets the copy of MenuItem back to the copy of ApplicationMenu
li_Return = appmenu.SetMasterItem( li_index, lr_MenuItem )
//Then sets the copy of ApplicationMenu back to the copy of ApplicationButton
li_Return = buttonitem.Setmenu( appmenu )
//Finally sets the copy of ApplicationButton back to the RibbonBar control
li_Return = rbb_main.SetApplicationbutton( buttonitem )
appmenu.SetMasterItem( li_index, j, lr_MenuItem )