/// <summary> /// Initializes the components /// </summary> /// <param name="component"></param> public override void Initialize(IComponent component) { // Should not happen m_panel = component as MultiPanel; if (m_panel == null) { DisplayError( new ArgumentException( "Tried to use the MultiPanelControlDesign with a class that does not inherit from MultiPanel.", "component")); return; } m_panel.SelectionChange += OnPanelSelectionChange; base.Initialize(component); // Subscribe events IComponentChangeService componentChangeService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); if (componentChangeService != null) componentChangeService.ComponentRemoved += OnComponentRemoved; ISelectionService selectionService = (ISelectionService)GetService(typeof(ISelectionService)); if (selectionService != null) selectionService.SelectionChanged += OnServiceSelectionChanged; }
/// <summary> /// Event handler for the "Add Page" verb. /// </summary> /// <param name="dh"></param> /// <param name="panel"></param> private static void AddPage(IDesignerHost dh, MultiPanel panel) { DesignerTransaction dt = dh.CreateTransaction("Added new page"); // Gets a free name int i = 1; while (panel.Controls.Cast<Control>().Any(x => x.Name == "Page" + i)) { i++; } string name = "Page" + i; // Creates the page MultiPanelPage newPage = dh.CreateComponent(typeof(MultiPanelPage), name) as MultiPanelPage; if (newPage != null) { newPage.Text = name; panel.Controls.Add(newPage); // Update selection panel.SelectedPage = newPage; } dt.Commit(); }
public override void Initialize(IComponent component) { m_mpanel = component as MultiPanel; if (m_mpanel == null) { DisplayError(new ArgumentException("Tried to use the MultiPanelControlDesign with a class that does not inherit from MultiPanel.", "component")); return; } base.Initialize(component); IComponentChangeService _iccs = (IComponentChangeService)GetService(typeof(IComponentChangeService)); if (_iccs != null) { _iccs.ComponentRemoved += ComponentRemoved; } ISelectionService _s = (ISelectionService)GetService(typeof(ISelectionService)); if (_s != null) { _s.SelectionChanged += s_SelectionChanged; } }
/// <summary> /// Event handler for the "Select X page" handler. /// </summary> /// <param name="dh"></param> /// <param name="panel"></param> /// <param name="page"></param> /// <returns></returns> private static void SelectPage(IDesignerHost dh, MultiPanel panel, MultiPanelPage page) { DesignerTransaction dt = dh.CreateTransaction("Selected page"); panel.SelectedPage = page; dt.Commit(); }
/// <summary> /// Event handler for the "Remove Tab" verb. /// </summary> /// <param name="panel"></param> private static void RemovePage(IDesignerHost dh, MultiPanel panel) { MultiPanelPage page = panel.SelectedPage; if (page == null) { return; } DesignerTransaction dt = dh.CreateTransaction("Removed page"); panel.Controls.Remove(page); dh.DestroyComponent(page); if (panel.Controls.Count > 0) { panel.SelectedPage = (MultiPanelPage)panel.Controls[0]; } else { panel.SelectedPage = null; } dt.Commit(); }
/// <summary> /// Initializes the components /// </summary> /// <param name="component"></param> public override void Initialize(IComponent component) { // Should not happen m_panel = component as MultiPanel; if (m_panel == null) { this.DisplayError(new ArgumentException("Tried to use the MultiPanelControlDesign with a class that does not inherit from MultiPanel.", "component")); return; } m_panel.SelectionChange += new MultiPanelSelectionChangeHandler(OnPanelSelectionChange); base.Initialize(component); // Subscribe events IComponentChangeService componentChangeService = (IComponentChangeService)this.GetService(typeof(IComponentChangeService)); if (componentChangeService != null) { componentChangeService.ComponentRemoved += new ComponentEventHandler(OnComponentRemoved); } ISelectionService selectionService = (ISelectionService)GetService(typeof(ISelectionService)); if (selectionService != null) { selectionService.SelectionChanged += new EventHandler(OnServiceSelectionChanged); } }
static void Init() { // Get existing open window or if none, make a new one: MultiPanel window = (MultiPanel)EditorWindow.GetWindow(typeof(MultiPanel)); window.Show(); }
/// <summary> /// Main method. /// </summary> /// <param name="selector"></param> /// <param name="context"></param> /// <param name="provider"></param> /// <exception cref="System.ArgumentNullException">selector or context or provider</exception> protected override void FillTreeWithData(Selector selector, ITypeDescriptorContext context, IServiceProvider provider) { selector.ThrowIfNull(nameof(selector)); context.ThrowIfNull(nameof(context)); provider.ThrowIfNull(nameof(provider)); // Base method, clear the selector base.FillTreeWithData(selector, context, provider); // Scroll through the pages MultiPanel panel = (MultiPanel)context.Instance; foreach (MultiPanelPage page in panel.Controls) { SelectorNode node = new SelectorNode(page.Name, page); selector.Nodes.Add(node); if (page != panel.SelectedPage) { continue; } selector.SelectedNode = node; return; } }
/// <summary> /// Event handler for the "Add Page" verb. /// </summary> /// <param name="panel"></param> private static void AddPage(IDesignerHost dh, MultiPanel panel) { DesignerTransaction dt = dh.CreateTransaction("Added new page"); MultiPanelPage oldSelectedPage = panel.SelectedPage; // Gets a free name int i = 1; while (panel.Controls.Cast <Control>().Any(x => x.Name == "Page" + i)) { i++; } var name = "Page" + i; // Creates the page MultiPanelPage newPage = dh.CreateComponent(typeof(MultiPanelPage), name) as MultiPanelPage; newPage.Text = name; panel.Controls.Add(newPage); // Update selection panel.SelectedPage = newPage; dt.Commit(); }
IEnumerator NextPicture() { InRoutine = true; if (components[index].DoneWithSlide()) { yield return(new WaitForSeconds(TimeOnPicture)); } ++index; if (index < components.Length) { components[index].OnSlide(); yield return(new WaitForSeconds(TimeOnPicture)); } else { OnPanel = false; MultiPanel p = GetComponentInParent <MultiPanel>(); if (p == null || !p.NextPart()) { ChapterManager.instance.NextPanel(); } } InRoutine = false; }
/// <summary> /// Event handler for the "Select X page" handler. /// </summary> /// <param name="panel"></param> /// <param name="page"></param> /// <returns></returns> private static void SelectPage(IDesignerHost dh, MultiPanel panel, MultiPanelPage page) { DesignerTransaction dt = dh.CreateTransaction("Selected page"); MultiPanelPage oldSelectedPage = panel.SelectedPage; panel.SelectedPage = page; dt.Commit(); }
public MultiPanelPagesCollection(Control owner) : base(owner) { if (owner == null) throw new ArgumentNullException("owner", "Tried to create a MultiPanelPagesCollection with a null owner."); _owner = owner as MultiPanel; if (_owner == null) throw new ArgumentException("Tried to create a MultiPanelPagesCollection with a non-MultiPanel owner.", "owner"); }
//The constructor associates the control //with the smart tag list. public MultiPanelActionList(IComponent component) : base(component) { this.multiPanel = component as MultiPanel; // Cache a reference to DesignerActionUIService, so the // DesigneractionList can be refreshed. this.designerActionUISvc = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService; }
/// <summary> /// Gets the collection of verbs displayed in the top right menu of the designer. /// </summary> /// <param name="panel"></param> /// <returns></returns> public static DesignerVerbCollection GetDesignerVerbs(IDesignerHost host, MultiPanel panel) { var verbs = new DesignerVerbCollection(); verbs.Add(new DesignerVerb("Add Page", (sender, args) => AddPage(host, panel))); verbs.Add(new DesignerVerb("Remove Page", (sender, args) => RemovePage(host, panel))); foreach (MultiPanelPage page in panel.Controls) { var pageCopy = page; verbs.Add(new DesignerVerb("Select \"" + page.Text + "\"", (sender, args) => SelectPage(host, panel, pageCopy))); } return verbs; }
void OnMouseDown() { if (!BeenClicked) { BeenClicked = true; audioManager.instance.Play("onClick"); MultiPanel p = GetComponentInParent <MultiPanel>(); if (p == null || !p.NextPart()) { Debug.Log("NO MORE PANELS"); ChapterManager.instance.NextPanel(); } } }
protected void EnumerateMembership(GISADataset.TrusteeRow CurrentTrusteeRow) { lvMembers.Items.Clear(); if (CurrentTrusteeRow.RowState == DataRowState.Detached) { MessageBox.Show("Não é possível editar o utilizador selecionado uma vez que foi apagado.", "Edição de Utilizador", MessageBoxButtons.OK, MessageBoxIcon.Warning); MultiPanel.Recontextualize(); return; } foreach (GISADataset.UserGroupsRow ug in GisaDataSetHelper.GetInstance().UserGroups.Select(string.Format("IDUser={0} OR IDGroup={0}", CurrentTrusteeRow.ID))) { DisplayMembership(ug); } }
/// <summary> /// Event handler for the "Remove Tab" verb. /// </summary> /// <param name="dh"></param> /// <param name="panel"></param> private static void RemovePage(IDesignerHost dh, MultiPanel panel) { MultiPanelPage page = panel.SelectedPage; if (page == null) return; DesignerTransaction dt = dh.CreateTransaction("Removed page"); panel.Controls.Remove(page); dh.DestroyComponent(page); panel.SelectedPage = panel.Controls.Count > 0 ? (MultiPanelPage)panel.Controls[0] : null; dt.Commit(); }
/// <summary> /// Gets the collection of verbs displayed in the top right menu of the designer. /// </summary> /// <param name="panel"></param> /// <returns></returns> public static DesignerVerbCollection GetDesignerVerbs(IDesignerHost host, MultiPanel panel) { var verbs = new DesignerVerbCollection(); verbs.Add(new DesignerVerb("Add Page", (sender, args) => AddPage(host, panel))); verbs.Add(new DesignerVerb("Remove Page", (sender, args) => RemovePage(host, panel))); foreach (MultiPanelPage page in panel.Controls) { var pageCopy = page; verbs.Add(new DesignerVerb("Select \"" + page.Text + "\"", (sender, args) => SelectPage(host, panel, pageCopy))); } return(verbs); }
private bool m_IsMouseOverClickableBox = false; // indicates mouse is over a clickable region. // #endregion// members #region Constructors // ***************************************************************** // **** Constructors **** // ***************************************************************** // // public Cluster(GuiTemplates.EngineContainerGui guiTemplate) { InitializeComponent(); m_Name = guiTemplate.DisplayName; m_EngineContainerID = guiTemplate.EngineContainerID; this.Name = string.Format("Cluster{0}", m_EngineContainerID.ToString()); m_Configuration = new ClusterConfiguration(); //clusterConfig.Clone(); m_Header = new Header(this, guiTemplate); // creates PopUp controls for engines. m_LowerControl = new Huds.MultiPanel(this, guiTemplate); InitializeBoxRowControl(guiTemplate); // creates BoxRows InitializeLayout(); // does layout for all controls. RegisterMouseEvents(); }
public void ShowMultiPanel(bool y) { if (y) { BackToHomeButton.SetActive(false); ModesPage.SetActive(false); MultiPanel.SetActive(true); BackButton2.SetActive(true); } else { MultiPanel.SetActive(false); BackButton2.SetActive(false); BackToHomeButton.SetActive(true); ModesPage.SetActive(true); } }
public override void Initialize(IComponent component) { _mpanel = component as MultiPanel; if (_mpanel == null) { this.DisplayError(new ArgumentException("Tried to use the MultiPanelControlDesign with a class that does not inherit from MultiPanel.", "component")); return; } base.Initialize(component); IComponentChangeService iccs = (IComponentChangeService)this.GetService(typeof(IComponentChangeService)); if (iccs != null) { iccs.ComponentRemoved += new ComponentEventHandler(ComponentRemoved); } ISelectionService s = (ISelectionService)GetService(typeof(ISelectionService)); if (s != null) { s.SelectionChanged += new EventHandler(s_SelectionChanged); } }
/// <summary> /// Main method. /// </summary> /// <param name="selection"></param> /// <param name="context"></param> /// <param name="provider"></param> protected override void FillTreeWithData(Selector selection, ITypeDescriptorContext context, IServiceProvider provider) { // Base method, clear the selection base.FillTreeWithData(selection, context, provider); // Scroll through the pages MultiPanel panel = (MultiPanel)context.Instance; foreach (MultiPanelPage page in panel.Controls) { SelectorNode node = new SelectorNode(page.Name, page); selection.Nodes.Add(node); if (page == panel.SelectedPage) { selection.SelectedNode = node; return; } } }
private void DeleteItems() { this.Cursor = Cursors.WaitCursor; if (((DataRow)(lvMembers.SelectedItems[0].Tag)).RowState == DataRowState.Detached) { ListViewItem item = lvMembers.SelectedItems[0]; lvMembers.SelectedItems.Clear(); lvMembers.Items.Remove(item); } else { GUIHelper.GUIHelper.deleteSelectedLstVwItems(lvMembers); PersistencyHelper.save(); PersistencyHelper.cleanDeletedData(); } MultiPanel.Recontextualize(); this.Cursor = Cursors.Default; }
// Update is called once per frame void Update() { if (Pressed && OnPanel) { if (HoldUXIndicator) { HoldUXIndicator.SetActive(false); } if (RoundToOneDP(timer) % SpriteChangeTimer == 0) { if (timer < totalTime) { SpriteRend.sprite = Sprites[(int)(timer / SpriteChangeTimer)]; if ((int)(timer / SpriteChangeTimer) == Sprites.Count - 1 && TimesLooped == TimesToRepeat) { ShowAllEndObjects(); } } else { if (TimesLooped == TimesToRepeat) { OnPanel = false; MultiPanel p = GetComponentInParent <MultiPanel>(); if (p == null || !p.NextPart()) { Debug.Log("activating next panel from hold click times "); ChapterManager.instance.NextPanel(); } } else { timer = 0f; TimesLooped += 1; } } } timer += Time.deltaTime; } }
// Can only be instantiated by MultiPanel. internal PanelPaneCollection(MultiPanel parent) { // Save off reference to parent control. _parent = parent; }