static protected Anchor CreateStandardControlDOMElement( Control control, Root root, string displayMode, ControlProperties properties, bool menu, bool arrow) { // We cast the properties to FlyoutAnchor properties because it has the superset // of all the possible properties that we will want to use. JSObject tempProps = JSObject.From <ControlProperties>(properties); FlyoutAnchorProperties props = tempProps.To <FlyoutAnchorProperties>(); return(CreateStandardControlDOMElementCore( control, root, displayMode, props.Id, props.Image32by32, props.Image32by32Class, props.Image32by32Top, props.Image32by32Left, props.Image16by16, props.Image16by16Class, props.Image16by16Top, props.Image16by16Left, props.LabelText, props.LabelCss, props.Alt, props.Description, props.ToolTipTitle, menu, arrow)); }
/// <summary> /// Control constructor. /// </summary> /// <param name="ribbon">The Ribbon that this Control will be a part of.</param> /// <param name="id">Unique identifier for this Control. ie: "fseaPaste"</param> /// <param name="prms">Dictionary of parameters to this Control.</param> protected Control(Root root, string id, ControlProperties properties) { _root = root; _id = id; _properties = properties; _components = new List <ControlComponent>(); _displayModes = ","; _cachedDOMElements = new Dictionary <string, HtmlElement>(); // TODO(shaozhu): Remove registerControl() after dynamic menu is // supported. root.RegisterControl(this); }
/// <summary> /// ToolTip Contructor. /// </summary> /// <param name="ribbon">The Ribbon that this ToolTip was created by and is a part of.</param> /// <param name="id">The Component id of this ToolTip.</param> /// <param name="title">The Title of this ToolTip.</param> /// <param name="description">The Description of this ToolTip.</param> /// <owner alias="HillaryM" /> internal ToolTip(Root root, string id, string title, string description, ControlProperties properties) : base(root, id, title, description) { _properties = properties; if (!string.IsNullOrEmpty(properties.ToolTipShortcutKey)) { // switch display based on text direction if (Root.TextDirection == Direction.LTR) { this.TitleInternal = String.Format("{0} ({1})", Title, Properties.ToolTipShortcutKey); } else { this.TitleInternal = String.Format("({1}) {0}", Title, Properties.ToolTipShortcutKey); } } }
static protected Anchor CreateStandardControlDOMElement( Control control, Root root, string displayMode, ControlProperties properties, bool menu, bool arrow) { // We cast the properties to FlyoutAnchor properties because it has the superset // of all the possible properties that we will want to use. JSObject tempProps = JSObject.From<ControlProperties>(properties); FlyoutAnchorProperties props = tempProps.To<FlyoutAnchorProperties>(); return CreateStandardControlDOMElementCore( control, root, displayMode, props.Id, props.Image32by32, props.Image32by32Class, props.Image32by32Top, props.Image32by32Left, props.Image16by16, props.Image16by16Class, props.Image16by16Top, props.Image16by16Left, props.LabelText, props.LabelCss, props.Alt, props.Description, props.ToolTipTitle, menu, arrow); }
/// <summary> /// Control constructor. /// </summary> /// <param name="ribbon">The Ribbon that this Control will be a part of.</param> /// <param name="id">Unique identifier for this Control. ie: "fseaPaste"</param> /// <param name="prms">Dictionary of parameters to this Control.</param> protected Control(Root root, string id, ControlProperties properties) { _root = root; _id = id; _properties = properties; _components = new List<ControlComponent>(); _displayModes = ","; _cachedDOMElements = new Dictionary<string, HtmlElement>(); // TODO(shaozhu): Remove registerControl() after dynamic menu is // supported. root.RegisterControl(this); }
/// <summary> /// Sets the Aria 'describedby' attribute for controls that have a SuperToolTip defined. /// </summary> /// <remarks> /// The 'aria-describedby' attribute points to the SuperToolTip defined for this control. It is used by Assistive Technologies to indicate /// the DOM element containing more information on the selected control. /// </remarks> /// <param name="properties">The control's properties.</param> /// <param name="focusElement">The element of the control that recieves focus when the control is selected.</param> internal static void SetAriaTooltipProperties(ControlProperties properties, HtmlElement focusElement) { if (!CUIUtility.IsNullOrUndefined(properties) && !CUIUtility.IsNullOrUndefined(focusElement) && !string.IsNullOrEmpty(properties.ToolTipTitle)) focusElement.SetAttribute("aria-describedby", properties.Id + "_ToolTip"); }
/// <summary> /// ContextMenuLauncher constructor /// </summary> /// <param name="root">The Root that this MenuLauncher was created by and is part of.</param> /// <param name="id">The Component id of this MenuLauncher.</param> /// <param name="properties">Dictionary of Control properties</param> /// <param name="menu">The Menu that this MenuLauncher should launch.</param> internal ContextMenuLauncher(Root root, string id, ControlProperties properties, MenuType menu) : base(root, id, properties, menu) { //base class sets the Menu property on menu }
/// <summary> /// MenuLauncher contructor. /// </summary> /// <param name="root">The Root that this MenuLauncher was created by and is part of.</param> /// <param name="id">The Component id of this MenuLauncher.</param> /// <param name="properties">Dictionary of Control parameters</param> /// <param name="menu">The Menu that this MenuLauncher should launch.</param> public MenuLauncher(Root root, string id, ControlProperties properties, MenuType menu) : base(root, id, properties) { _menu = menu; }