示例#1
0
 public void Activate(BasicView view1)
 {
     view             = view1;
     view.invalidate  = Invalidate;
     view.resetCursor = ResetCursor;
     view.setCursor   = SetCursor;
 }
        private void InitializeComponent2()
        {
            TableLayoutPanel tableLayoutPanel1 = new TableLayoutPanel();

            mainView            = new SimpleScrollableControlMainView(this);
            horizontalScrollBar = new HorizontalScrollBarView(this);
            verticalScrollBar   = new VerticalScrollBarView(this);
            smallCornerView     = new ScrollableControlSmallCornerView();
            tableLayoutPanel1.SuspendLayout();
            SuspendLayout();
            tableLayoutPanel1.ColumnCount = 2;
            tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, CompoundScrollableControl.scrollBarWidth));
            mainControl = mainView.CreateControl();
            tableLayoutPanel1.Controls.Add(mainControl, 0, 0);
            tableLayoutPanel1.Controls.Add(horizontalScrollBar.CreateControl(), 0, 1);
            tableLayoutPanel1.Controls.Add(verticalScrollBar.CreateControl(), 1, 0);
            tableLayoutPanel1.Controls.Add(smallCornerView.CreateControl(), 1, 1);
            tableLayoutPanel1.Dock     = DockStyle.Fill;
            tableLayoutPanel1.Location = new Point(0, 0);
            tableLayoutPanel1.Margin   = new Padding(0);
            tableLayoutPanel1.Name     = "tableLayoutPanel1";
            tableLayoutPanel1.RowCount = 2;
            tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, CompoundScrollableControl.scrollBarWidth));
            tableLayoutPanel1.Size     = new Size(409, 390);
            tableLayoutPanel1.TabIndex = 0;
            AutoScaleDimensions        = new SizeF(6F, 13F);
            AutoScaleMode = AutoScaleMode.Font;
            Controls.Add(tableLayoutPanel1);
            Name = "ScrollableControl2";
            Size = new Size(409, 390);
            tableLayoutPanel1.ResumeLayout(false);
            ResumeLayout(false);
        }
示例#3
0
        public static BasicControl CreateControl(BasicView view)
        {
            BasicControl c = new BasicControl();

            c.Activate(view);
            return(c);
        }
示例#4
0
    public void Initialize(BasicView _View, Building Build)
    {
        ShadowSprite.sprite = Build.gameObject.GetComponent<SpriteRenderer>().sprite;
        OryginalSprite.sprite = ShadowSprite.sprite;

        ShadowSprite.transform.localScale = new Vector3(Build.transform.localScale.x, Build.transform.localScale.y, Build.transform.localScale.z);
        OryginalSprite.transform.localScale = new Vector3(Build.transform.localScale.x, Build.transform.localScale.y, Build.transform.localScale.z);

        material = OryginalSprite.material;

        _View = View;
        build = Build;
    }
示例#5
0
 private void InitializeComponent2()
 {
     tableLayoutPanel1       = new BasicTableLayoutView();
     tableLayoutPanel2       = new BasicTableLayoutView();
     mainView                = new ScrollableControlMainView(this);
     rowHeaderView           = new ScrollableControlRowHeaderView(this);
     rowFooterView           = new ScrollableControlRowFooterView(this);
     rowSpacerView           = new ScrollableControlRowSpacerView(this);
     columnHeaderView        = new ScrollableControlColumnHeaderView(this);
     columnFooterView        = new ScrollableControlColumnFooterView(this);
     columnSpacerView        = new ScrollableControlColumnSpacerView(this);
     horizontalScrollBarView = new HorizontalScrollBarView(this);
     verticalScrollBarView   = new VerticalScrollBarView(this);
     cornerView              = new ScrollableControlCornerView(this);
     middleCornerView        = new ScrollableControlMiddleCornerView(this);
     smallCornerView         = new ScrollableControlSmallCornerView();
     SuspendLayout();
     tableLayoutPanel1.ColumnStyles.Add(new BasicColumnStyle(BasicSizeType.Percent, 100F));
     tableLayoutPanel1.ColumnStyles.Add(new BasicColumnStyle(BasicSizeType.Absolute, scrollBarWidth));
     tableLayoutPanel1.Add(tableLayoutPanel2, 0, 0);
     tableLayoutPanel1.Add(horizontalScrollBarView, 0, 1);
     tableLayoutPanel1.Add(verticalScrollBarView, 1, 0);
     tableLayoutPanel1.Add(smallCornerView, 1, 1);
     tableLayoutPanel1.RowStyles.Add(new BasicRowStyle(BasicSizeType.Percent, 100F));
     tableLayoutPanel1.RowStyles.Add(new BasicRowStyle(BasicSizeType.Absolute, scrollBarWidth));
     tableLayoutPanel2.ColumnStyles.Add(new BasicColumnStyle(BasicSizeType.AbsoluteResizeable, rowHeaderWidth));
     tableLayoutPanel2.ColumnStyles.Add(new BasicColumnStyle(BasicSizeType.Percent, 100F));
     tableLayoutPanel2.ColumnStyles.Add(new BasicColumnStyle(BasicSizeType.AbsoluteResizeable, rowFooterWidth));
     tableLayoutPanel2.Add(mainView, 1, 1);
     tableLayoutPanel2.Add(rowHeaderView, 0, 1);
     tableLayoutPanel2.Add(rowFooterView, 2, 1);
     tableLayoutPanel2.Add(rowSpacerView, 0, 2);
     tableLayoutPanel2.Add(columnHeaderView, 1, 0);
     tableLayoutPanel2.Add(columnFooterView, 1, 2);
     tableLayoutPanel2.Add(columnSpacerView, 2, 0);
     tableLayoutPanel2.Add(cornerView, 0, 0);
     tableLayoutPanel2.Add(middleCornerView, 2, 2);
     tableLayoutPanel2.RowStyles.Add(new BasicRowStyle(BasicSizeType.AbsoluteResizeable, columnHeaderHeight));
     tableLayoutPanel2.RowStyles.Add(new BasicRowStyle(BasicSizeType.Percent, 100F));
     tableLayoutPanel2.RowStyles.Add(new BasicRowStyle(BasicSizeType.AbsoluteResizeable, columnFooterHeight));
     AutoScaleDimensions = new SizeF(6F, 13F);
     AutoScaleMode       = AutoScaleMode.Font;
     tableLayoutControl  = tableLayoutPanel1.CreateControl();
     Controls.Add(tableLayoutControl);
     Name = "ScrollableControl2";
     Size = new Size(409, 390);
     ResumeLayout(false);
 }
示例#6
0
        public TileEditor(TileEngine tileEngine)
            : base()
        {
            this.tileEngine = tileEngine;

            layers   = new LayerManager <TileLayer>();
            tilesets = new TilesetManager();

            view = new BasicView();

            keyboardInputListener = new KeyboardInputListener();
            mouseInputListener    = new MouseInputListener();
            inputManager          = new InputManager(keyboardInputListener, mouseInputListener);

            brushBuckets = new Dictionary <Tileset, BrushBucket>();

            backgroundColor = Color.CornflowerBlue;
        }
示例#7
0
 public void InitializeSceneView(BasicView _BasicView)
 {
     if (_BasicView != null && View != null)
       View.Initialize(_BasicView, Build);
 }
 public ScatterPlotViewer()
 {
     bottomAxis        = new NumericAxisView();
     leftAxis          = new NumericAxisView();
     topAxis           = new NumericAxisView();
     rightAxis         = new NumericAxisView();
     scatterPlotPlane  = new ScatterPlotPlaneView();
     spacer1           = new BasicView();
     spacer2           = new BasicView();
     spacer3           = new BasicView();
     spacer4           = new BasicView();
     spacer1.BackColor = Color.White;
     spacer2.BackColor = Color.White;
     spacer3.BackColor = Color.White;
     spacer4.BackColor = Color.White;
     tableLayoutView   = new BasicTableLayoutView();
     InitializeComponent();
     tableLayoutView.Add(spacer1, 0, 0);
     tableLayoutView.Add(spacer2, 0, 2);
     tableLayoutView.Add(spacer3, 2, 0);
     tableLayoutView.Add(spacer4, 2, 2);
     tableLayoutView.Add(scatterPlotPlane, 1, 1);
     tableLayoutView.Add(bottomAxis, 1, 2);
     tableLayoutView.Add(leftAxis, 0, 1);
     tableLayoutView.Add(topAxis, 1, 0);
     tableLayoutView.Add(rightAxis, 2, 1);
     tableLayoutView.BackColor = Color.Transparent;
     tableLayoutView.ColumnStyles.Add(new BasicColumnStyle(BasicSizeType.Absolute, 37F));
     tableLayoutView.ColumnStyles.Add(new BasicColumnStyle(BasicSizeType.Percent, 100F));
     tableLayoutView.ColumnStyles.Add(new BasicColumnStyle(BasicSizeType.Absolute, 37F));
     tableLayoutView.RowStyles.Add(new BasicRowStyle(BasicSizeType.Absolute, 37F));
     tableLayoutView.RowStyles.Add(new BasicRowStyle(BasicSizeType.Percent, 100F));
     tableLayoutView.RowStyles.Add(new BasicRowStyle(BasicSizeType.Absolute, 37F));
     tableLayoutControl = tableLayoutView.CreateControl();
     Controls.Add(tableLayoutControl);
     Controls.Add(toolStrip1);
     scatterPlotPlane.BackColor      = Color.White;
     scatterPlotPlane.ForeColor      = SystemColors.HotTrack;
     scatterPlotPlane.IndicatorColor = Color.Transparent;
     scatterPlotPlane.MouseMode      = ScatterPlotMouseMode.Zoom;
     bottomAxis.Configurable         = true;
     bottomAxis.Positioning          = AxisPositioning.Bottom;
     bottomAxis.Reverse             = false;
     bottomAxis.ZoomType            = AxisZoomType.Zoom;
     leftAxis.Configurable          = true;
     leftAxis.Positioning           = AxisPositioning.Left;
     leftAxis.Reverse               = true;
     leftAxis.ZoomType              = AxisZoomType.Zoom;
     topAxis.Configurable           = false;
     topAxis.Positioning            = AxisPositioning.Top;
     topAxis.Reverse                = false;
     topAxis.ZoomType               = AxisZoomType.Indicate;
     rightAxis.Configurable         = false;
     rightAxis.Positioning          = AxisPositioning.Right;
     rightAxis.Reverse              = true;
     rightAxis.ZoomType             = AxisZoomType.Indicate;
     topAxis.OnZoomChange          += UpdateZoomBottom;
     bottomAxis.OnZoomChange       += UpdateZoomTop;
     rightAxis.OnZoomChange        += UpdateZoomRight;
     leftAxis.OnZoomChange         += UpdateZoomLeft;
     scatterPlotPlane.OnZoomChange += UpdateZoomFromMap;
     bottomAxis.BackColor           = Color.White;
     bottomAxis.Font                = new Font("Lucida Sans Unicode", 8F, FontStyle.Regular, GraphicsUnit.Point, 0);
     bottomAxis.ForeColor           = Color.Black;
     leftAxis.BackColor             = Color.White;
     leftAxis.Font       = new Font("Lucida Sans Unicode", 8F, FontStyle.Regular, GraphicsUnit.Point, 0);
     leftAxis.ForeColor  = Color.Black;
     topAxis.BackColor   = Color.White;
     topAxis.Font        = new Font("Lucida Sans Unicode", 8F, FontStyle.Regular, GraphicsUnit.Point, 0);
     topAxis.ForeColor   = Color.Black;
     rightAxis.BackColor = Color.White;
     rightAxis.Font      = new Font("Lucida Sans Unicode", 8F, FontStyle.Regular, GraphicsUnit.Point, 0);
     rightAxis.ForeColor = Color.Black;
 }