Exemplo n.º 1
0
        /// <summary>
        /// Event fired when the <see cref="simpleButtonOK"/> is clicked. This method repaints ALL the Arrows and Bars of the <see cref="CAD.viewportLayout1"/>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ReConditionLegend();

            ParentCAD.PaintBarForce(UserNoForceWishboneColour, DisplayWishboneForces);

            ParentCAD.ConditionArrowForce(UserForceArrowStyle, ArrowNoForceCylLength, ArrowNoForceColor, ForcesToBeDisplayed);

            this.Hide();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Public Inititalizer method which Performs all the Init activites required for a fully functioning <see cref="LegendEditor"/> Form
        /// </summary>
        /// <param name="_MasterOC">Base <see cref="OutputClass"/></param>
        /// <param name="_ParentCAD"></param>
        public void InitializeLegendEditor(OutputClass _MasterOC, CAD _ParentCAD)
        {
            ///<summary>Performing the Post Processing Activies of the Legend based on whether the Max and Min Value are 0. If they are 0 then it means the User is calling the Legend Editor for the very first time and hence the <see cref="BaseOC"/> should be passed</summary>
            if (MaxValue == 0 && MinValue == 0)
            {
                BaseOC = _MasterOC;
                _ParentCAD.PostProcessing(this, BaseOC, UsersGradient1, UsersGradient2, UsersGradientStyle, NoOfSteps, StepSize);
            }

            else
            {
                OutputClass tempOC = new OutputClass();
                tempOC.MaxForce = MaxValue;
                tempOC.MinForce = MinValue;
                _ParentCAD.PostProcessing(this, tempOC, UsersGradient1, UsersGradient2, UsersGradientStyle, NoOfSteps, StepSize);
            }

            ///<summary>Method to assign the Parent <see cref="CAD"/> object</summary>
            GetParentCADControl(_ParentCAD);

            ///<summary>Method to get the <see cref="LegendDataTable"/> property of this class</summary>
            GetDataLegendDataSource(_ParentCAD.LegendDataTable);

            ///<summary>Method to condition the <see cref="gridControl1"/> of this Form</summary>
            GridControlConditioning(_ParentCAD.LegendDataTable);

            ///<summary>Method to initialize the <see cref="CellValueChangedEventArgs"/> </summary>
            InitializeGridControlEvents();

            ///<remarks>
            ///It is best if the below lines of code are inside THIS Class and not the <see cref="VehicleGUI"/> class's <see cref="VehicleGUI.OutputDrawer(CAD, int, int, bool, bool)"/> method because this way, when the
            ///user wants to see the Forces of a different Motion Percentage, the options chosen by the user through the <see cref="LegendEditor"/> will be retained.
            /// </remarks>
            ///<summary>Painting the Bars according to Force Range in between which they lie. <see cref="LegendEditor.UserNoForceWishboneColour"/> value passed as <see cref="Color.White"/></summary>
            ParentCAD.PaintBarForce(UserNoForceWishboneColour, DisplayWishboneForces);

            ///<summary>Painting the Arrows according to Force Range in between which they lie</summary>
            ///<remarks>Since by default we have <see cref="ForceArrowStyle.Both"/> I can pass any random values for Length and Colour below</remarks>
            ParentCAD.ConditionArrowForce(UserForceArrowStyle, ArrowNoForceCylLength, ArrowNoForceColor, ForcesToBeDisplayed);
        }