Ejemplo n.º 1
0
        private void MouseMove(Point2d m)
        {
            var mouse_prev_state = mouse_current_state;
            mouse_current_state = new mouse_state(m);

            mouse_current_state.hovered = RayTrace(m);

            if (mouse_enter_state == null)
                mouse_current_state.UpdateCursor(this);

            if (mouse_current_state.hovered != mouse_prev_state.hovered)
                this.Invalidate();

            if (mouse_enter_state != null)
                this.Invalidate();
        }
Ejemplo n.º 2
0
        private void OnMouseHold()
        {
            mouse_enter_state = mouse_current_state;

            if (mouse_enter_state.point_mode == active_zone.MOVE_ZONE)
                Cursor = Cursors.NoMoveHoriz;
        }
Ejemplo n.º 3
0
        private void OnMouseUnhold()
        {
            if (mouse_enter_state == null)
                return;

            MouseAction();

            mouse_enter_state = null;
        }
Ejemplo n.º 4
0
        private void InitDrawGantt()
        {
            current_pen = new Pen(Color.Black);
            current_brush = new SolidBrush(Color.Blue);
            mouse_current_state = new mouse_state(new Point2d(0, 0));

            tasks = new BindingList<TaskT>();
            positions = new Dictionary<UIDT, LineT>();
            links = new Dictionary<HashT, Tuple<UIDT, UIDT>>();

            BindToCollections();

            var zero = new DateTime();
            SetDrawInterval(zero.AddHours(0), zero.AddHours(10));
            UpdateTask("0", 0, zero.AddHours(1), zero.AddHours(2));
            UpdateTask("11", 1, zero.AddHours(3), zero.AddHours(4));
            UpdateTask("22", 2, zero.AddHours(5), zero.AddHours(8));
            UpdateTask("33", 3, zero.AddHours(0), zero.AddHours(2));

            UpdateLink("0", "11", true);
            UpdateLink("0", "22", true);
            UpdateLink("33", "22", true);
        }