Exemplo n.º 1
0
        public CADView(CADModel model, int width, int height)
        {
            Model = model;

            Width  = width;
            Height = height;

            mZoomFactor     = 5.0f / 3.0f;
            mCameraPosition = new PointF(0, 0);
        }
Exemplo n.º 2
0
        public CADWindow()
        {
            InitializeComponent();

            Model = new CADModel();
            View  = new CADView(Model, ClientRectangle.Width, ClientRectangle.Height);

            AllowZoomAndPan = true;
            mPanning        = false;

            BackColor = Color.White;
            Cursor    = Cursors.Cross;

            Resize           += new EventHandler(CadView_Resize);
            MouseDown        += new MouseEventHandler(CadView_MouseDown);
            MouseUp          += new MouseEventHandler(CadView_MouseUp);
            MouseMove        += new MouseEventHandler(CadView_MouseMove);
            MouseDoubleClick += new MouseEventHandler(CadView_MouseDoubleClick);
            MouseWheel       += new MouseEventHandler(CadView_MouseWheel);
            Paint            += new PaintEventHandler(CadView_Paint);
        }