Пример #1
0
 private void ProfilButton_DragEnter(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent("Projector.ProfilButton"))
     {
         ProfilButton groupWidth = (ProfilButton)e.Data.GetData("Projector.ProfilButton");
         if (groupWidth != null && groupWidth.assignedGroup == null && this.assignedGroup != null)
         {
             e.Effect = DragDropEffects.Copy;
         }
         else if (groupWidth != null && groupWidth.assignedGroup == null && this.assignedGroup == null)
         {
             e.Effect = DragDropEffects.Move;
         }
         else if (groupWidth != null && groupWidth.assignedGroup != null && this.assignedGroup != null && groupWidth.assignedGroup == this.assignedGroup)
         {
             e.Effect = DragDropEffects.Move;
         }
         else
         {
             e.Effect = DragDropEffects.None;
         }
     }
     else
     {
         e.Effect = DragDropEffects.None;
     }
 }
Пример #2
0
        private void grpFlow_DragDrop(object sender, DragEventArgs e)
        {
            ProfilButton pButton = (ProfilButton)e.Data.GetData("Projector.ProfilButton");

            if (pButton.assignedGroup == null)
            {
                this.grpFlow.Controls.Add(pButton);
                this.parent.joinToGroup(this.getText(), pButton.profilName);
            }
        }
Пример #3
0
 public void setProfileNewPosition(ProfilButton btn, int pos)
 {
     pos++; // because of the first label that not should be reordered and always stay on place one.
     //also  the new index is calculated by ProfilButtons only. For1 don't know here is an label on top
     if (this.grpFlow.Controls.ContainsKey(btn.Name))
     {
         Object curr = this.grpFlow.Controls[btn.Name];
         if (curr is ProfilButton)
         {
             this.grpFlow.Controls.SetChildIndex(btn, pos);
         }
     }
 }
Пример #4
0
        private void ProfilButton_DragDrop(object sender, DragEventArgs e)
        {
            ProfilButton groupWidth = (ProfilButton)e.Data.GetData("Projector.ProfilButton");

            if (groupWidth != null)
            {
                // booth have no group so make an new one
                if (groupWidth.assignedGroup == null && this.assignedGroup == null)
                {
                    this.myParent.joinToNewGoup(this.profilName, groupWidth.profilName);
                }

                if (groupWidth.assignedGroup != null && this.assignedGroup != null && groupWidth.assignedGroup == this.assignedGroup)
                {
                    this.myParent.reOrderButtonsInGroup(this, groupWidth);
                }
            }
        }