Example #1
0
        /// <summary>
        /// Occurs when tab button is removed
        /// </summary>
        /// <param name="button">button removed</param>
        protected override void OnButtonRemoved(TabButton button)
        {
            PagesPanel.Remove((Form)button.Page);

             for (int index = _cachedInfos.Count - 1; index >= 0; index--)
             {
            if (_cachedInfos[index].Button == button)
            {
               _cachedInfos.RemoveAt(index);
               break;
            }
             }

             EventHandler<FormEventArgs> handler = FormRemoved;
             if (handler != null)
             {
            FormEventArgs args = new FormEventArgs((Form)button.Page);
            handler(this, args);
             }
        }
        /// <summary>
        /// On form removed from view
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">event args</param>
        private void OnFormRemovedFromPanel(object sender, FormEventArgs e)
        {
            TabButton button = GetButton(e.Form);

            RemoveButton(button);
        }
Example #3
0
 /// <summary>
 /// Occurs when tab button is added
 /// </summary>
 /// <param name="button">button added</param>
 protected override void OnButtonAdded(TabButton button)
 {
     EventHandler<FormEventArgs> handler = FormAdded;
      if (handler != null)
      {
     FormEventArgs args = new FormEventArgs((Form)button.Page);
     handler(this, args);
      }
 }
Example #4
0
 /// <summary>
 /// On form removed from view
 /// </summary>
 /// <param name="sender">sender of the event</param>
 /// <param name="e">event args</param>
 private void OnFormRemovedFromPanel(object sender, FormEventArgs e)
 {
     TabButton button = GetButton(e.Form);
      RemoveButton(button);
 }
Example #5
0
 /// <summary>
 /// Event received after a form was closed
 /// </summary>
 /// <param name="sender">sender of the event</param>
 /// <param name="e">event args</param>
 private void OnDockerFormClosed(object sender, FormEventArgs e)
 {
     EventHandler<FormEventArgs> handler = FormClosed;
      if (handler != null)
      {
     handler(this, e);
      }
 }
Example #6
0
        /// <summary>
        /// Occurs when undock form from view is raised
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">event argument</param>
        private void OnUndockFormFromView(object sender, FormEventArgs e)
        {
            Point position = _host.PointToClient(Control.MousePosition);

            Undock(e.Form, new Rectangle(position.X - 150, position.Y - 4, 300, 300));
        }
Example #7
0
 void OnDockerFormClosed(object sender, FormEventArgs e)
 {
     e.Form.Close();
 }
Example #8
0
        /// <summary>
        /// Occurs when pages close button was clicked
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">event arguments</param>
        private void OnViewCloseClick(object sender, FormEventArgs e)
        {
            EventHandler<DockableFormClosingEventArgs> closingHandler = FormClosing;
             if (closingHandler != null)
             {
            DockableFormClosingEventArgs args = new DockableFormClosingEventArgs(e.Form);
            closingHandler(this, args);
            if (args.Cancel)
            {
               return;
            }
             }

             Remove(GetFormInfo(e.Form));

             EventHandler<FormEventArgs> handler = FormClosed;
             if (handler != null)
             {
            FormEventArgs args = new FormEventArgs(e.Form);
            handler(this, args);
             }
        }
Example #9
0
 /// <summary>
 /// Occurs when pages context menu button was clicked
 /// </summary>
 /// <param name="sender">sender of the event</param>
 /// <param name="e">event arguments</param>
 private void OnViewContextMenuClick(object sender, FormEventArgs e)
 {
     EventHandler<FormContextMenuEventArgs> handler = ShowContextMenu;
      if (handler != null)
      {
     Point menuLocation = Control.MousePosition;
     menuLocation       = e.Form.PointToClient(menuLocation);
     menuLocation.Y     = 0;
     FormContextMenuEventArgs args = new FormContextMenuEventArgs(e.Form, menuLocation);
     handler(this, args);
      }
 }
Example #10
0
 private void _docker_FormClosed(object sender, FormEventArgs e)
 {
     if (e.Form.GetType() == typeof(DataTable_Form))
     {
         m_DataTable_Form.Dispose();
         m_DataTable_Form = null;
     }
     else if (e.Form.GetType() == typeof(EditTable_Form))
     {
         m_EditTable_Form.Dispose();
         m_EditTable_Form = null;
         m_tbl.inpCtrlList.Clear();
     }
     else if (e.Form.GetType() == typeof(CreateView_Form))
     {
         m_CreateView_Form.Dispose();
         m_CreateView_Form = null;
         m_tbl.DefineView_inpCtrlList.Clear();
     }
     else if (e.Form.GetType() == typeof(TableView_Form))
     {
         int i;
         for (i = 0; i < guid.MaxTableViews; i++)
         {
             if (e.Form == m_TableView_Form[i])
             {
                 m_TableView_Form[i].Dispose();
                 m_TableView_Form[i] = null;
             }
         }
     }
 }
Example #11
0
 /// <summary>
 /// Occurs when undock form from view is raised
 /// </summary>
 /// <param name="sender">sender of the event</param>
 /// <param name="e">event argument</param>
 private void OnUndockFormFromView(object sender, FormEventArgs e)
 {
     Point position = _host.PointToClient(Control.MousePosition);
      Undock(e.Form, new Rectangle(position.X - 150, position.Y - 4, 300, 300));
 }
Example #12
0
		private void mDockContainer_FormClosed(object sender, FormEventArgs e)
		{
			RemoveDisposedLevelToolWindows();
		}
Example #13
0
      /// <summary>
      /// Occurs when a dockable form was closed
      /// </summary>
      /// <param name="sender">sender of the event</param>
      /// <param name="e">event arguments</param>
      private void OnFormClosed(object sender, FormEventArgs e)
      {
         Remove(GetFormInfo(e.Form));

         EventHandler<FormEventArgs> handler = FormClosed;
         if (handler != null)
         {
            handler(this, e);
         }
      }
 /// <summary>
 /// On form added to view
 /// </summary>
 /// <param name="sender">sender of the event</param>
 /// <param name="e">event args</param>
 private void OnFormAddedToPanel(object sender, FormEventArgs e)
 {
     AddButton(new TabButton(e.Form));
 }
Example #15
0
 /// <summary>
 /// Occurs when pages close button was clicked
 /// </summary>
 /// <param name="sender">sender of the event</param>
 /// <param name="e">event arguments</param>
 private void OnPagesCloseClick(object sender, EventArgs e)
 {
     EventHandler<FormEventArgs> handler = CloseClick;
      if (handler != null)
      {
     FormEventArgs args = new FormEventArgs(GetPageAt(SelectedIndex));
     handler(this, args);
      }
 }
Example #16
0
      /// <summary>
      /// Occurs when tab button is removed
      /// </summary>
      /// <param name="button">button removed</param>
      protected override void OnButtonRemoved(TabButton button)
      {
         Form page = (Form)button.Page;
         page.FormClosing    -= OnPageClosing;
         page.FormClosed     -= OnPageClosed;
         page.ParentChanged  -= OnPageParentChanged;

         PagesPanel.Remove(page);

         DockableFormInfo info = null;
         for (int index = _cachedInfos.Count - 1; index >= 0; index--)
         {
            if (_cachedInfos[index].Button == button)
            {
               info = _cachedInfos[index];
               _cachedInfos.RemoveAt(index);

               info.ExplicitDisposing -= OnInfoDisposing;
               info.SelectedChanged   -= OnInfoSelectedChanged;

               break;
            }
         }

         EventHandler<FormEventArgs> handler = FormRemoved;
         if (handler != null)
         {
            FormEventArgs args = new FormEventArgs(page, info.Id);
            handler(this, args);
         }
      }
Example #17
0
 /// <summary>
 /// Occurs when pages context menu button was clicked
 /// </summary>
 /// <param name="sender">sender of the event</param>
 /// <param name="e">event arguments</param>
 private void OnPagesContextMenuClick(object sender, EventArgs e)
 {
     EventHandler<FormEventArgs> handler = ContextMenuClick;
      if (handler != null)
      {
     FormEventArgs args = new FormEventArgs(PagesPanel.GetFormAt(SelectedIndex));
     handler(this, args);
      }
 }
Example #18
0
 /// <summary>
 /// Occurs when tab button is added
 /// </summary>
 /// <param name="button">button added</param>
 protected override void OnButtonAdded(TabButton button)
 {
    EventHandler<FormEventArgs> handler = FormAdded;
    if (handler != null)
    {
       DockableFormInfo info = GetPageInfo((Form)button.Page);
       FormEventArgs args    = new FormEventArgs(info.DockableForm, info.Id);
       handler(this, args);
    }
 }
Example #19
0
 void view_FormSelected(object sender, FormEventArgs e)
 {
 }
Example #20
0
 /// <summary>
 /// Occurs when pages context menu button was clicked
 /// </summary>
 /// <param name="sender">sender of the event</param>
 /// <param name="e">event arguments</param>
 private void OnPagesContextMenuClick(object sender, EventArgs e)
 {
    EventHandler<FormEventArgs> handler = ContextMenuClick;
    if (handler != null)
    {
       DockableFormInfo info = GetPageInfo(PagesPanel.GetFormAt(SelectedIndex));
       FormEventArgs args = new FormEventArgs(info.DockableForm, info.Id);
       handler(this, args);
    }
 }
Example #21
0
 /// <summary>
 /// On form added to view
 /// </summary>
 /// <param name="sender">sender of the event</param>
 /// <param name="e">event args</param>
 private void OnFormAddedToPanel(object sender, FormEventArgs e)
 {
     AddButton(new TabButton(e.Form));
 }
Example #22
0
      /// <summary>
      /// Occurs when the page is closed
      /// </summary>
      /// <param name="sender">sender of the event</param>
      /// <param name="e">event argument</param>
      private void OnPageClosed(object sender, FormClosedEventArgs e)
      {
         DockableFormInfo info = GetPageInfo((Form)sender);
         Guid id          = info.Id;
         Form form        = info.DockableForm;
         TabButton button = GetButton(form);
         button.Dispose();

         EventHandler<FormEventArgs> handler = FormClosed;
         if (handler != null)
         {
            FormEventArgs args = new FormEventArgs(form, id);
            handler(this, args);
         }
      }
Example #23
0
 /// <summary>
 /// On form selected into view
 /// </summary>
 /// <param name="sender">sender of the event</param>
 /// <param name="e">event args</param>
 private void OnFormSelectedIntoView(object sender, FormEventArgs e)
 {
     TabButton button = GetButton(e.Form);
      SelectedButton   = button;
 }
Example #24
0
        /// <summary>
        /// Begin button drag
        /// </summary>
        /// <param name="selected">selected button</param>
        /// <param name="mousePosition">mouse position</param>
        /// <param name="cursor">cursor</param>
        /// <returns>true if button drag is started</returns>
        protected override bool BeginButtonDrag(TabButton selected, Point mousePosition, ref Cursor cursor)
        {
            EventHandler<FormEventArgs> handler = UndockForm;
             if (handler != null)
             {
            _movedButton   = selected;
            _movedForm     = (Form)_movedButton.Page;
            _movedIndex    = SelectedIndex;

            Point mouseScreenPosition = Control.MousePosition;
            FormEventArgs args  = new FormEventArgs(_movedForm);
            handler(this, args);

            RemoveButton(_movedButton);

            _movedDecorator = HierarchyUtility.GetFormsDecorator(_movedForm);
            _movedDecorator.BeginMovementByMouse(mouseScreenPosition);

            cursor = Cursors.SizeAll;
             }

             return true;
        }
Example #25
0
 void OnDockerFormClosed(object sender, FormEventArgs e)
 {
     e.Form.Close();
 }
        /// <summary>
        /// On form selected into view
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">event args</param>
        private void OnFormSelectedIntoView(object sender, FormEventArgs e)
        {
            TabButton button = GetButton(e.Form);

            SelectedButton = button;
        }