/// <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) { if (CanMoveByMouse == false) { return(true); } EventHandler <FormEventArgs> handler = UndockForm; if (handler != null) { _movedButton = selected; _movedForm = (Form)_movedButton.Page; _movedIndex = SelectedIndex; Point mouseScreenPosition = Control.MousePosition; FormEventArgs args = new FormEventArgs(_movedForm, GetPageInfo(_movedForm).Id); handler(this, args); RemoveButton(_movedButton); _movedDecorator = HierarchyUtility.GetFormsDecorator(_movedForm); IsFocused = false; _movedDecorator.IsFocused = true; _movedDecorator.BeginMovementByMouse(mouseScreenPosition); cursor = Cursors.SizeAll; } return(true); }
// MI 20100712 public void SetCaption(DockableFormInfo dfi, string caption) { FormsDecorator fd = HierarchyUtility.GetFormsDecorator(dfi.DockableForm); fd.TitleBarRenderer.Text = caption; fd.Invalidate(true); }
/// <summary> /// Get tabbed host /// </summary> /// <param name="form">form</param> /// <returns>tabbed host</returns> public static FormsTabbedView GetTabbedView(Form form) { FormsDecorator decorator = GetFormsDecorator(form); if (decorator == null) { return(null); } return((FormsTabbedView)decorator.Parent); }
/// <summary> /// End button drag /// </summary> /// <param name="cancel">cancel</param> protected override void EndButtonDrag(bool cancel) { if (cancel) { InsertButton(_movedButton, _movedIndex); } else if (_movedDecorator != null) { _movedDecorator.EndMovementByMouse(); _movedDecorator = null; } }
/// <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; }