Beispiel #1
0
        void aLabel_MouseDown(object sender, MouseEventArgs e)
        {
            ActiveLabel al   = sender as ActiveLabel;
            String      name = al.Name;
            Object      item = _items[name];

            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                if (Control.ModifierKeys == Keys.None)
                {
                    if (DragLeave != null)
                    {
                        DragLeave(new DragLeaveEventArgs(item));
                    }
                    DoDragDrop(item, DragDropEffects.Copy);
                }
            }
            aLabelPressed(name, item, e);

            /*
             * al.MouseMove += _MouseMove;
             * al.MouseUp += _MouseUp;
             * if (_isDragging) _isDragging = false;
             */
        }
Beispiel #2
0
        ActiveLabel makeNewLabel(String name, Object item, Image icon)
        {
            ActiveLabel aLabel = new ActiveLabel("     " + name, item);

            //
            // activeLabel1
            //
            //aLabel.BackColor = System.Drawing.SystemColors.Control;

            if (icon != null)
            {
                aLabel.Image = icon;
            }
            aLabel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;

            aLabel.Location  = new System.Drawing.Point(0, _labelHeight * _nameList.Count + 1000);
            aLabel.Name      = name;
            aLabel.Size      = new System.Drawing.Size(100, _labelHeight);
            aLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;

            aLabel.MouseDown += new MouseEventHandler(aLabel_MouseDown);
            aLabel.Dock       = System.Windows.Forms.DockStyle.Bottom;
            //aLabel.DragLeave +=new EventHandler(aLabel_DragLeave);
            aLabel.Parent = P_Back;
            P_Back.SuspendLayout();
            P_Back.Controls.Add(aLabel);

            P_Back.ResumeLayout();

            return(aLabel);
        }
Beispiel #3
0
        void al_MouseUp(object sender, MouseEventArgs e)
        {
            ActiveLabel al = sender as ActiveLabel;

            al.MouseMove -= _MouseMove;
            al.MouseUp   -= _MouseUp;
            _isDragging   = false;
            aLabelReleased(al.Name, _items[al.Name], e);
        }
Beispiel #4
0
        void al_MouseMove(object sender, MouseEventArgs e)
        {
            ActiveLabel al = sender as ActiveLabel;

            if (_isDragging == false)
            {
                al.DoDragDrop(al.getItem(), DragDropEffects.Copy);
                _isDragging = true;
            }
            if (DragLeave != null && _isDragging)
            {
                DragLeave(new DragLeaveEventArgs(al.getItem()));
            }
        }