public List <object> Search(CriteriaLine criteria = null)
        {
            if (_selectProperties.SelectedIndex > 0)
            {
                _searchList.Select(_selectProperties.GetSelectedProperties());
            }

            /*if (SelectProperties.SelectedProperty.IsList)
             * SearchList.Select(SelectProperties.SelectedProperty.Name, SelectProperties.SelectedProperty.Type.GetGenericArguments()[0]);
             * else
             * SearchList.Select(SelectProperties.SelectedProperty.Name, SelectProperties.SelectedProperty.Type);*/
            else
            {
                _searchList.ResetSelect();
            }

            _searchList.Search(SelectionPanel.BuildQuery());
            _searchList.SubListSearch(SearchPanel.BuildQuery(criteria));
            if (criteria == null)
            {
                _searchList.OrderBy(OrderByPanel.BuildQuery());
            }

            return(_searchList.GetResults());
        }
Beispiel #2
0
    public void Setup(PlayableData data, SelectionPanel panel, int pushNb)
    {
        this.data       = data;
        buttonText.text = data.name;
        this.pushNb     = pushNb;

        selectionPanel = panel;
    }
Beispiel #3
0
        private void SelectSubListChanged(object sender, EventArgs e)
        {
            if (SelectProperties.SelectedIndex > 0)
            {
                SelectionPanel.Visible = true;
                if (SelectionPanel.Criteria.Count == 0)
                {
                    SelectionPanel.AddNew();
                }
            }
            else
            {
                SelectionPanel.Visible = false; SelectionPanel.Clear();
            }

            Type selectedType = SelectProperties.GetLowestPropertyType();

            if (selectedType.IsGenericType)
            {
                selectedType = selectedType.GetGenericArguments()[0];
            }

            SearchPanel.Clear();
            SearchPanel.CriteriaType = selectedType;
            SearchPanel.AddNew();

            OrderByPanel.Clear();
            OrderByPanel.CriteriaType = selectedType;
            OrderByPanel.AddNew();
            PanelResized(this, null);

            if (SelectProperties.SelectedIndex > 0)
            {
                if (selectedType == typeof(Site) || selectedType == typeof(Battle))
                {
                    btnMapResults.Visible = true;
                }
                else
                {
                    btnMapResults.Visible = false;
                }
            }
            else if (SelectProperties.ParentType == typeof(Site) || SelectProperties.ParentType == typeof(Battle))
            {
                btnMapResults.Visible = true;
            }
            else
            {
                btnMapResults.Visible = false;
            }

            //if (SelectProperties.SelectedIndex != 0)
            //    lblSearchCriteria.Text = "Search " + SelectProperties.Text + " Where:";
            //else
            //    lblSearchCriteria.Text = "Search " + SelectList.Text + " Where:";
        }
Beispiel #4
0
    /// <summary>
    /// Initializes the controller variables.
    /// Intializes the UI Panels and creates them for every roboy part for every panel mode.
    /// </summary>
    void Start()
    {
        // get the selection panel
        m_SelectionPanel = GetComponentInChildren <SelectionPanel>();

        initializeFadePanels();

        // initialize the UI panels
        initializePanels();
    }
        public void ISOSelection()
        {
            writeLine("ISO selector");

            immersiveMode.Checked = Updater.cfg.getImmersiveMode();
            portableMode.Checked  = File.Exists("./portable.txt");

            UpdatePanel.Hide();
            SelectionPanel.Show();

            FlashWindowEx(this);
        }
Beispiel #6
0
        private void Init()
        {
            CurrentCircuit = BaseCircuit;
            toolBox        = new ToolBoxMenu();
            UI.Add(new SelectionPanel(toolBox, false));
            propMenu = new PropMenu();
            SelectionPanel s = new SelectionPanel(propMenu, true);

            s.pos.x = width;
            UI.Add(s);
            escapeKey = Keyboard.key("esc");
        }
        public void createPanel(string text, int x, int y, int width, int height, bool selected)
        {
            var panel = new SelectionPanel(this.screenPictureBox, this.selectionPanels, this.current_rez, text, x, y, width, height, selected);

            panel.OnSelectionChanged += (sender, e) =>
            {
                this.getColor();
                this.OnScreenChanged?.Invoke(this, e);
            };
            this.selectionPanels.Add(panel);
            this.getColor();
        }
    protected override void UpdateModes()
    {
        if (_modes == null || _mode < 0 || _mode >= _modes.Length)
        {
            return;
        }
        switch (_mode)
        {
        case 0:
            SelectionPanel <RectDesign> select = (SelectionPanel <RectDesign>)_modes[_mode];
            if (selected != select.selected)
            {
                selected = select.selected;
            }
            break;

        case 1:
            VertexPanel vertex = (VertexPanel)_modes[_mode];
            vertex.target = selected;
            break;

        case 2:
            TrianglePanel tri = (TrianglePanel)_modes[_mode];
            tri.target = selected;
            break;

        case 3:
            PlugPanel corner = (PlugPanel)_modes[_mode];
            corner.target = selected;
            if (selected != null)
            {
                corner.plugs = selected.cornerplugs;
            }
            else
            {
                corner.plugs = null;
            }
            break;

        case 4:
            PlugPanel edge = (PlugPanel)_modes[_mode];
            edge.target = selected;
            if (selected != null)
            {
                edge.plugs = selected.edgeplugs;
            }
            else
            {
                edge.plugs = null;
            }
            break;
        }
    }
 void Start()
 {
     selectionTool  = FindObjectOfType <SelectionTool>();
     cardCreator    = FindObjectOfType <CardSelector>();
     selectionPanel = FindObjectOfType <SelectionPanel>();
     selectionPanel.gameObject.SetActive(false);
     cameraRaycaster = FindObjectOfType <CameraRaycaster>();
     cameraRaycaster.layerChangeObservers += OnPathChange;
     Orange      = new Color(1, 0.5f, 0, 1);
     pauseScreen = FindObjectOfType <PauseScreen>();
     pauseScreen.gameObject.SetActive(false);
 }
Beispiel #10
0
        private void UpdateSelectionPanel()
        {
            int ox = -90;
            int oy = -76;

            int px = (int)Math.Round(SelectedMarker.ScreenPos.X, MidpointRounding.AwayFromZero) + ox;
            int py = (int)Math.Round(SelectedMarker.ScreenPos.Y, MidpointRounding.AwayFromZero) + oy;

            int sx = SelectionPanel.Width;
            int sy = SelectionPanel.Height;

            SelectionPanel.SetBounds(px, py, sx, sy);
        }
        public List <object> SearchSelection(CriteriaLine criteria = null)
        {
            if (_selectProperties.SelectedIndex > 0)
            {
                _searchList.Select(_selectProperties.GetSelectedProperties());
            }
            else
            {
                _searchList.ResetSelect();
            }

            _searchList.Search(SelectionPanel.BuildQuery(criteria));
            return(_searchList.GetSelection());
        }
Beispiel #12
0
 public void Dispose()
 {
     wrButtonPanel.Dispose();
     wrMain.Dispose();
     Minimap.Dispose();
     TeamDataPanel.Dispose();
     SelectionPanel.Dispose();
     UnitDataPanel.Dispose();
     BuildingDataPanel.Dispose();
     if (BuildingPanel != null)
     {
         BuildingPanel.Dispose();
     }
 }
Beispiel #13
0
 public void ShowSelectionPanel(UISelectionPanelType type)
 {
     HideUIPanel();
     switch (type)
     {
     case UISelectionPanelType.Character:
         var temp = Instantiate(_selectionPanel);
         temp.transform.SetParent(_canvas.transform, false);
         SelectionPanel newPanel = temp.GetComponent <SelectionPanel>();
         newPanel.InitPanel(type);
         UpdateCurrentPanel(newPanel.gameObject);
         break;
     }
 }
Beispiel #14
0
        public List <object> SearchSelection(CriteriaLine criteria = null)
        {
            if (SelectProperties.SelectedIndex > 0)
            {
                SearchList.Select(SelectProperties.GetSelectedProperties());
            }
            //SearchList.Select(SelectProperties.SelectedProperty.Name, SelectProperties.SelectedProperty.Type.GetGenericArguments()[0]);
            else
            {
                SearchList.ResetSelect();
            }

            SearchList.Search(SelectionPanel.BuildQuery(criteria));
            return(SearchList.GetSelection());
        }
 public void deselectThis()
 {
     if (_SelectedPanel != null)
     {
         if (editPanel && sizeWidth.Text != "" && sizeWidth.Text != "")
         {
             this.AcceptEdit(Convert.ToInt32(sizeWidth.Text), Convert.ToInt32(sizeHeight.Text));
         }
         else
         {
             SelectedPanel.CloseEdit();
         }
         _SelectedPanel.BorderStyle = BorderStyle.None;
         _SelectedPanel             = null;
     }
 }
Beispiel #16
0
    protected override void UpdateModes()
    {
        if (_modes == null || _mode < 0 || _mode >= _modes.Length)
        {
            return;
        }
        switch (_mode)
        {
        case 0:
            SelectionPanel <MapObject> select = (SelectionPanel <MapObject>)_modes[_mode];
            if (selected != select.selected)
            {
                selected = select.selected;
            }
            break;

        case 1:
            DesignMapPanel dmpanel = (DesignMapPanel)_modes[_mode];
            dmpanel.target = selected;
            break;

        case 2:
            CornerMapPanel cmpanel = (CornerMapPanel)_modes[_mode];
            cmpanel.target = selected;
            break;

        case 3:
            LateralMapPanel empanel = (LateralMapPanel)_modes[_mode];
            empanel.target = selected;
            break;

        case 4:
            LongitudeMapPanel lgmpanel = (LongitudeMapPanel)_modes[_mode];
            lgmpanel.target = selected;
            break;

        case 5:
            RectMapPanel rmpanel = (RectMapPanel)_modes[_mode];
            rmpanel.target = selected;
            break;

        case 6:
            HexagonMapPanel hmpanel = (HexagonMapPanel)_modes[_mode];
            hmpanel.target = selected;
            break;
        }
    }
        public List <object> Search(CriteriaLine criteria = null)
        {
            if (_selectProperties.SelectedIndex > 0)
            {
                _searchList.Select(_selectProperties.GetSelectedProperties());
            }
            else
            {
                _searchList.ResetSelect();
            }

            _searchList.Search(SelectionPanel.BuildQuery());
            _searchList.SubListSearch(SearchPanel.BuildQuery(criteria));
            if (criteria == null)
            {
                _searchList.OrderBy(OrderByPanel.BuildQuery());
            }

            return(_searchList.GetResults());
        }
Beispiel #18
0
    /// <summary>
    /// Initializes the controller variables.
    /// Intializes the UI Panels and creates them for every roboy part for every panel mode.
    /// </summary>
    void Start()
    {
        m_SteamVRController = GetComponentInParent <SteamVR_TrackedObject>();
        // Find the controller and initialize the values to default
        m_SteamVRDevice = SteamVR_Controller.Input((int)m_SteamVRController.index);
        m_SteamVRDevice.Update();

        m_SteamVRTrackedController = GetComponentInParent <SteamVR_TrackedController>();

        // Find all template panels for fading
        List <Transform> allFadePanels =
            gameObject.GetComponentsInChildren <Transform>().Where(panel => panel.tag.Equals("FadePanelStruct")).ToList();

        // Initialize the fade panels
        foreach (var fadePanel in allFadePanels)
        {
            Transform fadeInPanel       = fadePanel.gameObject.GetComponentInChildWithTag <Transform>("FadeInPanel");
            Transform fadeOutPanel      = fadePanel.gameObject.GetComponentInChildWithTag <Transform>("FadeOutPanel");
            Transform fadeStandardPanel = fadePanel.gameObject.GetComponentInChildWithTag <Transform>("FadeStandardPanel");

            FadePanelStruct fadePanelStruct;
            fadePanelStruct.FadeInPanel       = fadeInPanel;
            fadePanelStruct.FadeOutPanel      = fadeOutPanel;
            fadePanelStruct.FadeStandardPanel = fadeStandardPanel;

            m_UIFadePanels.Add(fadeInPanel.parent.GetComponent <FadePanelTemplate>().Alignment, fadePanelStruct);

            fadePanel.gameObject.GetComponentInChildWithTag <Transform>("FadeInPanel").gameObject.SetActive(false);
            fadePanel.gameObject.GetComponentInChildWithTag <Transform>("FadeOutPanel").gameObject.SetActive(false);
            fadePanel.gameObject.GetComponentInChildWithTag <Transform>("FadeStandardPanel").gameObject.SetActive(false);
        }

        // get the selection panel
        m_SelectionPanel = GetComponentInChildren <SelectionPanel>();

        // initialize the UI panels
        InitializePanels();
    }
    protected override void UpdateModes()
    {
        if (_modes == null || _mode < 0 || _mode >= _modes.Length)
        {
            return;
        }
        switch (_mode)
        {
        case 0:
            SelectionPanel <CornerDesign> select = (SelectionPanel <CornerDesign>)_modes[_mode];
            if (selected != select.selected)
            {
                selected = select.selected;
            }
            break;

        case 1:
            VertexPanel vertex = (VertexPanel)_modes[_mode];
            vertex.target = selected;
            break;

        case 2:
            TrianglePanel tri = (TrianglePanel )_modes[_mode];
            tri.target = selected;
            break;

        case 3:
            SocketPanel edge = (SocketPanel)_modes[_mode];
            edge.target = selected;
            break;

        case 4:
            SocketPanel face = (SocketPanel)_modes[_mode];
            face.target = selected;
            break;
        }
    }
Beispiel #20
0
        private void SelectList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (SelectProperties != null)
            {
                SelectProperties.Remove();
            }
            SelectProperties                       = new PropertyBox();
            SelectProperties.Location              = new Point(SelectList.Right + 3, SelectList.Top);
            SelectProperties.ListPropertiesOnly    = true;
            SelectProperties.SelectedIndexChanged += new EventHandler(SelectSubListChanged);
            this.Controls.Add(SelectProperties);

            switch (SelectList.SelectedItem.ToString())
            {
            case "Historical Figures":
                SearchList = new SearchList <HistoricalFigure>(World.HistoricalFigures);
                SelectProperties.ParentType = typeof(HistoricalFigure);
                break;

            case "Entities":
                SearchList = new SearchList <Entity>(World.Entities);
                SelectProperties.ParentType = typeof(Entity);
                break;

            case "Sites":
                SearchList = new SearchList <Site>(World.Sites);
                SelectProperties.ParentType = typeof(Site);
                break;

            case "Regions":
                SearchList = new SearchList <WorldRegion>(World.Regions);
                SelectProperties.ParentType = typeof(WorldRegion);
                break;

            case "Underground Regions":
                SearchList = new SearchList <UndergroundRegion>(World.UndergroundRegions);
                SelectProperties.ParentType = typeof(UndergroundRegion);
                break;

            case "Wars":
                SearchList = new SearchList <War>(World.Wars);
                SelectProperties.ParentType = typeof(War);
                break;

            case "Battles":
                SearchList = new SearchList <Battle>(World.Battles);
                SelectProperties.ParentType = typeof(Battle);
                break;

            case "Conquerings":
                SearchList = new SearchList <SiteConquered>(World.EventCollections.OfType <SiteConquered>().ToList());
                SelectProperties.ParentType = typeof(SiteConquered);
                break;

            case "Beast Attacks":
                SearchList = new SearchList <BeastAttack>(World.BeastAttacks);
                SelectProperties.ParentType = typeof(BeastAttack);
                break;

            case "Artifacts":
                SearchList = new SearchList <Artifact>(World.Artifacts);
                SelectProperties.ParentType = typeof(Artifact);
                break;
            }

            if (SelectProperties.ParentType == typeof(Site) || SelectProperties.ParentType == typeof(Battle))
            {
                btnMapResults.Visible = true;
            }

            SelectionPanel.Clear();

            SelectionPanel.CriteriaType = SearchList.GetMainListType();
            SearchPanel.CriteriaType    = SelectProperties.GetLowestPropertyType();
            OrderByPanel.CriteriaType   = SelectProperties.GetLowestPropertyType();

            SelectSubListChanged(this, null);


            //lblSelectCriteria.Text = "Select " + SelectList.Text + " Where:";
            //lblSearchCriteria.Text = "Search " + SelectList.Text + " Where:";
            //lblOrderCriteria.Text = "Order " + SelectList.Text + " By:";
        }
        private void SelectList_SelectedIndexChanged(object sender, EventArgs e)
        {
            _selectProperties?.Remove();

            _selectProperties = new PropertyBox
            {
                Location           = new Point(SelectList.Right + 3, SelectList.Top),
                ListPropertiesOnly = true
            };
            _selectProperties.SelectedIndexChanged += SelectSubListChanged;
            Controls.Add(_selectProperties);

            switch (SelectList.SelectedItem.ToString())
            {
            case "Historical Figures":
                _searchList = new SearchList <HistoricalFigure>(World.HistoricalFigures);
                _selectProperties.ParentType = typeof(HistoricalFigure);
                break;

            case "Entities":
                _searchList = new SearchList <Entity>(World.Entities);
                _selectProperties.ParentType = typeof(Entity);
                break;

            case "Sites":
                _searchList = new SearchList <Site>(World.Sites);
                _selectProperties.ParentType = typeof(Site);
                break;

            case "Regions":
                _searchList = new SearchList <WorldRegion>(World.Regions);
                _selectProperties.ParentType = typeof(WorldRegion);
                break;

            case "Underground Regions":
                _searchList = new SearchList <UndergroundRegion>(World.UndergroundRegions);
                _selectProperties.ParentType = typeof(UndergroundRegion);
                break;

            case "Structures":
                _searchList = new SearchList <Structure>(World.Structures);
                _selectProperties.ParentType = typeof(Structure);
                break;

            case "Wars":
                _searchList = new SearchList <War>(World.Wars);
                _selectProperties.ParentType = typeof(War);
                break;

            case "Battles":
                _searchList = new SearchList <Battle>(World.Battles);
                _selectProperties.ParentType = typeof(Battle);
                break;

            case "Conquerings":
                _searchList = new SearchList <SiteConquered>(World.EventCollections.OfType <SiteConquered>().ToList());
                _selectProperties.ParentType = typeof(SiteConquered);
                break;

            case "Rampages":
                _searchList = new SearchList <BeastAttack>(World.BeastAttacks);
                _selectProperties.ParentType = typeof(BeastAttack);
                break;

            case "Raids":
                _searchList = new SearchList <Raid>(World.EventCollections.OfType <Raid>().ToList());
                _selectProperties.ParentType = typeof(Raid);
                break;

            case "Artifacts":
                _searchList = new SearchList <Artifact>(World.Artifacts);
                _selectProperties.ParentType = typeof(Artifact);
                break;

            case "Written Content":
                _searchList = new SearchList <WrittenContent>(World.WrittenContents);
                _selectProperties.ParentType = typeof(WrittenContent);
                break;
            }

            if (_selectProperties.ParentType == typeof(Site) || _selectProperties.ParentType == typeof(Battle))
            {
                btnMapResults.Visible = true;
            }

            SelectionPanel.Clear();

            SelectionPanel.CriteriaType = _searchList.GetMainListType();
            SearchPanel.CriteriaType    = _selectProperties.GetLowestPropertyType();
            OrderByPanel.CriteriaType   = _selectProperties.GetLowestPropertyType();

            SelectSubListChanged(this, null);
        }
            public SelectionPanel(PictureBox parentBox, List <SelectionPanel> panelList, int[] screenRes, string text, int x, int y, int width, int height, bool selected)
            {
                // Objs Properties
                {
                    this._parentBox = parentBox;
                    this._screenRes = screenRes;
                    this._panelList = panelList;
                    // panel
                    this.Cursor    = Cursors.SizeAll;
                    this.BackColor = System.Drawing.Color.FromArgb(150, 6, 215, 156);
                    this.Size      = new Size(width, height);
                    this.ForeColor = System.Drawing.Color.White;
                    this.Location  = new System.Drawing.Point(x, y);
                    this.TabStop   = false;
                    this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
                    this.SetStyle(ControlStyles.ResizeRedraw, true);
                    ToolTip tt = new ToolTip();
                    tt.AutomaticDelay = 2000;
                    tt.SetToolTip(this, "You can use Delete Escape Enter keys");
                    if (selected)
                    {
                        SelectedPanel = this;
                    }
                    // rectangle
                    this.rectangle = new System.Drawing.Rectangle();
                    // text
                    this.label.Location  = new System.Drawing.Point(10, 10);
                    this.label.AutoSize  = true;
                    this.label.TextAlign = ContentAlignment.MiddleCenter;
                    this.label.BackColor = System.Drawing.Color.FromArgb(0);
                    this.label.ForeColor = System.Drawing.Color.Black;
                    this.label.Text      = text;
                    this.label.TabStop   = false;
                    this.Controls.Add(this.label);
                    // edit text
                    this.editText.Location    = new System.Drawing.Point(10, 10);
                    this.editText.Visible     = false;
                    this.editText.BorderStyle = BorderStyle.Fixed3D;
                    this.editText.Font        = new Font("Microsoft Sans Serif", 9F);
                    this.editText.Text        = text;
                    this.editText.MaxLength   = 24;
                    this.editText.TabStop     = false;
                    this.Controls.Add(this.editText);
                    // edit button
                    this.editButton.Text      = "✎";
                    this.editButton.Cursor    = Cursors.Default;
                    this.editButton.FlatStyle = FlatStyle.Flat;
                    this.editButton.Font      = new Font("Times New Roman", 8F);
                    this.editButton.TextAlign = System.Drawing.ContentAlignment.TopLeft;
                    this.editButton.ForeColor = System.Drawing.Color.Black;
                    this.editButton.Size      = new Size(20, 20);
                    this.editButton.FlatAppearance.BorderSize = 0;
                    this.editButton.Padding = new Padding(0);
                    this.editButton.Margin  = new Padding(0);
                    this.editButton.TabStop = false;
                    this.Controls.Add(this.editButton);
                    // remove button
                    this.removeButton.Text      = "✕";
                    this.removeButton.Cursor    = Cursors.Default;
                    this.removeButton.FlatStyle = FlatStyle.Flat;
                    this.removeButton.Font      = new Font("Times New Roman", 8F);
                    this.removeButton.TextAlign = System.Drawing.ContentAlignment.TopLeft;
                    this.removeButton.ForeColor = System.Drawing.Color.Black;
                    this.removeButton.Size      = new Size(20, 20);
                    this.removeButton.FlatAppearance.BorderSize = 0;
                    this.removeButton.Padding = new Padding(0);
                    this.removeButton.Margin  = new Padding(0);
                    this.removeButton.TabStop = false;
                    this.Controls.Add(this.removeButton);
                    // widthLabel
                    this.widthLabel.AutoSize  = true;
                    this.widthLabel.Visible   = false;
                    this.widthLabel.BackColor = System.Drawing.Color.FromArgb(0);
                    this.widthLabel.ForeColor = System.Drawing.Color.Black;
                    this.widthLabel.Text      = "Width";
                    this.widthLabel.Anchor    = (AnchorStyles.Bottom | AnchorStyles.Left);
                    this.widthLabel.TabStop   = false;
                    this.Controls.Add(this.widthLabel);
                    // sizeWidth
                    this.sizeWidth.Visible     = false;
                    this.sizeWidth.BorderStyle = BorderStyle.Fixed3D;
                    this.sizeWidth.Font        = new Font("Microsoft Sans Serif", 9F);
                    this.sizeWidth.Minimum     = resize_grip;
                    this.sizeWidth.Maximum     = _parentBox.Width;
                    this.sizeWidth.Value       = this.Width;
                    this.sizeWidth.Anchor      = (AnchorStyles.Bottom | AnchorStyles.Left);
                    this.sizeWidth.TabStop     = false;
                    this.Controls.Add(this.sizeWidth);
                    // heightLabel
                    this.heightLabel.AutoSize  = true;
                    this.heightLabel.Visible   = false;
                    this.heightLabel.BackColor = System.Drawing.Color.FromArgb(0);
                    this.heightLabel.ForeColor = System.Drawing.Color.Black;
                    this.heightLabel.Text      = "Height";
                    this.heightLabel.Anchor    = (AnchorStyles.Bottom | AnchorStyles.Left);
                    this.heightLabel.TabStop   = false;
                    this.Controls.Add(this.heightLabel);
                    // sizeHeight
                    this.sizeHeight.Visible     = false;
                    this.sizeHeight.BorderStyle = BorderStyle.Fixed3D;
                    this.sizeHeight.Font        = new Font("Microsoft Sans Serif", 9F);
                    this.sizeHeight.Minimum     = resize_grip;
                    this.sizeHeight.Maximum     = _parentBox.Height;
                    this.sizeHeight.Value       = this.Height;
                    this.sizeHeight.Anchor      = (AnchorStyles.Bottom | AnchorStyles.Left);
                    this.sizeHeight.TabStop     = false;
                    this.Controls.Add(this.sizeHeight);
                    this.repositonButton();
                    this.repositionRectangle();
                }
                this.MouseMove += (sender, e) =>
                {
                    if (e.Button == MouseButtons.Left)
                    {
                        ReleaseCapture();
                        SendMessage(this.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
                        this.moveSelection();
                        this.OnSelectionChanged?.Invoke(this, null);
                    }
                };
                this.MouseDown += (sender, e) => SelectedPanel = this;

                this.editButton.Click += (sender, e) =>
                {
                    SelectedPanel  = this;
                    this.editPanel = true;
                    this.Focus();
                };
                this.PreviewKeyDown += (sender, e) => {
                    switch (e.KeyCode)
                    {
                    case Keys.Down:
                    case Keys.Up:
                    case Keys.Left:
                    case Keys.Right:
                        e.IsInputKey = true;
                        break;
                    }
                };
                this.KeyDown            += this.checkKeys;
                this.KeyUp              += (sender, e) => this.OnSelectionChanged?.Invoke(this, null);
                this.editText.KeyDown   += new KeyEventHandler(this.checkKeys);
                this.sizeWidth.KeyDown  += new KeyEventHandler(this.checkKeys);
                this.sizeHeight.KeyDown += new KeyEventHandler(this.checkKeys);
                this.removeButton.Click += (sender, e) => this.deleteThis();
                _parentBox.Controls.Add(this);
            }