示例#1
0
 void ToolButton(object o, EventArgs e)
 {
     if (project.task((o as Button).Tag))
     {
         Canavas.Invalidate();
         RefreshList();
     }
     selectbutton(o as Button);
 }
示例#2
0
        void Canavas_MouseWheel(object sender, MouseEventArgs e)
        {
            bool up = e.Delta > 0;

            view.Zoom *= up ? 1.05 : 0.95;

            view.ConfigView();


            Canavas.Invalidate();
        }
示例#3
0
        void Canavas_MouseMove(object sender, MouseEventArgs e)
        {
            bool invalidate = false;

            if (drag_point)
            {
                invalidate = DragPoint(e.Location);
            }
            else if (handmode)
            {
                Task(e.Location);
            }
            else
            {
                if (drag)
                {
                    Cursor.Current = Cursors.NoMove2D;
                    view.ConfigView(e.Location);
                    invalidate = true;
                }
                else
                {
                    bool nothing_here = true;
                    try
                    {
                        invalidate = ScanArea(e.Location, true, ref nothing_here, invalidate);
                    }
                    catch { }

                    if (project.Task != null)
                    {
                        if (project.refresh)
                        {
                            view.MousePosition = e.Location;
                            invalidate         = true;
                        }
                        else
                        {
                            Cursor.Current = Cursors.Cross;
                        }
                    }
                }
            }
            if (invalidate)
            {
                Canavas.Invalidate();
            }
        }
示例#4
0
        private void Input_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                var str = input.Text;

                Function fs = new Function();
                fs.function        = parse(str);
                fs.Properties.Name = project.GenerateName("n");
                project.functions.Add(fs);
                if (Execute())
                {
                    Canavas.Invalidate();
                    RefreshList();
                }
                else
                {
                    project.NameRemouved(fs.Properties.Name);
                    project.functions.Remove(fs);
                }
            }
        }
示例#5
0
        void OnSize(object o, EventArgs e)
        {
            var spliter = container.SplitterDistance;

            container.Width            = ClientSize.Width;
            container.Height           = ClientSize.Height - btm_panel.Height - toolbar.Height;
            toolbar.Width              = ClientSize.Width;
            Canavas.Size               = new Size(container.Panel2.ClientSize.Width, container.Panel2.ClientSize.Height - properties_panel.Height);
            Canavas.Location           = new Point(0, properties_panel.Height);
            properties_panel.Width     = Canavas.Width;
            btm_panel.Width            = ClientSize.Width;
            input.Width                = btm_panel.Width - input.Location.X - 50;
            info.Location              = new Point(btm_panel.Width - info.Width - 10, 5);
            btm_panel.Location         = new Point(0, container.ClientRectangle.Bottom + toolbar.Height);
            container.SplitterDistance = spliter;
            project.view.size          = Canavas.Size;
            project.view.WindowSize    = ClientSize;
            project.view.ConfigView();
            textBox2.Location = Canavas.Location;
            textBox2.Size     = Canavas.Size;
            Canavas.Invalidate();
        }
示例#6
0
 void Canavas_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         project.task(null, project.Task);
         Canavas.Invalidate();
     }
     else
     {
         bool invalidate = false;
         try
         {
             invalidate = ScanArea(e.Location, false, ref drag_point, invalidate);
         }
         catch { }
         if (project.Task != null)
         {
             drag_point = Task(e.Location);
             invalidate = true;
             try
             {
                 RefreshList();
             }
             catch (Exception e) { }
         }
         else if (!drag_point)
         {
             view.dx = e.X - view.x;
             view.dy = e.Y - view.y;
             drag    = true;
         }
         if (invalidate)
         {
             Canavas.Invalidate();
         }
     }
 }
示例#7
0
 void Canavas_MouseEnter(object sender, EventArgs e)
 {
     Canavas.Focus();
 }
示例#8
0
 public void ObjectTextLeave(object o, EventArgs e)
 {
     List(o, container.Panel1, true, true);
     Canavas.Invalidate();
 }
示例#9
0
 public void CheckBox(object o, EventArgs e)
 {
     List(o);
     Canavas.Invalidate();
 }