custom context menu

Last post 04-28-2009, 3:24 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  04-28-2009, 2:54 AM 51592

    custom context menu

    I would like to create my own context menu.
    how do I do that?
     
    the only thing I can find in the manual is: $editor->ContextMenuMode="None";
     
    can you please explan how to create my own context menu including the code to place it in my editor?
     
    I have also tried to modify the some config files but I cannot remove any values from the context menu.
    we have disabled some options in the toolbar but with the insert option in the context menu the user can still use this options.
     
    maybe you can improve the online manual on this point
     
    kind regards,
    Joke Dekker
  •  04-28-2009, 3:24 PM 51628 in reply to 51592

    Re: custom context menu

    Joke,
     
    Please read the following article. Hope it helps.
     

    Add custom items to context menu


    Cute Editor is a context sensitive application, it is aware of it's context and acts accordingly. Many functions of CuteEditor are accessible via the context menus (accessible through a right-click menu in the content area). This section describes how to add custom items to context menu


    1. Add custom items to main context menu


    The following code shows how to add custom items to main context menu.

       function CuteEditor_AddMainMenuItems(menuitem)
    {
        menuitem.AddMenuItem(1,"Hello","bold.gif",DefaultMenuHandler);
    }
    function DefaultMenuHandler(menuitem)
    {
       alert("You clicked "+menuitem.editor.id+":"+menuitem.html);
    }

    2. Add custom items to tag context menu


    The following code shows how to add custom items to tag context menu.

    function CuteEditor_AddTagMenuItems(menuitem,element)
    {
     //you can see the menu item in the TagList
     menuitem.AddMenuItem(1,"MyMenuItem","bold.gif",HandleMyMenuItem);
     
     function HandleMyMenuItem()
     {
      alert(element.nodeName);
     }
    }

    3. Add custom items to Verb context menu


    The following code shows how to add custom items to Verb context menu.

    function CuteEditor_AddVerbMenuItems(menuitem,element)
    {
     //you can see the menu item in the Verb context menu
     menuitem.AddMenuItem(1,"MyMenuItem","bold.gif",HandleMyMenuItem);
     
     function HandleMyMenuItem()
     {
      alert(element.nodeName);
     }
    }

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML