Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 public BuzzleNavBarItem(BuzzleGlobalView targetForm)
 {
     TargetForm = targetForm;
 }
Exemplo n.º 4
0
 public BuzzleNavBarItem(BuzzleGlobalView targetForm)
 {
     TargetForm = targetForm;
     Caption = targetForm.Text;
 }
Exemplo n.º 5
0
 public FormManagerEventArgs(BuzzleGlobalView thisForm)
 {
     FormInQuestion = thisForm;
 }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
 public bool IsCurrentForm(BuzzleGlobalView thisForm)
 {
     return thisForm.IsCurrentForm;
 }
Exemplo n.º 8
0
 public bool FormIsOpen(BuzzleGlobalView thisForm)
 {
     return OpenForms.Any(form => form.Name == thisForm.Name);
 }
Exemplo n.º 9
0
 private void LoadNewForm(BuzzleGlobalView thisForm)
 {
     AddNavBarItem(thisForm);
     OpenForms.Add(thisForm);
     SetAsCurrentForm(thisForm);
     FormAdded(this, new FormManagerEventArgs(thisForm));
 }
Exemplo n.º 10
0
 private void RemoveNavBarItem(BuzzleGlobalView thisForm)
 {
     var navBarItem = thisForm.NavBarLink;
     CurrentNavBarGroup.ItemLinks.Remove(navBarItem);
 }
Exemplo n.º 11
0
 private BuzzleGlobalView GetOpenForm(BuzzleGlobalView thisForm)
 {
     return OpenForms.FirstOrDefault(form => form.Name == thisForm.Name);
 }
Exemplo n.º 12
0
 private void AddNavBarItem(BuzzleGlobalView thisForm)
 {
     var navBarItem = new BuzzleNavBarItem(thisForm);
     navBarItem.LinkClicked += NavBarItemClicked;
     thisForm.NavBarLink = navBarItem;
     CurrentNavBarGroup.ItemLinks.Add(navBarItem);
 }
Exemplo n.º 13
0
 public void UnSetAsCurrentForm(BuzzleGlobalView thisForm)
 {
     thisForm.IsCurrentForm = false;
     thisForm.NavBarLink.IsCurrent = false;
     CurrentFormChanged(this, new EventArgs());
 }
Exemplo n.º 14
0
 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());
 }
Exemplo n.º 15
0
        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();
            }
        }