Param

Method

Event

 

 

AddMenuv1.6 or higher

Adds a custom menu.

 

Syntax

    [get] HRESULT AddMenu (
    long* pVal
    );
    [put] HRESULT AddMenu (
    long newVal
    );

Parameters

[get] pVal

[out, retval] Returns the AddMenu setting values.

[put] newVal

[in] Sets the AddMenu values. The values are as follows.

Menu ID

Enter the Menu ID.

Type

Choose how the menu will run: 'function' or 'plugin'.

Menu Image URL

Enter the URL as a full URL path.

Menu Name

Enter the menu name to be used.

 

Return Values

None

 

Remarks

The property must be set after MainClass is called and before the editor loads.

The call can be performed via the created MainClass object's "params".

Enter the AddMenu setting values in the following order, separated by commas: Menu ID, Type, Menu Image URL, Menu Name. The image size should be 18x18. To add multiple menus, separate their values with the pipe ( | ) character.

After adding the menu, use CreateToolbarParams to apply it to the editor. You must set the UserToolbar value to 'true' to use the menu.

You can use the added menu by using the CE_OnCustomMenu event.

 

Sample Code

JavaScript[get]

var object = new NamoSE("test");
var createTabValue = object.params.AddMenu;

 

JavaScript[put]

<Adding One Menu>
var object = new NamoSE("test");
object.params.AddMenu="userMenu,function,
http://www.namo.com/image/menu.jpg,User Menu"
object.params.UserToolbar = true;
object.params.CreateToolbar = "userMenu|newdoc|copy";
object.editorStart();

<Adding Multiple Menus>
var object = new NamoSE("test");
object.params.AddMenu="userMenu,function,http://www.namo.com/image/menu.jpg,User Menu|
userMenu1,function,http://www.namo.com/image/menu2.jpg,User Menu 2";
object.params.UserToolbar = true;
object.params.CreateToolbar = "userMenu|newdoc|copy|userMenu1";
object.editorStart();

function CE_OnCustomMenu(e){
alert("customMenuID:" + e.customMenuID + "\n" + "type:" + e.type);
}