Files
Umbraco-CMS/components/umbraco.controls/MenuIcon.cs
Shandem 9a46338123 DO NOT DOWNLOAD. DOWNLOAD LATEST STABLE FROM RELEASE TAB
Resolves 23626. ClientDependency work.

[TFS Changeset #57219]
2009-07-26 15:13:15 +00:00

74 lines
2.6 KiB
C#

using System.ComponentModel;
using System.Web.UI;
using umbraco.presentation.ClientDependency;
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'");
this.AlternateText = _AltText;
this.Attributes.Add("title", _AltText);
if (_OnClickCommand != "") {
this.Attributes.Add("onClick", OnClickCommand);
}
}
}
}