Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Custom submenu

Engaged ,
May 07, 2018 May 07, 2018

The code snippet below will place a new menu title "Automatic " after the "Help" menu in the Bridge main menu bar.

How can modify the snippet to add a submenu category with options:

For example:

Automatic

-- Category

---- Submenu 1

---- Submenu 2

---- Submenu 3

#target bridge    

   if( BridgeTalk.appName == "bridge" ) {  

      newMenu = new MenuElement( "menu", "Automatic", "after Help", "myMenu" ); 

      RPP = new MenuElement( "command", "Menu Title", "at the end of myMenu","myAlert"  );  

      }; 

 

RPP.onSelect = function () {  

runMyScript(); 

function runMyScript(){ 

//add your code here 

}

TOPICS
Scripting
843
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , May 07, 2018 May 07, 2018

Please try this...

#target bridge   

   if( BridgeTalk.appName == "bridge" ) { 

       //top menu

     newMenu = new MenuElement( "menu", "Automatic", "after Help", "myMenu" );

     //sub menu

     newMenu2 = new MenuElement( "menu", "Category", "at the beginning of myMenu", "myMenu2" );

      //sub menu

     newMenu3 = new MenuElement( "menu", "Category II", "at the end of myMenu", "myMenu3" );

      //menu items for Category

      RPP = new MenuElement( "command", "Menu Title", "at the end of myMenu2

...
Translate
Guide ,
May 07, 2018 May 07, 2018

Please try this...

#target bridge   

   if( BridgeTalk.appName == "bridge" ) { 

       //top menu

     newMenu = new MenuElement( "menu", "Automatic", "after Help", "myMenu" );

     //sub menu

     newMenu2 = new MenuElement( "menu", "Category", "at the beginning of myMenu", "myMenu2" );

      //sub menu

     newMenu3 = new MenuElement( "menu", "Category II", "at the end of myMenu", "myMenu3" );

      //menu items for Category

      RPP = new MenuElement( "command", "Menu Title", "at the end of myMenu2"); 

      RPP2 = new MenuElement( "command", "Menu Title II", "at the end of myMenu2"); 

      RPP3 = new MenuElement( "command", "Menu Title III", "at the end of myMenu2"); 

      //menu items for Category II

      XPP = new MenuElement( "command", "Title 1", "at the end of myMenu3");

      XPP2 = new MenuElement( "command", "Title 2", "at the end of myMenu3");

      XPP3 = new MenuElement( "command", "Title 3", "at the end of myMenu3");

      }; 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 07, 2018 May 07, 2018
LATEST

Thank you again, it works great!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines