Пример #1
0
        //---------------------------------------------------------------------------------
        private void FormContainer_ResizeEnd(object sender, EventArgs e)
        {
            _UserMove = false;
            DockStyle dock = ControlContainerInterfaceList.pickAnchor(out ControlContainerInterface container);

            ControlContainerInterfaceList.hideAnchors();

            if (container == null || dock == DockStyle.None)
            {
                return;
            }

            if (dock != DockStyle.Fill)
            {
                container = container.Split(dock);
            }

            List <GuiControlInterface> allControls = GetAllControl();

            foreach (GuiControlInterface tc in allControls)
            {
                container.Add(tc);
            }
            FormContainer.UpdateName(container.GetControl());

            Close();
        }
Пример #2
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (Capture && _MovedTaxonControl != null)
            {
                Rectangle R = _HeaderRect;
                R.Inflate(5, 5);

                if (!R.Contains(e.Location))
                {
                    FormContainer form = FormContainer.GetFormContainer(this);

                    GuiControlInterface tuc = _MovedTaxonControl;
                    Remove(_MovedTaxonControl, false);

                    FormContainer moveForm = new FormContainer(tuc);
                    moveForm.Show();

                    Point global = Cursor.Position;
                    moveForm.Left = global.X - 20;
                    moveForm.Top  = global.Y - 8;

                    FormContainer tempForm = moveForm;
                    SendMessage(this.Handle.ToInt32(), WM_LBUTTONUP, 0, 0);
                    SendMessage(tempForm.Handle.ToInt32(), WM_SYSCOMMAND, SC_MOVE | 0x02, 0);

                    CloseIfEmpty();

                    if (form != null)
                    {
                        form.UpdateName();
                    }
                }
                else
                {
                    for (int i = 0; i < Children.Count; i++)
                    {
                        if (Children[i] == _MovedTaxonControl)
                        {
                            continue;
                        }

                        if (_ChildrenRect[i].Left <e.Location.X && _ChildrenRect[i].Right> e.Location.X)
                        {
                            Children.Remove(_MovedTaxonControl);
                            Children.Insert(i, _MovedTaxonControl);
                            Invalidate();
                            break;
                        }
                    }
                }
            }
        }
Пример #3
0
        //-------------------------------------------------------------------
        // build descriptor from form
        //
        public static FormContainerDesc FromFormContainer(FormContainer _form)
        {
            FormContainerDesc desc = new FormContainerDesc();

            desc.Placement = winFunctions.winGetPlacement(_form.Handle);

            if (_form.Controls[0] is GUI.ControlContainerTabs)
            {
                desc._TaxonTabControlsDescriptor = GUI.ControlContainerTabsDesc.FromTaxonTabControls(_form.Controls[0] as GUI.ControlContainerTabs);
            }
            else if (_form.Controls[0] is GUI.ControlContainerSplitter)
            {
                desc.SplitterContainerDescriptor = GUI.ControlContainerSplitterDesc.FromTaxonSplitterContainer(_form.Controls[0] as GUI.ControlContainerSplitter);
            }
            return(desc);
        }
Пример #4
0
        //-------------------------------------------------------------------
        // rebuild form from descriptor
        //
        public FormContainer Rebuild()
        {
            FormContainer form = null;

            if (_SplitterContainerDescriptor != null)
            {
                GUI.ControlContainerSplitter split = _SplitterContainerDescriptor.Rebuild();
                form = new FormContainer(split);
            }
            else if (_TaxonTabControlsDescriptor != null)
            {
                GUI.ControlContainerTabs tabControl = _TaxonTabControlsDescriptor.Rebuild();
                form = new FormContainer(tabControl);
            }

            if (form != null && winFunctions.winPlacementIsValid(Placement))
            {
                winFunctions.winSetPlacement(form.Handle, Placement);
            }

            return(form);
        }