コード例 #1
0
        public override void InputEvent(int evId)
        {
            base.InputEvent(evId);
            if (evId != 4)
            {
                return;
            }
            ShowInfo(2, "Отметьте точку на окружности");
            if (center == IntPtr.Zero)
            {
                center = CoreWrapper.nodeFactory(X, Y);
            }
            if (point == IntPtr.Zero)
            {
                point = CoreWrapper.nodeFactory(X, Y);
            }
            else
            {
                point = CoreWrapper.nodeFactory(X, Y);

                if (newLineGen != IntPtr.Zero)
                {
                    CoreWrapper.detachFromBase(CurrentSession, CurrentDocument, lineId);
                }

                newLineGen = CoreWrapper.genericFactory(CoreWrapper.circleFactory(center, point), (uint)0);
                lineId     = CoreWrapper.attachToBase(CurrentSession, CurrentDocument, newLineGen);

                CoreWrapper.commit(CurrentSession, CurrentDocument);
                FinilizeOperation();
            }
        }
コード例 #2
0
        public override void MouseMove(double x, double y)
        {
            base.MouseMove(x, y);
            if (center != IntPtr.Zero)
            {
                //CoreWrapper.Destroy(end)
                point = CoreWrapper.nodeFactory(X, Y);

                if (newLineGen != IntPtr.Zero)
                {
                    CoreWrapper.detachFromBase(CurrentSession, CurrentDocument, lineId);
                }

                newLineGen = CoreWrapper.genericFactory(CoreWrapper.circleFactory(center, point), (uint)0);
                lineId     = CoreWrapper.attachToBase(CurrentSession, CurrentDocument, newLineGen);
            }
        }