Show/Hide Toolbars

EmEditor Help

Navigation: EmEditor Help > Macro Reference

EmEditor Macro Reference: PopupMenu Object

Scroll Prev Top Next More
EmEditor Home - EmEditor Help - EmEditor Macro Reference

PopupMenu Object

Methods

Add

Adds a new item to the end of the menu.

AddPopup

Adds a new submenu to the end of the menu.

GetText

Retrieves the text string of the menu item specified by the identifier.

Track

Displays the popup menu.

Examples

[JavaScript]

menu = CreatePopupMenu();

submenu = CreatePopupMenu();

menu.Add( "menu 1", 1 );

menu.Add( "menu 2", 2, eeMenuGrayed );

menu.Add( "", 0, eeMenuSeparator );

submenu.Add( "menu 11", 11 );

submenu.Add( "menu 12", 12 );

menu.AddPopup( "more", submenu );

result = menu.Track( 0 );

if( result != 0 ) {

   alert( menu.GetText( result ) );

}

 

[VBScript]

Set menu = CreatePopupMenu

Set submenu = CreatePopupMenu

menu.Add "menu 1", 1

menu.Add "menu 2", 2, eeMenuGrayed

menu.Add "", 0, eeMenuSeparator

submenu.Add "menu 11", 11

submenu.Add "menu 12", 12

menu.AddPopup "more", submenu

result = menu.Track( 0 )

If result <> 0 Then

   alert menu.GetText( result )

End If

 

Version

Supported on EmEditor Professional Version 5.00 or later.

Copyright © 2003-2016 by Emurasoft, Inc.