Ejemplo n.º 1
0
        private void reLayoutItem(int i)
        {
            CheckTypeInputPanel item    = (CheckTypeInputPanel)checkPanel.Controls[i];
            CheckTypeInputPanel preItem = (CheckTypeInputPanel)checkPanel.Controls[i - 1];

            item.Location = new Point(checkPanel.Width / 2 - item.Width / 2, preItem.Location.Y + preItem.Height);
        }
Ejemplo n.º 2
0
        private void layoutBottomInputPanel(ref CheckTypeInputPanel inputPanel)
        {
            int controlsLoactionX = checkPanel.Width / 2 - inputPanel.Width / 2;
            int bottomPanelIndex  = checkPanel.Controls.Count - 1;
            CheckTypeInputPanel bottomInputPanel = (CheckTypeInputPanel)checkPanel.Controls[checkPanel.Controls.Count - 1];

            inputPanel.Location = new Point(controlsLoactionX, bottomInputPanel.Location.Y + bottomInputPanel.Height);
        }
Ejemplo n.º 3
0
 /* ---- Delete ---- */
 private void checkTypeInputPanel_Delete(CheckTypeInputPanel sender)
 {
     for (int i = 0; i < checkPanel.Controls.Count; i++)
     {
         if (i == 0)
         {
             reLayoutFirstItem();
         }
         else
         {
             reLayoutItem(i);
         }
     }
 }
Ejemplo n.º 4
0
        /* ---- Add a item ---- */
        private void checkTypeAddButton_Click(object sender, EventArgs e)
        {
            CheckTypeInputPanel checkTypeInputPanel = new CheckTypeInputPanel();

            if (checkPanel.Controls.Count == 0)
            {
                layoutFirstInputPanel(ref checkTypeInputPanel);
            }
            else
            {
                layoutBottomInputPanel(ref checkTypeInputPanel);
            }
            checkTypeInputPanel.afterDelete += checkTypeInputPanel_Delete;
            addInputPanel(ref checkTypeInputPanel);
        }
Ejemplo n.º 5
0
        private void reLayoutFirstItem()
        {
            CheckTypeInputPanel item = (CheckTypeInputPanel)checkPanel.Controls[0];

            item.Location = new Point(checkPanel.Width / 2 - item.Width / 2, 0);
        }
Ejemplo n.º 6
0
 private void addInputPanel(ref CheckTypeInputPanel inputPanel)
 {
     checkPanel.Controls.Add(inputPanel);
     inputPanel.resizeSelf();
 }
Ejemplo n.º 7
0
        private void layoutFirstInputPanel(ref CheckTypeInputPanel inputPanel)
        {
            int controlsLoactionX = checkPanel.Width / 2 - inputPanel.Width / 2;

            inputPanel.Location = new Point(controlsLoactionX, 0);
        }