Esempio n. 1
0
 public static Point2I operator -(Point2I nLeft, Point2I nRight)
 {
     Point2I result_ = new Point2I();
     result_._setX(nLeft._getX() - nRight._getX());
     result_._setY(nLeft._getY() - nRight._getY());
     return result_;
 }
Esempio n. 2
0
 public virtual void _offset(Point2I nPoint)
 {
     if (null != m_tMovePoint2I)
     {
         this.m_tMovePoint2I(nPoint);
     }
 }
Esempio n. 3
0
 public GroupBox()
 {
     mPoint = new Point2I();
     mSize = new Size2I();
     mGroupBox = null;
     mText = null;
 }
Esempio n. 4
0
 public Point2I _normalPoint(Point2I nPoint)
 {
     int width_ = mWidth * 2 - 3;
     int height_ = mHeight * 3 - 3;
     Point2I point_ = new Point2I(nPoint);
     int x_ = point_._getX();
     if (x_ < 3)
     {
         point_._setX(3);
     }
     if (x_ > width_)
     {
         point_._setX(width_);
     }
     int y_ = point_._getY();
     if (y_ < 3)
     {
         point_._setY(3);
     }
     if (y_ > height_)
     {
         point_._setY(height_);
     }
     return point_;
 }
Esempio n. 5
0
 public LineShape()
 {
     mPullPoint = new Point2I(default(int), default(int));
     mPullState = PullState_.mNone_;
     mLineStream = null;
     mLine = null;
 }
Esempio n. 6
0
 public LabelShape()
 {
     mRectShapes = new List<RectShape>();
     mPullPoint = new Point2I(default(int), default(int));
     mLabelStream = null;
     mLabel = null;
 }
Esempio n. 7
0
 public static Point2I operator +(Point2I nLeft, Size2I nRight)
 {
     Point2I result_ = new Point2I();
     result_._setX(nLeft._getX() + nRight._getWidth());
     result_._setY(nLeft._getY() + nRight._getHeight());
     return result_;
 }
Esempio n. 8
0
 public TextLabel()
 {
     mLabel = null;
     mSize = null;
     mName = null;
     mPoint = null;
 }
Esempio n. 9
0
 public Point2I _adjustJoinPoint(Point2I nBeg, Point2I nEnd)
 {
     if (null != m_tAdjustJoinPoint)
     {
         return this.m_tAdjustJoinPoint(nBeg, nEnd);
     }
     return null;
 }
Esempio n. 10
0
 public Point2I _joinPoint(Point2I nPoint)
 {
     if (null != m_tJoinPoint)
     {
         return this.m_tJoinPoint(nPoint);
     }
     return null;
 }
Esempio n. 11
0
 public static void _drawEllipse(Point2I nPoint, Graphics nGraphics, RGB nRGB, int nSize = 3)
 {
     Point2I result_ = new Point2I(nPoint);
     result_._offset(-nSize, -nSize);
     Color color_ = nRGB._getColor();
     Pen pen_ = new Pen(color_);
     nGraphics.DrawEllipse(pen_, result_._getX(), result_._getY(), nSize * 2, nSize * 2);
 }
Esempio n. 12
0
 public RadioButton()
 {
     mRadioButton = null;
     mPoint = new Point2I();
     mSize = new Size2I();
     mContain = null;
     mText = null;
 }
Esempio n. 13
0
 public LabelShape()
 {
     mRectShapes = new List<RectShape>();
     mPullPoint = new Point2I(default(int), default(int));
     mPullState = PullState_.mNone_;
     mMoveState = MoveState_.mNone_;
     mLabelStream = null;
     mLabel = null;
 }
Esempio n. 14
0
 public TextBox()
 {
     mTextChangedCommand = null;
     mTextChangedCmd = null;
     mTextBox = null;
     mPoint = null;
     mSize = null;
     mText = null;
 }
Esempio n. 15
0
 public RadioButtonEx()
 {
     mCheckCommand = null;
     mCheckCmd = null;
     mRadioButton = null;
     mPoint = new Point2I();
     mSize = new Size2I();
     mContain = null;
     mText = null;
 }
Esempio n. 16
0
 public void _drawMove(Point2I nPoint, Graphics nGraphics)
 {
     Point2I beg_ = mLine._getBegPoint();
     Point2I end_ = mLine._getEndPoint();
     beg_._offset(nPoint);
     end_._offset(nPoint);
     Line2I line_ = new Line2I(beg_, end_);
     string name_ = mLine._getName();
     Graphicsos._runDraw(line_, nGraphics, mLineStream._getMoveDraw(), mLineStream._getStyleName(), 1, mLineStream._getImage(), name_, mLineStream._getFont());
 }
Esempio n. 17
0
 public CanvasCore()
 {
     mSelects = new List<IShape>();
     mNormals = new List<IShape>();
     mPull = null;
     mMouseDown = new Point2I();
     mRectShape = null;
     mSideBar = null;
     mObject = null;
 }
Esempio n. 18
0
 public ComboBox()
 {
     mComboBoxItems = new List<ComboBoxItem>();
     mCommands = new List<ICommand>();
     m_tSelectTextSlot = null;
     mPoint = new Point2I();
     mSize = new Size2I();
     mComboBox = null;
     mContain = null;
     mEnable = true;
 }
Esempio n. 19
0
 public Button()
 {
     mPoint = new Point2I();
     mSize = new Size2I();
     mCommand = null;
     mOnClick = null;
     mButton = null;
     mContain = null;
     mText = null;
     mEnable = true;
 }
Esempio n. 20
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                Point2I point_ = new Point2I(e.X, e.Y);
                ScreenSingleton screenSingleton_ = __singleton<ScreenSingleton>._instance();
                point_ = screenSingleton_._normalPoint(point_);
                this._leftDown(point_);
            }
            this.Refresh();

            base.OnMouseDown(e);
        }
Esempio n. 21
0
 public void _drawMove(Point2I nPoint, Graphics nGraphics)
 {
     Rect2I rect_ = this._getRect2I();
     rect_._offset(nPoint);
     rect_._setHeight(mLabelHeight);
     this._rectDrawMove(nGraphics, rect_);
     rect_._offset(0, mLabelHeight);
     rect_._setHeight(mRectHeight);
     foreach (RectShape i in mRectShapes)
     {
         this._rectDrawMove(nGraphics, rect_);
         rect_._offset(0, mRectHeight);
     }
 }
Esempio n. 22
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     Graphics graphics_ = Graphics.FromHwnd(Handle);
     Point2I point_ = new Point2I(e.X, e.Y);
     ScreenSingleton screenSingleton_ = __singleton<ScreenSingleton>._instance();
     point_ = screenSingleton_._normalPoint(point_);
     this.Refresh();
     this._mouseMove(point_, graphics_);
     if (e.Button == MouseButtons.Left)
     {
         this._leftMove(point_, graphics_);
     }
     graphics_.Dispose();
     base.OnMouseMove(e);
 }
Esempio n. 23
0
 public Point2I _begPoint(int nLength = 16)
 {
     Point2I point_ = this._vector();
     float length_ = this._length();
     if (length_ < nLength)
     {
         return null;
     }
     float x_ = point_._getX() / length_;
     float y_ = point_._getY() / length_;
     Point2I result_ = new Point2I();
     result_._setX((int)(nLength * x_ + mBeg._getX()));
     result_._setY((int)(nLength * y_ + mBeg._getY()));
     return result_;
 }
Esempio n. 24
0
        public Rect2I(Point2I nPoint, Size2I nSize)
        {
            Point2I point_ = new Point2I();
            point_._setX(nPoint._getX() + nSize._getWidth());
            point_._setY(nPoint._getY() + nSize._getHeight());

            __tuple<Point2I, Point2I> tuple_ = nPoint._minMax(point_);
            Point2I min_ = tuple_._get_0();
            Point2I max_ = tuple_._get_1();

            Size2I size_ = new Size2I();
            size_._setWidth(max_._getX() - min_._getX());
            size_._setHeight(max_._getY() - min_._getY());

            mPoint = new Point2I(min_);
            mSize = new Size2I(size_);
        }
Esempio n. 25
0
        public void _createEnd(Point2I nPoint)
        {
            if (null == mRectShape)
            {
                mSideBar._resetActiveTab();
                this._pushUp();
                return;
            }
            SideItem sideItem_ = mSideBar._getChooseSideItem();
            LineCreater lineCreater_ = sideItem_._getTag() as LineCreater;
            string endId_ = lineCreater_._getEndId();
            RectShape rectShape_ = null;
            foreach (IShape i in mNormals)
            {
                RectShape temp_ = i._getRectShape(nPoint, endId_);
                if (null != temp_)
                {
                    rectShape_ = temp_;
                    break;
                }
            }
            if (rectShape_ == mRectShape || null == rectShape_)
            {
                mRectShape = null;
                mSideBar._resetActiveTab();
                this._pushUp();
                return;
            }
            lineCreater_._setObject(mObject);
            lineCreater_._setBeg(mRectShape._rectGetIRect());
            lineCreater_._setEnd(rectShape_._rectGetIRect());

            ILine line_ = lineCreater_._runCreate() as ILine;

            LineShape lineshape_ = new LineShape();
            lineshape_._initLine(line_);
            Point2I beg_ = mRectShape._rectJoinPoint(mMouseDown, nPoint);
            Point2I end_ = rectShape_._rectJoinPoint(nPoint, mMouseDown);
            lineshape_._setBegPoint(beg_);
            lineshape_._setEndPoint(end_);
            mSelects.Add(lineshape_);

            mSideBar._resetActiveTab();
            this._pushUp();
        }
Esempio n. 26
0
        public Rect2I(int nX, int nY, int nWidth, int nHeight)
        {
            Point2I point0_ = new Point2I(nX, nY);
            Point2I point_ = new Point2I();
            point_._setX(nX + nWidth);
            point_._setY(nY + nHeight);

            __tuple<Point2I, Point2I> tuple_ = point0_._minMax(point_);
            Point2I min_ = tuple_._get_0();
            Point2I max_ = tuple_._get_1();

            Size2I size_ = new Size2I();
            size_._setWidth(max_._getX() - min_._getX());
            size_._setHeight(max_._getY() - min_._getY());

            mPoint = new Point2I(min_);
            mSize = new Size2I(size_);
        }
Esempio n. 27
0
        public void _createBeg(Point2I nPoint)
        {
            this._pushDown(nPoint);
            this._resetShape();

            SideItem sideItem_ = mSideBar._getChooseSideItem();
            LineCreater lineCreater_ = sideItem_._getTag() as LineCreater;
            string begId_ = lineCreater_._getBegId();
            foreach (IShape i in mNormals)
            {
                RectShape rectShape_ = i._getRectShape(nPoint, begId_);
                if (null != rectShape_)
                {
                    mRectShape = rectShape_;
                    break;
                }
            }
        }
Esempio n. 28
0
 public bool _drawCreate(Point2I nPoint, string nId, Graphics nGraphics)
 {
     Rect2I labelRect2I_ = this._getRect2I();
     if (!labelRect2I_._contain(nPoint))
     {
         return false;
     }
     if (mRectShapes.Count <= 0)
     {
         if (this._rectIdSel(nId))
         {
             base._rectDrawCreate(nGraphics, labelRect2I_);
             return true;
         }
         return false;
     }
     Rect2I rect2i_ = new Rect2I(labelRect2I_);
     rect2i_._setHeight(mLabelHeight);
     if (rect2i_._contain(nPoint))
     {
         if (this._rectIdSel(nId))
         {
             base._rectDrawCreate(nGraphics, labelRect2I_);
             return true;
         }
         return false;
     }
     rect2i_._offset(0, mLabelHeight);
     rect2i_._setHeight(mRectHeight);
     foreach (RectShape i in mRectShapes)
     {
         if (rect2i_._contain(nPoint))
         {
             if (i._rectIdSel(nId))
             {
                 i._rectDrawCreate(nGraphics, rect2i_);
                 return true;
             }
             return false;
         }
         rect2i_._offset(0, mRectHeight);
     }
     return false;
 }
Esempio n. 29
0
 Rect2I _runPull(Point2I nPoint)
 {
     Rect2I rect2i_ = this._getRect2I();
     if (this._isPullRight(mPullPoint))
     {
         int v_ = nPoint._getX() - mPullPoint._getX();
         int w_ = rect2i_._getWidth();
         w_ += v_;
         if (w_ < mRectWidth)
         {
             w_ = mRectWidth;
         }
         rect2i_._setWidth(w_);
     }
     if (this._isPullLeft(mPullPoint))
     {
         int v_ = nPoint._getX() - mPullPoint._getX();
         int w_ = rect2i_._getWidth();
         w_ -= v_;
         if (w_ < mRectWidth)
         {
             v_ -= mRectWidth;
             v_ += w_;
         }
         int x_ = rect2i_._getX();
         x_ += v_;
         if (x_ < 3)
         {
             w_ -= 3;
             w_ += x_;
             x_ = 3;
         }
         rect2i_._setX(x_);
         rect2i_._sizeOffset(-v_, 0);
     }
     return rect2i_;
 }
Esempio n. 30
0
 bool _isPullRight(Point2I nPoint)
 {
     Rect2I rect2i_ = this._getRect2I();
     Point2I right_ = rect2i_._centerPoint();
     right_._setX(rect2i_._getRTX());
     right_._offset(4, 0);
     if (right_._isSelect(nPoint))
     {
         return true;
     }
     return false;
 }