Beispiel #1
0
//--------------------------OBJECT DEPENDENT CODE--------------------------------------//
        void l_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                int clickedindex = Convert.ToInt32((sender as Label).Text); // edge id, where mouse has been clicked
                if ((sel1 != -1) && (sel2 != -1))
                {
                    sel1 = sel2 = -1;
                }
                if (sel1 == -1)
                {
                    sel1 = clickedindex; DrawIncremental(); return;
                }
                if (sel2 == -1)
                {
                    sel2 = clickedindex; DrawIncremental(); return;
                }
                sel1 = sel2 = -1;// what the f**k has happened?
            }
            // if (e.Button == System.Windows.Forms.MouseButtons.Middle) { emx = e.X; emy = e.Y; }
            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                Control        snder = sender as Control;
                Edge_Extension ex    = new Edge_Extension();
                ex.text          = "Edge# " + snder.Text;
                ex.StartPosition = FormStartPosition.Manual;
                ex.Location      = new Point(this.Location.X + panel1.Location.X + snder.Location.X + snder.Parent.Location.X + edgesize * 2, this.Location.Y + panel1.Location.Y + snder.Location.Y + snder.Parent.Location.Y);
                ex.ShowDialog();
                if (ex.IteratorReset)
                {
                    test.CreateIterator(Convert.ToInt32(snder.Text));
                }
            }
            DrawIncremental();
        }
Beispiel #2
0
//--------------------------OBJECT DEPENDENT CODE--------------------------------------//
        void l_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                int clickedindex = Convert.ToInt32((sender as Label).Text); // edge id, where mouse has been clicked
                if ((sel1 != -1) && (sel2 != -1)) sel1 = sel2 = -1;
                if (sel1 == -1) { sel1 = clickedindex; DrawIncremental(); return; }
                if (sel2 == -1) { sel2 = clickedindex; DrawIncremental(); return; }
                sel1 = sel2 = -1;// what the f**k has happened?                
            }
           // if (e.Button == System.Windows.Forms.MouseButtons.Middle) { emx = e.X; emy = e.Y; } 
            if (e.Button==System.Windows.Forms.MouseButtons.Right)
            {
                Control snder = sender as Control;
                Edge_Extension ex = new Edge_Extension();
                ex.text = "Edge# " + snder.Text;
                ex.StartPosition = FormStartPosition.Manual;
                ex.Location = new Point(this.Location.X+panel1.Location.X+snder.Location.X+snder.Parent.Location.X + edgesize * 2, this.Location.Y+panel1.Location.Y+snder.Location.Y+snder.Parent.Location.Y);
                ex.ShowDialog();
                if (ex.IteratorReset) test.CreateIterator(Convert.ToInt32(snder.Text));
            }
            DrawIncremental();
        }