Param |
Method |
Event |
|
|
AddMenuv1.6 or higherAdds a custom menu.
Syntax[get] HRESULT AddMenu ( [put] HRESULT AddMenu ( Parameters[get] pVal [out, retval] Returns the AddMenu setting values. [put] newVal [in] Sets the AddMenu values. The values are as follows.
Return ValuesNone
RemarksThe 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 CodeJavaScript[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); }
|