public void CloseForm(BuzzleGlobalView thisForm) { if (FormIsOpen(thisForm)) { var form = GetOpenForm(thisForm); RemoveNavBarItem(form); OpenForms.Remove(form); } UnSetAsCurrentForm(thisForm); thisForm.Close(); FormClosed(this, new FormManagerEventArgs(thisForm)); }
private void ShowForm(BuzzleGlobalView thisForm) { ClearScreen(); if (thisForm == null) { return; } this.IsMdiContainer = true; thisForm.TopLevel = false; panel_Display.Controls.Add(thisForm); thisForm.FormBorderStyle = FormBorderStyle.None; thisForm.Dock = DockStyle.Fill; thisForm.Show(); }
public BuzzleNavBarItem(BuzzleGlobalView targetForm) { TargetForm = targetForm; }
public BuzzleNavBarItem(BuzzleGlobalView targetForm) { TargetForm = targetForm; Caption = targetForm.Text; }
public FormManagerEventArgs(BuzzleGlobalView thisForm) { FormInQuestion = thisForm; }
public void OpenForm(BuzzleGlobalView thisForm, bool CloseAnyExistingInstance = false) { //If the form is not already open, open it, case closed. if (FormIsOpen(thisForm) != true) { LoadNewForm(thisForm); return; } //If the form is already open and we did not //specify to close existing instances, just load the existing instance //on the screen. Easy right? if (CloseAnyExistingInstance == false) { SetAsCurrentForm(thisForm); return; } //Finally, if the above are all not satisfied, then it is clear //what must be done, kill the existing instance and load a fresh one CloseForm(thisForm); LoadNewForm(thisForm); }
public bool IsCurrentForm(BuzzleGlobalView thisForm) { return thisForm.IsCurrentForm; }
public bool FormIsOpen(BuzzleGlobalView thisForm) { return OpenForms.Any(form => form.Name == thisForm.Name); }
private void LoadNewForm(BuzzleGlobalView thisForm) { AddNavBarItem(thisForm); OpenForms.Add(thisForm); SetAsCurrentForm(thisForm); FormAdded(this, new FormManagerEventArgs(thisForm)); }
private void RemoveNavBarItem(BuzzleGlobalView thisForm) { var navBarItem = thisForm.NavBarLink; CurrentNavBarGroup.ItemLinks.Remove(navBarItem); }
private BuzzleGlobalView GetOpenForm(BuzzleGlobalView thisForm) { return OpenForms.FirstOrDefault(form => form.Name == thisForm.Name); }
private void AddNavBarItem(BuzzleGlobalView thisForm) { var navBarItem = new BuzzleNavBarItem(thisForm); navBarItem.LinkClicked += NavBarItemClicked; thisForm.NavBarLink = navBarItem; CurrentNavBarGroup.ItemLinks.Add(navBarItem); }
public void UnSetAsCurrentForm(BuzzleGlobalView thisForm) { thisForm.IsCurrentForm = false; thisForm.NavBarLink.IsCurrent = false; CurrentFormChanged(this, new EventArgs()); }
public void SetAsCurrentForm(BuzzleGlobalView passedForm) { var thisForm = GetOpenForm(passedForm); thisForm.IsCurrentForm = true; OpenForms.Where(form => form != thisForm).ForEach(form => form.IsCurrentForm = false); thisForm.NavBarLink.IsCurrent = true; UpdateNavBarAppearance(thisForm.NavBarLink); CurrentFormChanged(this, new EventArgs()); }
public static void SwitchFocus(BuzzleGlobalView thisForm, DevExpress.XtraGrid.Views.Grid.GridView gridView = null) { if (thisForm.ActiveControl != null) thisForm.ActiveControl.SelectNextControl(thisForm.ActiveControl, true, true, false, true); else thisForm.SelectNextControl(thisForm, true, true, true, true); if (gridView != null) { gridView.CloseEditor(); gridView.UpdateCurrentRow(); } }