Files
Umbraco-CMS/src/umbraco.controls/MenuIcon.cs
Shannon Deminick b292cb3ab3 Crated InsertMacroSplitButton webforms control instead of the hacky js code used to insert the split button in the template editor.
Have implemented it now in the EditView (will transition over its use in editTemplate soon but is low priority).
Have got the js callbacks working now for inserting a macro for the mvc editor but need to implement the correct syntax. Also need
to migrate and update the editMacro dialog screen to check if we are rendering for MVC or not and if it is MVC then use the correct
syntax.
2012-12-31 18:39:36 +03:00

75 lines
2.6 KiB
C#

using System.ComponentModel;
using System.Web.UI;
using ClientDependency.Core;
namespace umbraco.uicontrols {
[ClientDependency(ClientDependencyType.Css, "menuicon/style.css", "UmbracoClient")]
internal class MenuIcon : System.Web.UI.WebControls.Image, MenuIconI
{
private string _OnClickCommand = "";
private string _AltText = "init";
public string ID1 {
get { return this.ID; }
set { this.ID = value; }
}
public string AltText {
get { return this.AlternateText; }
set {
_AltText = value;
this.AlternateText = value;
this.Attributes.Add("title", value);
}
}
public int IconWidth {
get { return (int)this.Width.Value; }
set { this.Width = value; }
}
public int IconHeight {
get { return (int)this.Height.Value; }
set { this.Height = value; }
}
public string ImageURL {
get { return this.ImageUrl; }
set { this.ImageUrl = value; }
}
public string OnClickCommand {
get { return _OnClickCommand; }
set { _OnClickCommand = value; }
}
protected override void OnLoad(System.EventArgs EventArguments) {
// NH 17-01-2007. Trying to avoid inline styling soup
// Me.Width = WebControls.Unit.Pixel(22)
// Me.Height = WebControls.Unit.Pixel(23)
//Me.Style.Add("border", "0px")
this.Attributes.Add("class", "editorIcon");
this.Attributes.Add("onMouseover", "this.className='editorIconOver'");
string holder = "";
// if (this.ID != "") {
//holder = this.ID.Substring(0, this.ID.LastIndexOf("_")) + "_menu";
this.Attributes.Add("onMouseout", "hoverIconOut('" + holder + "','" + this.ID + "');");
this.Attributes.Add("onMouseup", "hoverIconOut('" + holder + "','" + this.ID + "');");
// } else {
this.Attributes.Add("onMouseout", "this.className='editorIcon'");
this.Attributes.Add("onMouseup", "this.className='editorIcon'");
// }
this.Attributes.Add("onMouseDown", "this.className='editorIconDown'; return false;");
this.AlternateText = _AltText;
this.Attributes.Add("title", _AltText);
if (_OnClickCommand != "") {
this.Attributes.Add("onClick", OnClickCommand);
}
}
}
}