コード例 #1
0
        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);
        }
コード例 #2
0
    private void SetPlayerDetails(BasicControl control)
    {
        Controller         = GameObject.FindGameObjectWithTag("Controller").GetComponent <Controller>();
        control.Controller = Controller;

        CameraSwitch cameraSwitch = GameObject.FindGameObjectWithTag("CameraSwitch").GetComponent <CameraSwitch>();
    }
コード例 #3
0
        public ColorScale()
        {
            InitializeComponent();
            ColorStrip = new ColorStripView();
            axis       = new NumericAxisView();
            SuspendLayout();
            axis.ForeColor             = Color2.Black;
            AutoScaleDimensions        = new SizeF(6F, 13F);
            AutoScaleMode              = AutoScaleMode.Font;
            colorStripControl          = BasicControl.CreateControl(ColorStrip);
            colorStripControl.Anchor   = (AnchorStyles.Bottom | AnchorStyles.Left) | AnchorStyles.Right;
            colorStripControl.Location = new Point(0, 59);
            colorStripControl.Margin   = new Padding(0);
            colorStripControl.Name     = "colorStrip";
            colorStripControl.Size     = new Size(749, 31);
            Controls.Add(colorStripControl);
            BasicControl axisControl = BasicControl.CreateControl(axis);

            axisControl.Anchor    = ((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right;
            axisControl.ForeColor = Color.Black;
            axisControl.Location  = new Point(0, 0);
            axisControl.Margin    = new Padding(0);
            axisControl.Name      = "axis";
            axisControl.Size      = new Size(749, 59);
            Controls.Add(axisControl);
            Name = "ColorScale";
            Size = new Size(749, 90);
            ResumeLayout(false);
            ColorStrip.Arrow           = Arrows.Second;
            ColorStrip.StartupColorMax = Color2.Red;
            ColorStrip.StartupColorMin = Color2.White;
            ColorStrip.StripWidth      = 10;
            ColorStrip.Vertical        = false;
            ColorStrip.Weight1         = 1F;
            ColorStrip.Weight2         = 0F;
            axis.Configurable          = true;
            axis.IndicatorColor        = Color2.Transparent;
            axis.IsLogarithmic         = false;
            axis.LineWidth             = 0.5F;
            axis.MajorTickLength       = 6;
            axis.MajorTickLineWidth    = 0.5F;
            axis.MinorTickLength       = 3;
            axis.MinorTickLineWidth    = 0.5F;
            axis.MouseMode             = AxisMouseMode.Zoom;
            axis.Positioning           = AxisPositioning.Top;
            axis.Reverse              = false;
            axis.TotalMax             = 1;
            axis.TotalMin             = 0;
            axis.ZeroPoint            = double.NaN;
            axis.ZoomMax              = 1;
            axis.ZoomMin              = 0;
            axis.ZoomType             = AxisZoomType.Zoom;
            ColorStrip.OnColorChange += UpdateAxis;
            axis.OnZoomChange        += UpdateColor;
        }
コード例 #4
0
ファイル: BasicControl.cs プロジェクト: LeoNERDMaia/VRDrone
 void OnCollisionEnter(Collision col)
 {
     if (col.relativeVelocity.magnitude > Resistance)
     {
         Disable();
         BasicControl bcOther = col.gameObject.GetComponent <BasicControl>();
         if ((bcOther != null) && (col.relativeVelocity.magnitude > bcOther.Resistance))
         {
             CmdImpact(bcOther.name, col.relativeVelocity.magnitude);
         }
     }
 }
コード例 #5
0
    public void CmdLoadDrone()
    {
        PlayerID = TotalPlayers;
        TotalPlayers++;
        GameObject drone = Instantiate(Drone);

        drone.name = "Drone_" + PlayerID;
        BasicControl control = drone.GetComponent <BasicControl>();

        control.PlayerID         = PlayerID;
        drone.tag                = "Player";
        drone.transform.position = transform.position;
        drone.transform.rotation = transform.rotation;
    }
コード例 #6
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);
 }
コード例 #7
0
        static public Window CreateWindow(int viewId)
        {
            Window _window = null;

            switch (viewId)
            {
            case 0: _window = new BasicControl(); break;

            case 1: _window = new StyleSample(); break;

            case 3: _window = new BehaviorSample(); break;

            case 4: _window = new DependencyPropertySample(); break;

            default: break;
            }
            return(_window);
        }
コード例 #8
0
    public void EnsembleDrone(BasicControl control)
    {
        GameObject drone   = control.gameObject;
        Rigidbody  droneRB = drone.GetComponent <Rigidbody>();

        SetPlayerDetails(control);

        GameObject computer = Instantiate(UsedComputer);

        computer.transform.position = drone.transform.position;
        computer.transform.rotation = drone.transform.rotation;
        computer.transform.parent   = drone.transform;
        control.Computer            = computer.GetComponent <ComputerModule>();

        Transform  transformWeapon = drone.transform.FindChild("WeaponPoint");
        GameObject camera          = GameObject.FindGameObjectWithTag("FPVCamera");

        camera.transform.position = transformWeapon.position;
        camera.transform.rotation = transformWeapon.rotation;
        camera.transform.parent   = transformWeapon;

        /*
         * GameObject weapon = Instantiate(UsedWeapon);
         * weapon.transform.position = transformWeapon.position;
         * weapon.transform.rotation = transformWeapon.rotation;
         * weapon.transform.parent = drone.transform;*/

        MotorParameters[] parameters = drone.GetComponentsInChildren <MotorParameters>();
        control.Motors = new Motor[parameters.Length];

        int i = 0;

        foreach (MotorParameters parameter in parameters)
        {
            Motor motor = parameter.CreateMotor(UsedMotor, UsedPropeller);
            motor.transform.position   = parameter.transform.position;
            motor.transform.rotation   = parameter.transform.rotation;
            motor.transform.localScale = parameter.transform.localScale;
            motor.transform.parent     = parameter.transform;
            control.Motors[i]          = motor;
            droneRB.mass += motor.Mass;
            i++;
        }
    }
コード例 #9
0
 private void winPrivilege_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     BasicControl.CloseWindow(this.Name);
 }
コード例 #10
0
 private void ShowControl(BasicControl BasicDateTimeControl)
 {
     base.Controls.Remove(this.DateTimeControl);
     this.DateTimeControl = BasicDateTimeControl;
     this.DateTimeControl.Location = new Point(72, 0);
     this.DateTimeControl.TabIndex = 2;
     base.Controls.Add(this.DateTimeControl);
     AutoSize();
     if (this.Changed != null)
     {
         this.Changed(this, new EventArgs());
     }
 }
コード例 #11
0
 private void InitializeComponent()
 {
     this.LookUpEditFrom = new DevExpress.XtraEditors.LookUpEdit();
     this.DateTimeControl = new ProtocolVN.Framework.Win.Trial.BasicControl();
     ((System.ComponentModel.ISupportInitialize)(this.LookUpEditFrom.Properties)).BeginInit();
     this.SuspendLayout();
     //
     // LookUpEditFrom
     //
     this.LookUpEditFrom.Dock = System.Windows.Forms.DockStyle.Left;
     this.LookUpEditFrom.EnterMoveNextControl = true;
     this.LookUpEditFrom.Location = new System.Drawing.Point(0, 0);
     this.LookUpEditFrom.Name = "LookUpEditFrom";
     this.LookUpEditFrom.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.False;
     this.LookUpEditFrom.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.LookUpEditFrom.Properties.Columns.AddRange(new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] {
     new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Value", "Value")});
     this.LookUpEditFrom.Properties.DisplayMember = "Value";
     this.LookUpEditFrom.Properties.DropDownRows = 9;
     this.LookUpEditFrom.Properties.NullText = "";
     this.LookUpEditFrom.Properties.SearchMode = DevExpress.XtraEditors.Controls.SearchMode.AutoComplete;
     this.LookUpEditFrom.Properties.ShowFooter = false;
     this.LookUpEditFrom.Properties.ShowHeader = false;
     this.LookUpEditFrom.Properties.ShowLines = false;
     this.LookUpEditFrom.Properties.ValueMember = "Key";
     this.LookUpEditFrom.Size = new System.Drawing.Size(72, 20);
     this.LookUpEditFrom.TabIndex = 0;
     this.LookUpEditFrom.EditValueChanged += new System.EventHandler(this.LookUpEditFrom_EditValueChanged);
     //
     // DateTimeControl
     //
     this.DateTimeControl.DateFrom = new System.DateTime(2011, 2, 24, 9, 35, 38, 592);
     this.DateTimeControl.DateTo = new System.DateTime(2011, 2, 24, 9, 35, 38, 592);
     this.DateTimeControl.Dock = System.Windows.Forms.DockStyle.Fill;
     this.DateTimeControl.Location = new System.Drawing.Point(72, 0);
     this.DateTimeControl.Name = "DateTimeControl";
     this.DateTimeControl.Size = new System.Drawing.Size(257, 20);
     this.DateTimeControl.TabIndex = 1;
     //
     // PLDateSelection
     //
     this.Controls.Add(this.DateTimeControl);
     this.Controls.Add(this.LookUpEditFrom);
     this.Name = "PLDateSelection";
     this.Size = new System.Drawing.Size(329, 20);
     this.Load += new System.EventHandler(this.PLDateSelection_Load);
     ((System.ComponentModel.ISupportInitialize)(this.LookUpEditFrom.Properties)).EndInit();
     this.ResumeLayout(false);
 }
コード例 #12
0
        private void ChangeSelection(SelectionTypes Selection)
        {
            BasicControl control;
            DateTime dateTo = DateTime.Now;
            //DateTime dateFrom = this.DateTimeControl.DateFrom;
            if (this.bkWith != null)
            {
                this.LookUpEditFrom.Width = (Int32)bkWith;
            }
            switch (Selection)
            {
                case SelectionTypes.None:
                    if (bkWith == null)
                        bkWith = this.LookUpEditFrom.Width;
                    this.LookUpEditFrom.Width = this.orginWith;
                    control = new BasicControl();
                    control.Visible = false;
                    break;
                case SelectionTypes.OneDate:
                    control = new DayControl(dateTo);
                    break;

                case SelectionTypes.OneMonth:
                    control = new PLMonthControl(dateTo);
                    break;

                case SelectionTypes.OneQuarter:
                    control = new PLQuarterControl(dateTo);
                    break;

                case SelectionTypes.OneYear:
                    control = new PLYearControl(dateTo);
                    break;

                case SelectionTypes.SixMonths:
                    control = new PLSixMonths(dateTo);
                    break;

                case SelectionTypes.FromQuarterToQuarter:
                    control = new PLFromToQuarter(dateTo.AddMonths(-9), dateTo);
                    break;

                case SelectionTypes.FromYearToYear:
                    control = new PLFromToYearDateTime(new DateTime(dateTo.Year - 1, 1, 1), new DateTime(dateTo.Year, 1, 1));
                    break;

                case SelectionTypes.FromDateToDate:
                    control = new PLFromToDay(dateTo.AddDays(-7), dateTo);
                    break;

                case SelectionTypes.FromMonthToMonth:
                    control = new PLFromToMonth(dateTo.AddMonths(-2), dateTo);
                    break;

                default:
                    control = new DayControl(dateTo);
                    break;
            }
            this.ShowControl(control);
        }
コード例 #13
0
 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;
 }