Duplicating Editor Button Functionality

Last post 05-16-2005, 12:12 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  05-16-2005, 11:14 AM 6728

    Duplicating Editor Button Functionality

    Hi:
     
    Is it possible to duplicate existing button functionality?  For example, let's say I wanted to have 2 buttons utilize the Paste Word functionality?  Could I use the default Paste Word button AND a custom button that would call the same (Paste Word)code?  Thanks.
  •  05-16-2005, 12:12 PM 6731 in reply to 6728

    Re: Duplicating Editor Button Functionality

    Yes, that's possible.
     
    Here is an example:
     

    <CE:Editor id="Editor1" runat="server" TemplateItemList="PasteWord, insertcustombutonhere"></CE:Editor>


     void Page_Load(object sender, System.EventArgs e)
     {
      CuteEditor.ToolControl tc = Editor1.ToolControls["insertcustombutonhere"];
      if(tc!=null)
      {    
       System.Web.UI.WebControls.Image Image1 = new System.Web.UI.WebControls.Image ();
       Image1.ToolTip    = "Insert today's date";
       Image1.ImageUrl    = "/images/PasteWord.gif";
       Image1.CssClass    = "CuteEditorButton";
       SetMouseEvents(Image1);
       Image1.Attributes["onclick"]="CuteEditor_GetEditor(this).ExecCommand('PasteWord')";
      }
     }
     
     void SetMouseEvents(WebControl control)
     {
      control.Attributes["onmouseover"]="CuteEditor_ButtonCommandOver(this)";
      control.Attributes["onmouseout"]="CuteEditor_ButtonCommandOut(this)";
      control.Attributes["onmousedown"]="CuteEditor_ButtonCommandDown(this)";
      control.Attributes["onmouseup"]="CuteEditor_ButtonCommandUp(this)";
      control.Attributes["ondragstart"]="CuteEditor_CancelEvent()";
     }

     

    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