Пример #1
0
        private void carlisle_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Effect == DragDropEffects.Link && this.have_drag && this.have_cut_drag)
            {
                this.have_drag     = false;
                this.have_cut_drag = false;
                form.Undo_Click(sender, e);
                return;
            }
            if (droppable_file)
            {
                string[] name = (string [])e.Data.GetData(DataFormats.FileDrop);
                form.Load_MRU(name[0]);
            }
            //form.MC.set_text("dropped!");
            e.Effect = DragDropEffects.Copy;
            Point p = this.panel1.PointToClient(new Point(e.X, e.Y));

            if ((droppable_icon || have_drag) && Start.insert(null,
                                                              p.X + Math.Abs(this.panel1.AutoScrollPosition.X),
                                                              p.Y + Math.Abs(this.panel1.AutoScrollPosition.Y), 0))
            {
                form.mouse_x = p.X + Math.Abs(this.panel1.AutoScrollPosition.X);
                form.mouse_y = p.Y + Math.Abs(this.panel1.AutoScrollPosition.Y);
                string s = (string)e.Data.GetData(DataFormats.Text);
                if (s == "raptor_ASGN")
                {
                    form.menuItemAssignment_Click(sender, null);
                }
                else if (s == "raptor_CALL")
                {
                    form.menuItemCall_Click(sender, null);
                }
                else if (s == "raptor_INPUT")
                {
                    form.menuItemParallelogram_Click(sender, null);
                }
                else if (s == "raptor_OUTPUT")
                {
                    form.menuItemOutput_Click(sender, null);
                }
                else if (s == "raptor_SELECTION")
                {
                    form.menuItemIf_Click(sender, null);
                }
                else if (s == "raptor_LOOP")
                {
                    form.menuItemLoop_Click(sender, null);
                }
                else if (s == "raptor_RETURN")
                {
                    form.menuItemReturn_Click(sender, null);
                }
                else if (s == "raptor_DRAG")
                {
                    form.paste_Click(null, null);
                }
            }
            this.have_drag = false;
        }