public void OpenMenu() { menu.SetActive(true); isSelected = true; isMenuOpen = true; currentOpenMenu = this; image.color = selectedColor; BlockingPanel.instance.gameObject.SetActive(true); }
private void Awake() { image = GetComponent <Image>(); if (isSubmenuItem) { parentItem = transform.parent.parent.GetComponent <MenuBarItem>(); parentMenu = parentItem.transform.parent.parent.GetComponent <MenuBarButton>(); } else { parentMenu = transform.parent.parent.GetComponent <MenuBarButton>(); } }
public void OnPointerDown(PointerEventData eventData) { if (isSelected) { CloseMenu(); isMenuOpen = false; } else { OpenMenu(); isMenuOpen = true; currentOpenMenu = this; } }
public void OnPointerEnter(PointerEventData eventData) { if (isSelected) { return; } if (isMenuOpen) { currentOpenMenu.CloseMenu(); OpenMenu(); currentOpenMenu = this; } else { image.color = hoverColor; } }
/// <summary> /// Renders control as a div and all its child controls /// </summary> /// <param name="output"></param> protected override void RenderContents(HtmlTextWriter output) { //Draw modalBackground output.WriteBeginTag("div"); output.WriteAttribute("class", "modalBackground"); output.Write(HtmlTextWriter.TagRightChar); output.WriteEndTag("div"); //Draw modalContainer output.WriteBeginTag("div"); output.WriteAttribute("class", "modalContainer"); output.Write(HtmlTextWriter.TagRightChar); //Draw modal output.WriteBeginTag("div"); output.WriteAttribute("class", "modal"); output.Write(HtmlTextWriter.TagRightChar); //Draw modalBody output.WriteBeginTag("div"); output.WriteAttribute("class", "modalBody"); output.Write(HtmlTextWriter.TagRightChar); //Draw content inside modal box output.Write("Notes:"); output.Write("<br />"); output.Write("<br />"); _txtNotes.RenderControl(output); output.Write("<br />"); output.Write("<br />"); //required field _rfv.RenderControl(output); output.Write("<br />"); output.WriteBeginTag("p"); output.WriteAttribute("style", "text-align:center"); output.Write(HtmlTextWriter.TagRightChar); //buttons //editor menu button for submit output.WriteBeginTag("ul"); output.WriteAttribute("class", "modaltabs"); output.Write(HtmlTextWriter.TagRightChar); //contents foreach (WebControl control in this.Controls) { MenuBarButton button = control as MenuBarButton; if (button != null) { output.WriteBeginTag("li"); output.Write(HtmlTextWriter.TagRightChar); button.RenderControl(output); output.WriteEndTag("li"); } } output.WriteEndTag("ul"); output.WriteEndTag("p"); //End of content output.WriteEndTag("div"); output.WriteEndTag("div"); output.WriteEndTag("div"); }