Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
         }
     }
 }
Esempio 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);
        }
Esempio n. 5
0
        private void reLayoutFirstItem()
        {
            CheckTypeInputPanel item = (CheckTypeInputPanel)checkPanel.Controls[0];

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

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