예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack    = new NStackPanel();
            NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack);

            stack.Add(new NLabel("Vertical Axis"));

            NComboBox verticalAxisAlignmentComboBox = new NComboBox();

            verticalAxisAlignmentComboBox.FillFromEnum <ENAxisCrossAlignment>();
            verticalAxisAlignmentComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnVerticalAxisAlignmentComboBoxSelectedIndexChanged);
            stack.Add(NPairBox.Create("Alignment:", verticalAxisAlignmentComboBox));
            verticalAxisAlignmentComboBox.SelectedIndex = (int)ENAxisCrossAlignment.Center;

            NNumericUpDown verticalAxisOffsetUpDown = new NNumericUpDown();

            verticalAxisOffsetUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnVerticalAxisOffsetUpDownValueChanged);
            stack.Add(NPairBox.Create("Offset:", verticalAxisOffsetUpDown));

            stack.Add(new NLabel("Horizontal Axis"));
            NComboBox horizontalAxisAlignmentComboBox = new NComboBox();

            horizontalAxisAlignmentComboBox.FillFromEnum <ENAxisCrossAlignment>();
            horizontalAxisAlignmentComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnHorizontalAxisAlignmentComboBoxSelectedIndexChanged);
            stack.Add(NPairBox.Create("Alignment:", horizontalAxisAlignmentComboBox));
            horizontalAxisAlignmentComboBox.SelectedIndex = (int)ENAxisCrossAlignment.Center;

            NNumericUpDown horizontalAxisOffsetUpDown = new NNumericUpDown();

            horizontalAxisOffsetUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnHorizontalAxisOffsetUpDownValueChanged);
            stack.Add(NPairBox.Create("Offset:", horizontalAxisOffsetUpDown));

            return(boxGroup);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack = new NStackPanel();
            NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack);

            NCheckBox inflateMarginsCheckBox = new NCheckBox();

            inflateMarginsCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnInflateMarginsCheckBoxCheckedChanged);
            stack.Add(NPairBox.Create("Inflate Margins: ", inflateMarginsCheckBox));

            NCheckBox verticalAxisRoundToTick = new NCheckBox();

            verticalAxisRoundToTick.CheckedChanged += new Function <NValueChangeEventArgs>(OnverticalAxisRoundToTickCheckedChanged);
            stack.Add(NPairBox.Create("Left Axis Round To Tick: ", verticalAxisRoundToTick));

            NNumericUpDown pointSizeNumericUpDown = new NNumericUpDown();

            pointSizeNumericUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnPointSizeNumericUpDownValueChanged);
            stack.Add(NPairBox.Create("Point Size: ", pointSizeNumericUpDown));

            NComboBox pointShapeComboBox = new NComboBox();

            pointShapeComboBox.FillFromEnum <ENPointShape>();
            pointShapeComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnPointShapeComboBoxSelectedIndexChanged);
            stack.Add(NPairBox.Create("Point Shape: ", pointShapeComboBox));

            return(group);
        }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack = new NStackPanel();
            NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack);

            NNumericUpDown beginAngleUpDown = new NNumericUpDown();

            beginAngleUpDown.Value         = m_PieChart.BeginAngle;
            beginAngleUpDown.ValueChanged += OnBeginAngleUpDownValueChanged;
            stack.Add(NPairBox.Create("Begin Angle:", beginAngleUpDown));

            NNumericUpDown sweepAngleUpDown = new NNumericUpDown();

            sweepAngleUpDown.Value         = m_PieChart.SweepAngle;
            sweepAngleUpDown.Minimum       = -360;
            sweepAngleUpDown.Maximum       = 360;
            sweepAngleUpDown.ValueChanged += OnSweepAngleUpDownValueChanged;
            stack.Add(NPairBox.Create("Sweep Angle:", sweepAngleUpDown));

            NCheckBox enableLabelAdjustmentCheckBox = new NCheckBox("Enable Label Adjustment");

            enableLabelAdjustmentCheckBox.CheckedChanged += OnEnableLabelAdjustmentCheckBoxCheckedChanged;
            enableLabelAdjustmentCheckBox.Checked         = true;
            stack.Add(enableLabelAdjustmentCheckBox);

            return(group);
        }
예제 #4
0
        protected override NWidget CreateExampleControls()
        {
            NTableFlowPanel table = new NTableFlowPanel();

            table.MaxOrdinal = 2;

            NLabel label = new NLabel("Value:");

            label.HorizontalPlacement = ENHorizontalPlacement.Right;
            label.VerticalPlacement   = ENVerticalPlacement.Center;
            table.Add(label);

            NNumericUpDown numericUpDown = new NNumericUpDown();

            numericUpDown.Minimum       = 0;
            numericUpDown.Maximum       = 100;
            numericUpDown.Value         = DefaultProgress;
            numericUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnValueChanged);
            table.Add(numericUpDown);

            label = new NLabel("Label Style:");
            label.HorizontalPlacement = ENHorizontalPlacement.Right;
            label.VerticalPlacement   = ENVerticalPlacement.Center;
            table.Add(label);

            NComboBox comboBox = new NComboBox();

            comboBox.FillFromEnum <ENProgressBarLabelStyle>();
            comboBox.SelectedIndex         = (int)m_HorizontalProgressBar.LabelStyle;
            comboBox.SelectedIndexChanged += OnLabelStyleSelected;
            table.Add(comboBox);

            return(table);
        }
예제 #5
0
        protected override NWidget CreateExampleControls()
        {
            // Canvas width editor
            m_CanvasWidthUpDown               = new NNumericUpDown();
            m_CanvasWidthUpDown.Minimum       = 60;
            m_CanvasWidthUpDown.Maximum       = 300;
            m_CanvasWidthUpDown.Value         = defaultCanvasWidth;
            m_CanvasWidthUpDown.Step          = 1;
            m_CanvasWidthUpDown.DecimalPlaces = 0;
            m_CanvasWidthUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            // Canvas height editor
            m_CanvasHeightUpDown               = new NNumericUpDown();
            m_CanvasHeightUpDown.Minimum       = 60;
            m_CanvasHeightUpDown.Maximum       = 300;
            m_CanvasHeightUpDown.Value         = defaultCanvasHeight;
            m_CanvasHeightUpDown.Step          = 1;
            m_CanvasHeightUpDown.DecimalPlaces = 0;
            m_CanvasHeightUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            // create a stack and put the controls in it
            NStackPanel stack = new NStackPanel();

            stack.Add(NPairBox.Create("Canvas Width:", m_CanvasWidthUpDown));
            stack.Add(NPairBox.Create("Canvas Height:", m_CanvasHeightUpDown));

            return(new NUniSizeBoxGroup(stack));
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack    = new NStackPanel();
            NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack);

            NComboBox seriesLegendModeComboBox = new NComboBox();

            seriesLegendModeComboBox.FillFromEnum <ENSeriesLegendMode>();
            seriesLegendModeComboBox.SelectedIndexChanged += OnSeriesLegendModeComboBoxSelectedIndexChanged;
            seriesLegendModeComboBox.SelectedIndex         = (int)ENSeriesLegendMode.Series;
            stack.Add(NPairBox.Create("Legend Mode: ", seriesLegendModeComboBox));

            NComboBox seriesLegendOrderComboBox = new NComboBox();

            seriesLegendOrderComboBox.FillFromEnum <ENSeriesLegendOrder>();
            seriesLegendOrderComboBox.SelectedIndexChanged += OnSeriesLegendOrderComboBoxSelectedIndexChanged;
            seriesLegendOrderComboBox.SelectedIndex         = (int)ENSeriesLegendOrder.Append;
            stack.Add(NPairBox.Create("Legend Order: ", seriesLegendOrderComboBox));

            NNumericUpDown markSizeUpDown = new NNumericUpDown();

            markSizeUpDown.ValueChanged += OnMarkSizeUpDownValueChanged;
            markSizeUpDown.Value         = 10;
            stack.Add(NPairBox.Create("Mark Size: ", markSizeUpDown));

            NNumericUpDown fontSizeUpDown = new NNumericUpDown();

            fontSizeUpDown.ValueChanged += OnFontSizeUpDownValueChanged;
            fontSizeUpDown.Value         = 10;
            stack.Add(NPairBox.Create("Font Size: ", fontSizeUpDown));

            return(boxGroup);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack    = new NStackPanel();
            NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack);

            stack.Add(new NLabel("Vertical Axis"));
            NCheckBox verticalAxisUsePositionCheckBox = new NCheckBox("Use Position");

            verticalAxisUsePositionCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnVerticalAxisUsePositionCheckBoxCheckedChanged);
            stack.Add(verticalAxisUsePositionCheckBox);

            m_VerticalAxisPositionValueUpDown = new NNumericUpDown();
            m_VerticalAxisPositionValueUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnVerticalAxisPositionValueUpDownValueChanged);
            stack.Add(NPairBox.Create("Position Value:", m_VerticalAxisPositionValueUpDown));

            stack.Add(new NLabel("Horizontal Axis"));
            NCheckBox horizontalAxisUsePositionCheckBox = new NCheckBox("Use Position");

            horizontalAxisUsePositionCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnHorizontalAxisUsePositionCheckBoxCheckedChanged);
            stack.Add(horizontalAxisUsePositionCheckBox);

            m_HorizontalAxisPositionValueUpDown = new NNumericUpDown();
            m_HorizontalAxisPositionValueUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnHorizontalAxisPositionValueUpDownValueChanged);
            stack.Add(NPairBox.Create("Position Value:", m_HorizontalAxisPositionValueUpDown));

            verticalAxisUsePositionCheckBox.Checked   = true;
            horizontalAxisUsePositionCheckBox.Checked = true;

            return(boxGroup);
        }
예제 #8
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack = new NStackPanel();
            NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack);

            NNumericUpDown beginAngleUpDown = new NNumericUpDown();

            beginAngleUpDown.ValueChanged += OnBeginAngleUpDownValueChanged;
            beginAngleUpDown.Value         = 90;
            stack.Add(NPairBox.Create("Begin Angle:", beginAngleUpDown));

            NComboBox titleAngleModeComboBox = new NComboBox();

            titleAngleModeComboBox.FillFromEnum <ENScaleLabelAngleMode>();
            titleAngleModeComboBox.SelectedIndexChanged += OnTitleAngleModeComboBoxSelectedIndexChanged;
            titleAngleModeComboBox.SelectedIndex         = (int)ENScaleLabelAngleMode.Scale;
            stack.Add(NPairBox.Create("Title Angle Mode:", titleAngleModeComboBox));

            NNumericUpDown titleAngleUpDown = new NNumericUpDown();

            titleAngleUpDown.ValueChanged += OnTitleAngleUpDownValueChanged;
            titleAngleUpDown.Value         = 0;
            stack.Add(NPairBox.Create("Title Angle:", titleAngleUpDown));

            return(group);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack    = new NStackPanel();
            NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack);

            NComboBox orientationComboBox = new NComboBox();

            orientationComboBox.FillFromEnum <ENCartesianChartOrientation>();
            orientationComboBox.SelectedIndex         = (int)m_Chart.Orientation;
            orientationComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnOrientationComboBoxSelectedIndexChanged);
            stack.Add(NPairBox.Create("Orientation:", orientationComboBox));

            m_AngleModeComboBox = new NComboBox();
            m_AngleModeComboBox.FillFromEnum <ENScaleLabelAngleMode>();
            m_AngleModeComboBox.SelectedIndex         = (int)ENScaleLabelAngleMode.Scale;
            m_AngleModeComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnAxisLabelChanged);
            stack.Add(NPairBox.Create("Angle Mode:", m_AngleModeComboBox));

            m_CustomAngleNumericUpDown               = new NNumericUpDown();
            m_CustomAngleNumericUpDown.Minimum       = 0;
            m_CustomAngleNumericUpDown.Maximum       = 360;
            m_CustomAngleNumericUpDown.Value         = 0;
            m_CustomAngleNumericUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnAxisLabelChanged);
            stack.Add(NPairBox.Create("Custom Angle:", m_CustomAngleNumericUpDown));

            m_AllowLabelsToFlipCheckBox                 = new NCheckBox("Allow Label To Flip");
            m_AllowLabelsToFlipCheckBox.Checked         = false;
            m_AllowLabelsToFlipCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnAxisLabelChanged);
            stack.Add(m_AllowLabelsToFlipCheckBox);

            return(boxGroup);
        }
예제 #10
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack = new NStackPanel();
            NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack);

            NComboBox funnelShapeCombo = new NComboBox();

            funnelShapeCombo.FillFromEnum <ENFunnelShape>();
            funnelShapeCombo.SelectedIndexChanged += OnFunnelShapeComboSelectedIndexChanged;
            funnelShapeCombo.SelectedIndex         = (int)ENFunnelShape.Trapezoid;
            stack.Add(NPairBox.Create("Funnel Shape:", funnelShapeCombo));

            NComboBox labelAligmentModeCombo = new NComboBox();

            labelAligmentModeCombo.FillFromEnum <ENFunnelLabelMode>();
            labelAligmentModeCombo.SelectedIndexChanged += OnLabelAligmentModeComboSelectedIndexChanged;
            labelAligmentModeCombo.SelectedIndex         = (int)ENFunnelLabelMode.Center;
            stack.Add(NPairBox.Create("Label Alignment:", labelAligmentModeCombo));

            NNumericUpDown labelArrowLengthUpDown = new NNumericUpDown();

            labelArrowLengthUpDown.Value         = m_FunnelSeries.LabelArrowLength;
            labelArrowLengthUpDown.ValueChanged += OnLabelArrowLengthUpDownValueChanged;
            stack.Add(NPairBox.Create("Label Arrow Length:", labelArrowLengthUpDown));

            NNumericUpDown pointGapUpDown = new NNumericUpDown();

            pointGapUpDown.Value         = m_FunnelSeries.PointGapPercent;
            pointGapUpDown.ValueChanged += OnPointGapUpDownValueChanged;
            stack.Add(NPairBox.Create("Point Gap Percent:", pointGapUpDown));

            return(group);
        }
예제 #11
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack    = new NStackPanel();
            NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack);

            NComboBox legendExpandModeComboBox = new NComboBox();

            legendExpandModeComboBox.FillFromEnum <ENLegendExpandMode>();
            legendExpandModeComboBox.SelectedIndexChanged += OnLegendExpandModeComboBoxSelectedIndexChanged;
            legendExpandModeComboBox.SelectedIndex         = (int)ENLegendExpandMode.RowsOnly;
            stack.Add(NPairBox.Create("Expand Mode: ", legendExpandModeComboBox));

            m_RowCountUpDown               = new NNumericUpDown();
            m_RowCountUpDown.Enabled       = false;
            m_RowCountUpDown.Minimum       = 1;
            m_RowCountUpDown.Value         = 1;
            m_RowCountUpDown.ValueChanged += OnRowCountUpDownValueChanged;
            stack.Add(NPairBox.Create("Row Count: ", m_RowCountUpDown));

            m_ColCountUpDown               = new NNumericUpDown();
            m_ColCountUpDown.Enabled       = false;
            m_ColCountUpDown.Minimum       = 1;
            m_ColCountUpDown.Value         = 1;
            m_ColCountUpDown.ValueChanged += OnColCountUpDownValueChanged;
            stack.Add(NPairBox.Create("Col Count: ", m_ColCountUpDown));

            return(boxGroup);
        }
예제 #12
0
        private NWidget CreateLoanCalculator()
        {
            NStackPanel stack = new NStackPanel();

            stack.Font = new NFont(NFontDescriptor.DefaultSansFamilyName, 10);
            stack.HorizontalPlacement = ENHorizontalPlacement.Left;
            stack.VerticalSpacing     = NDesign.VerticalSpacing * 2;

            NLabel titleLabel = new NLabel(NLoc.Get("Loan Calculator"));

            titleLabel.Font          = new NFont(NFontDescriptor.DefaultSansFamilyName, 16);
            titleLabel.Margins       = new NMargins(0, 0, 0, NDesign.VerticalSpacing);
            titleLabel.TextAlignment = ENContentAlignment.MiddleCenter;
            stack.Add(titleLabel);

            m_AmountUpDown               = new NNumericUpDown();
            m_AmountUpDown.Value         = 10000;
            m_AmountUpDown.Step          = 500;
            m_AmountUpDown.ValueChanged += OnUpDownValueChanged;
            stack.Add(NPairBox.Create(NLoc.Get("Amount:"), m_AmountUpDown));

            m_TermUpDown               = new NNumericUpDown();
            m_TermUpDown.Value         = 8;
            m_TermUpDown.ValueChanged += OnUpDownValueChanged;
            stack.Add(NPairBox.Create(NLoc.Get("Term in years:"), m_TermUpDown));

            m_RateUpDown               = new NNumericUpDown();
            m_RateUpDown.Value         = 5;
            m_RateUpDown.Step          = 0.1;
            m_RateUpDown.DecimalPlaces = 2;
            m_RateUpDown.ValueChanged += OnUpDownValueChanged;
            stack.Add(NPairBox.Create(NLoc.Get("Interest rate per year (%):"), m_RateUpDown));

            // Create the results labels
            NLabel repaymentLabel = new NLabel(NLoc.Get("Repayment Summary"));

            repaymentLabel.Margins       = new NMargins(0, NDesign.VerticalSpacing * 5, 0, 0);
            repaymentLabel.Font          = new NFont(NFontDescriptor.DefaultSansFamilyName, 12, ENFontStyle.Underline);
            repaymentLabel.TextAlignment = ENContentAlignment.MiddleCenter;
            stack.Add(repaymentLabel);

            m_MonthlyPaymentLabel = new NLabel();
            m_MonthlyPaymentLabel.TextAlignment = ENContentAlignment.MiddleRight;
            stack.Add(NPairBox.Create(NLoc.Get("Monthly Payment:"), m_MonthlyPaymentLabel));

            m_TotalPaymentsLabel = new NLabel();
            m_TotalPaymentsLabel.TextAlignment = ENContentAlignment.MiddleRight;
            stack.Add(NPairBox.Create(NLoc.Get("Total Payments:"), m_TotalPaymentsLabel));

            m_TotalInterestLabel = new NLabel();
            m_TotalInterestLabel.TextAlignment = ENContentAlignment.MiddleRight;
            stack.Add(NPairBox.Create(NLoc.Get("Total Interest:"), m_TotalInterestLabel));

            CalculateResult();

            return(new NUniSizeBoxGroup(stack));
        }
예제 #13
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack    = new NStackPanel();
            NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack);

            NNumericUpDown originXUpDown = new NNumericUpDown();

            originXUpDown.ValueChanged += OnOriginXUpDownValueChanged;
            originXUpDown.Value         = 0;
            stack.Add(NPairBox.Create("Origin X:", originXUpDown));

            NNumericUpDown originYUpDown = new NNumericUpDown();

            originYUpDown.ValueChanged += OnOriginYUpDownValueChanged;
            originYUpDown.Value         = 0;
            stack.Add(NPairBox.Create("Origin Y:", originYUpDown));

            NNumericUpDown GridStepXUpDown = new NNumericUpDown();

            GridStepXUpDown.ValueChanged += OnGridStepXUpDownValueChanged;
            GridStepXUpDown.Value         = 1.0;
            stack.Add(NPairBox.Create("Grid Step X:", GridStepXUpDown));

            NNumericUpDown GridStepYUpDown = new NNumericUpDown();

            GridStepYUpDown.ValueChanged += OnGridStepYUpDownValueChanged;
            GridStepYUpDown.Value         = 1.0;
            stack.Add(NPairBox.Create("Grid Step Y:", GridStepYUpDown));

            NComboBox contourDisplayModeCombo = new NComboBox();

            contourDisplayModeCombo.FillFromEnum <ENContourDisplayMode>();
            contourDisplayModeCombo.SelectedIndexChanged += OnContourDisplayModeComboSelectedIndexChanged;
            contourDisplayModeCombo.SelectedIndex         = (int)ENContourDisplayMode.Contour;
            stack.Add(NPairBox.Create("Contour Display Mode:", contourDisplayModeCombo));

            NComboBox contourColorModeCombo = new NComboBox();

            contourColorModeCombo.FillFromEnum <ENContourColorMode>();
            contourColorModeCombo.SelectedIndexChanged += OnContourColorModeComboSelectedIndexChanged;
            contourColorModeCombo.SelectedIndex         = (int)ENContourColorMode.Uniform;
            stack.Add(NPairBox.Create("Contour Color Mode:", contourColorModeCombo));

            NCheckBox showFillCheckBox = new NCheckBox("Show Fill");

            showFillCheckBox.CheckedChanged += OnShowFillCheckBoxCheckedChanged;
            showFillCheckBox.Checked         = true;
            stack.Add(showFillCheckBox);

            NCheckBox smoothPaletteCheckBox = new NCheckBox("Smooth Palette");

            smoothPaletteCheckBox.CheckedChanged += OnSmoothPaletteCheckBoxCheckedChanged;
            smoothPaletteCheckBox.Checked         = true;
            stack.Add(smoothPaletteCheckBox);

            return(boxGroup);
        }
        protected override NWidget CreateExampleControls()
        {
            NStackPanel stack = new NStackPanel();

            NStackPanel propertyStack = new NStackPanel();

            stack.Add(new NUniSizeBoxGroup(propertyStack));

            m_RangeIndicatorValueUpDown = new NNumericUpDown();
            propertyStack.Add(new NPairBox("Range Indicator Value:", m_RangeIndicatorValueUpDown, true));
            m_RangeIndicatorValueUpDown.Value         = m_Indicator1.Value;
            m_RangeIndicatorValueUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnRangeIndicatorValueUpDownValueChanged);

            m_RangeIndicatorOriginModeComboBox = new NComboBox();
            propertyStack.Add(new NPairBox("Range Indicator Origin Mode:", m_RangeIndicatorOriginModeComboBox, true));
            m_RangeIndicatorOriginModeComboBox.FillFromEnum <ENRangeIndicatorOriginMode>();
            m_RangeIndicatorOriginModeComboBox.SelectedIndex         = (int)ENRangeIndicatorOriginMode.ScaleMin;
            m_RangeIndicatorOriginModeComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnRangeIndicatorOriginModeComboBoxSelectedIndexChanged);

            m_RangeIndicatorOriginUpDown         = new NNumericUpDown();
            m_RangeIndicatorOriginUpDown.Value   = 0.0;
            m_RangeIndicatorOriginUpDown.Enabled = false;
            propertyStack.Add(new NPairBox("Range Indicator Origin:", m_RangeIndicatorOriginUpDown, true));
            m_RangeIndicatorOriginUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnRangeIndicatorOriginUpDownValueChanged);

            m_ValueIndicatorUpDown = new NNumericUpDown();
            propertyStack.Add(new NPairBox("Value Indicator Value:", m_ValueIndicatorUpDown, true));
            m_ValueIndicatorUpDown.Value         = m_Indicator2.Value;
            m_ValueIndicatorUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnValueIndicatorUpDownValueChanged);

            m_ValueIndicatorShapeComboBox = new NComboBox();
            propertyStack.Add(new NPairBox("Value Indicator Shape", m_ValueIndicatorShapeComboBox, true));
            m_ValueIndicatorShapeComboBox.FillFromEnum <ENScaleValueMarkerShape>();
            m_ValueIndicatorShapeComboBox.SelectedIndex         = (int)m_Indicator2.Shape;
            m_ValueIndicatorShapeComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnValueIndicatorShapeComboBoxSelectedIndexChanged);


            m_GaugeOrientationCombo = new NComboBox();
            propertyStack.Add(new NPairBox("Gauge Orientation:", m_GaugeOrientationCombo, true));

            m_GaugeOrientationCombo.FillFromEnum <ENLinearGaugeOrientation>();
            m_GaugeOrientationCombo.SelectedIndex         = (int)ENLinearGaugeOrientation.Horizontal;
            m_GaugeOrientationCombo.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnGaugeOrientationComboSelectedIndexChanged);

            m_MarkerWidthUpDown = new NNumericUpDown();
            propertyStack.Add(new NPairBox("Marker Width:", m_MarkerWidthUpDown, true));
            m_MarkerWidthUpDown.Value = m_Indicator2.Width;

            m_MarkerHeightUpDown = new NNumericUpDown();
            propertyStack.Add(new NPairBox("Marker Height:", m_MarkerHeightUpDown, true));
            m_MarkerHeightUpDown.Value = m_Indicator2.Height;

            return(stack);
        }
예제 #15
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        private NNumericUpDown CreateUpDown(double value)
        {
            NNumericUpDown numericUpDown = new NNumericUpDown();

            numericUpDown.Minimum       = 0.0;
            numericUpDown.Maximum       = 100.0;
            numericUpDown.Value         = value;
            numericUpDown.ValueChanged += new Function <NValueChangeEventArgs>(UpdateSections);

            return(numericUpDown);
        }
예제 #16
0
        NNumericUpDown CreateNumericUpDown(double min, double max, double value)
        {
            NNumericUpDown control = new NNumericUpDown();

            control.Minimum       = min;
            control.Maximum       = max;
            control.Value         = value;
            control.Step          = 1;
            control.DecimalPlaces = 0;
            control.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);
            return(control);
        }
예제 #17
0
        internal Control GetControl()
        {
            switch (m_ControlCombo.SelectedIndex)
            {
            case 0:
                return(null);

            case 1:
                NTextBox tb = new NTextBox();
                tb.Text = "NTextBox";
                return(tb);

            case 2:
                NComboBox cb = new NComboBox();
                cb.ImageList = MainForm.TestImages;
                for (int i = 0; i < 20; i++)
                {
                    cb.Items.Add(new NListBoxItem(i, "Item " + (i + 1), false));
                }
                return(cb);

            case 3:
                NButton b = new NButton();
                b.Text = "Test Button";
                return(b);

            case 4:
                NNumericUpDown ud = new NNumericUpDown();
                return(ud);

            case 5:
                NCheckBox chb = new NCheckBox();
                chb.Text = "NCheckBox";
                chb.TransparentBackground = true;
                return(chb);

            case 6:
                NRadioButton rb = new NRadioButton();
                rb.Text = "NRadioButton";
                rb.TransparentBackground = true;
                return(rb);

            case 7:
                NProgressBar bar = new NProgressBar();
                bar.Properties.Style = Nevron.UI.WinForm.Controls.ProgressBarStyle.Gradient;
                bar.Properties.Value = 60;
                return(bar);
            }

            return(null);
        }
예제 #18
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack    = new NStackPanel();
            NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack);

            m_EnableScaleBreaksCheckBox = new NCheckBox("Enable Scale Breaks");
            m_EnableScaleBreaksCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnEnableScaleBreaksCheckBoxCheckedChanged);
            stack.Add(m_EnableScaleBreaksCheckBox);

            m_ThresholdUpDown               = new NNumericUpDown();
            m_ThresholdUpDown.Step          = 0.05;
            m_ThresholdUpDown.Maximum       = 1;
            m_ThresholdUpDown.DecimalPlaces = 2;
            m_ThresholdUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnThresholdUpDownValueChanged);
            stack.Add(NPairBox.Create("Threshold", m_ThresholdUpDown));

            m_LengthUpDown = new NNumericUpDown();
            m_LengthUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnLengthUpDownValueChanged);
            stack.Add(NPairBox.Create("Length", m_LengthUpDown));

            m_MaxBreaksUpDown = new NNumericUpDown();
            m_MaxBreaksUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnMaxBreaksUpDownValueChanged);
            stack.Add(NPairBox.Create("Max Breaks", m_MaxBreaksUpDown));

            m_PositionModeComboBox = new NComboBox();
            m_PositionModeComboBox.FillFromEnum <ENScaleBreakPositionMode>();
            m_PositionModeComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnPositionModeComboBoxSelectedIndexChanged);
            stack.Add(NPairBox.Create("Position Mode:", m_PositionModeComboBox));

            m_PositionPercentUpDown               = new NNumericUpDown();
            m_PositionPercentUpDown.Minimum       = 0;
            m_PositionPercentUpDown.Maximum       = 100;
            m_PositionPercentUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnPositionPercentUpDownValueChanged);
            stack.Add(NPairBox.Create("Position Percent:", m_PositionPercentUpDown));

            NButton changeDataButton = new NButton("Change Data");

            changeDataButton.Click += new Function <NEventArgs>(OnChangeDataButtonClick);
            stack.Add(changeDataButton);

            // update initial state
            m_EnableScaleBreaksCheckBox.Checked = true;
            m_LengthUpDown.Value                 = 5;
            m_ThresholdUpDown.Value              = 0.25; // this is relatively low factor
            m_MaxBreaksUpDown.Value              = 1;
            m_PositionPercentUpDown.Value        = 50;
            m_PositionModeComboBox.SelectedIndex = (int)ENScaleBreakPositionMode.Content;             // use content mode by default

            return(boxGroup);
        }
예제 #19
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      propertyStack = new NStackPanel();
            NUniSizeBoxGroup boxGroup      = new NUniSizeBoxGroup(propertyStack);

            NNumericUpDown gapPercentNumericUpDown = new NNumericUpDown();

            propertyStack.Add(NPairBox.Create("Gap Percent: ", gapPercentNumericUpDown));

            gapPercentNumericUpDown.Value         = m_Bar1.GapFactor * 100.0;
            gapPercentNumericUpDown.ValueChanged += new Function <NValueChangeEventArgs>(gapPercentNumericUpDown_ValueChanged);

            return(boxGroup);
        }
예제 #20
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack = new NStackPanel();
            NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack);

            NCheckBox inflateMarginsCheckBox = new NCheckBox("Inflate Margins");

            inflateMarginsCheckBox.CheckedChanged += OnInflateMarginsCheckBoxCheckedChanged;
            inflateMarginsCheckBox.Checked         = true;
            stack.Add(inflateMarginsCheckBox);

            NCheckBox showUpperXErrorCheckBox = new NCheckBox("Show Upper X Error");

            showUpperXErrorCheckBox.CheckedChanged += OnShowUpperXErrorCheckBoxCheckedChanged;
            showUpperXErrorCheckBox.Checked         = true;
            stack.Add(showUpperXErrorCheckBox);

            NCheckBox showLowerXErrorCheckBox = new NCheckBox("Show Lower X Error");

            showLowerXErrorCheckBox.CheckedChanged += OnShowLowerXErrorCheckBoxCheckedChanged;
            showLowerXErrorCheckBox.Checked         = true;
            stack.Add(showLowerXErrorCheckBox);

            NNumericUpDown xErrorSizeUpDown = new NNumericUpDown();

            xErrorSizeUpDown.Value         = m_ErrorBar.XErrorSize;
            xErrorSizeUpDown.ValueChanged += OnXErrorSizeUpDownValueChanged;
            stack.Add(NPairBox.Create("X Error Size:", xErrorSizeUpDown));

            NCheckBox showUpperYErrorCheckBox = new NCheckBox("Show Upper Y Error");

            showUpperYErrorCheckBox.CheckedChanged += OnShowUpperYErrorCheckBoxCheckedChanged;
            showUpperYErrorCheckBox.Checked         = true;
            stack.Add(showUpperYErrorCheckBox);

            NCheckBox showLowerYErrorCheckBox = new NCheckBox("Show Lower Y Error");

            showLowerYErrorCheckBox.CheckedChanged += OnShowLowerYErrorCheckBoxCheckedChanged;
            showLowerYErrorCheckBox.Checked         = true;
            stack.Add(showLowerYErrorCheckBox);

            NNumericUpDown yErrorSizeUpDown = new NNumericUpDown();

            yErrorSizeUpDown.Value         = m_ErrorBar.YErrorSize;
            yErrorSizeUpDown.ValueChanged += OnYErrorSizeUpDownValueChanged;
            stack.Add(NPairBox.Create("X Error Size:", yErrorSizeUpDown));

            return(group);
        }
예제 #21
0
        protected override NWidget CreateExampleControls()
        {
            // path rotation angle editor
            m_PathAngleSpin               = new NNumericUpDown();
            m_PathAngleSpin.Minimum       = 0;
            m_PathAngleSpin.Maximum       = 360;
            m_PathAngleSpin.Value         = m_PathAngle;
            m_PathAngleSpin.Step          = 1;
            m_PathAngleSpin.DecimalPlaces = 1;
            m_PathAngleSpin.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            // path rotation angle editor
            m_TextureAngleSpin               = new NNumericUpDown();
            m_TextureAngleSpin.Minimum       = 0;
            m_TextureAngleSpin.Maximum       = 360;
            m_TextureAngleSpin.Value         = m_MyTextureMapping.TextureAngle;
            m_TextureAngleSpin.Step          = 1;
            m_TextureAngleSpin.DecimalPlaces = 1;
            m_TextureAngleSpin.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            // X position editor
            m_XPositionSpin               = new NNumericUpDown();
            m_XPositionSpin.Minimum       = 0;
            m_XPositionSpin.Maximum       = 800;
            m_XPositionSpin.Value         = m_PathPositionX;
            m_XPositionSpin.Step          = 1;
            m_XPositionSpin.DecimalPlaces = 1;
            m_XPositionSpin.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            // Y position editor
            m_YPositionSpin               = new NNumericUpDown();
            m_YPositionSpin.Minimum       = 0;
            m_YPositionSpin.Maximum       = 600;
            m_YPositionSpin.Value         = m_PathPositionY;
            m_YPositionSpin.Step          = 1;
            m_YPositionSpin.DecimalPlaces = 1;
            m_YPositionSpin.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            NStackPanel stack = new NStackPanel();

            stack.FillMode = ENStackFillMode.None;
            stack.FitMode  = ENStackFitMode.None;
            stack.Add(NPairBox.Create("Path Angle (degrees):", m_PathAngleSpin));
            stack.Add(NPairBox.Create("Texture Angle (degrees):", m_TextureAngleSpin));
            stack.Add(NPairBox.Create("X Position:", m_XPositionSpin));
            stack.Add(NPairBox.Create("Y Position:", m_YPositionSpin));

            return(new NUniSizeBoxGroup(stack));
        }
예제 #22
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack = new NStackPanel();
            NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack);

            NNumericUpDown reversalAmountUpDown = new NNumericUpDown();

            reversalAmountUpDown.Minimum       = 1;
            reversalAmountUpDown.Maximum       = 100;
            reversalAmountUpDown.Value         = m_KagiSeries.ReversalAmount;
            reversalAmountUpDown.ValueChanged += OnReversalAmountUpDownValueChanged;
            stack.Add(NPairBox.Create("Reversal Amount:", reversalAmountUpDown));

            return(group);
        }
        protected override NWidget CreateExampleControls()
        {
            NGroupBox         groupBox   = new NGroupBox("Gradients Variant:");
            NRadioButtonGroup radioGroup = new NRadioButtonGroup();

            groupBox.Content = radioGroup;

            NStackPanel radioButtonsStack = new NStackPanel();

            radioGroup.Content = radioButtonsStack;

            for (int i = 0; i < 16; i++)
            {
                NRadioButton radioButton = new NRadioButton("Variant " + i.ToString());
                radioButtonsStack.Add(radioButton);
            }

            radioGroup.SelectedIndex         = 0;
            radioGroup.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnRadioGroupSelectedIndexChanged);

            // Canvas width editor
            m_CanvasWidthUpDown               = new NNumericUpDown();
            m_CanvasWidthUpDown.Minimum       = 100;
            m_CanvasWidthUpDown.Maximum       = 350;
            m_CanvasWidthUpDown.Value         = defaultCanvasWidth;
            m_CanvasWidthUpDown.Step          = 1;
            m_CanvasWidthUpDown.DecimalPlaces = 0;
            m_CanvasWidthUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            // Canvas height editor
            m_CanvasHeightUpDown               = new NNumericUpDown();
            m_CanvasHeightUpDown.Minimum       = 100;
            m_CanvasHeightUpDown.Maximum       = 350;
            m_CanvasHeightUpDown.Value         = defaultCanvasHeight;
            m_CanvasHeightUpDown.Step          = 1;
            m_CanvasHeightUpDown.DecimalPlaces = 0;
            m_CanvasHeightUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            NStackPanel stack = new NStackPanel();

            stack.FillMode = ENStackFillMode.None;
            stack.FitMode  = ENStackFitMode.None;
            stack.Add(groupBox);
            stack.Add(NPairBox.Create("Canvas Width:", m_CanvasWidthUpDown));
            stack.Add(NPairBox.Create("Canvas Height:", m_CanvasHeightUpDown));

            return(new NUniSizeBoxGroup(stack));
        }
        protected override NWidget CreateExampleControls()
        {
            NEditor fillEditor = NDesigner.GetDesigner(NFill.NFillSchema).CreatePropertyEditor(this, FillProperty);

            // Stroke color
            m_StrokeColorBox = new NColorBox();
            m_StrokeColorBox.SelectedColor         = m_Stroke.Color;
            m_StrokeColorBox.SelectedColorChanged += new Function <NValueChangeEventArgs>(OnStrokeColorBoxSelectedColorChanged);

            // Stroke width
            m_StrokeWidthCombo = new NComboBox();
            for (int i = 0; i < 6; i++)
            {
                m_StrokeWidthCombo.Items.Add(new NComboBoxItem(i.ToString()));
            }
            m_StrokeWidthCombo.SelectedIndex         = 1;
            m_StrokeWidthCombo.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnStrokeWidthComboSelectedIndexChanged);

            // Canvas width editor
            m_CanvasWidthUpDown               = new NNumericUpDown();
            m_CanvasWidthUpDown.Minimum       = 100;
            m_CanvasWidthUpDown.Maximum       = 350;
            m_CanvasWidthUpDown.Value         = defaultCanvasWidth;
            m_CanvasWidthUpDown.Step          = 1;
            m_CanvasWidthUpDown.DecimalPlaces = 0;
            m_CanvasWidthUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            // Canvas height editor
            m_CanvasHeightUpDown               = new NNumericUpDown();
            m_CanvasHeightUpDown.Minimum       = 100;
            m_CanvasHeightUpDown.Maximum       = 350;
            m_CanvasHeightUpDown.Value         = defaultCanvasHeight;
            m_CanvasHeightUpDown.Step          = 1;
            m_CanvasHeightUpDown.DecimalPlaces = 0;
            m_CanvasHeightUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            NStackPanel stack = new NStackPanel();

            stack.FillMode = ENStackFillMode.None;
            stack.FitMode  = ENStackFitMode.None;
            stack.Add(fillEditor);
            stack.Add(NPairBox.Create("Stroke Color:", m_StrokeColorBox));
            stack.Add(NPairBox.Create("Stroke Width:", m_StrokeWidthCombo));
            stack.Add(NPairBox.Create("Canvas Width:", m_CanvasWidthUpDown));
            stack.Add(NPairBox.Create("Canvas Height:", m_CanvasHeightUpDown));

            return(new NUniSizeBoxGroup(stack));
        }
예제 #25
0
        protected override NWidget CreateExampleControls()
        {
            NStackPanel stack = new NStackPanel();

            // Create the projection combo box
            m_ProjectionComboBox = new NComboBox();
            m_ProjectionComboBox.FillFromArray(m_Projections);
            m_ProjectionComboBox.SelectedIndex         = DefaultProjectionIndex;
            m_ProjectionComboBox.SelectedIndexChanged += OnProjectionComboSelectedIndexChanged;

            NPairBox pairBox = NPairBox.Create("Projection:", m_ProjectionComboBox);

            stack.Add(pairBox);

            // Create the label arcs check box
            NCheckBox labelArcsCheckBox = new NCheckBox();

            labelArcsCheckBox.CheckedChanged     += OnLabelArcsCheckBoxCheckedChanged;
            labelArcsCheckBox.HorizontalPlacement = ENHorizontalPlacement.Left;
            labelArcsCheckBox.Padding             = NMargins.Zero;

            pairBox = NPairBox.Create("Label arcs:", labelArcsCheckBox);
            stack.Add(pairBox);

            // Create the center parallel numeric up down
            m_CenterParalelNumericUpDown               = new NNumericUpDown();
            m_CenterParalelNumericUpDown.Minimum       = -90;
            m_CenterParalelNumericUpDown.Maximum       = 90;
            m_CenterParalelNumericUpDown.Step          = 15;
            m_CenterParalelNumericUpDown.ValueChanged += OnCenterParallelNumericUpDownValueChanged;
            stack.Add(NPairBox.Create("Central parallel:", m_CenterParalelNumericUpDown));

            // Create the center meridian numeric up down
            m_CenterMeridianNumericUpDown               = new NNumericUpDown();
            m_CenterMeridianNumericUpDown.Minimum       = -180;
            m_CenterMeridianNumericUpDown.Maximum       = 180;
            m_CenterMeridianNumericUpDown.Step          = 15;
            m_CenterMeridianNumericUpDown.ValueChanged += OnCenterMeridianNumericUpDownValueChanged;
            stack.Add(NPairBox.Create("Central meridian:", m_CenterMeridianNumericUpDown));

            // Add the settings group box to the parent stack
            NStackPanel parentStack      = (NStackPanel)base.CreateExampleControls();
            NGroupBox   settingsGroupBox = new NGroupBox("Settings", new NUniSizeBoxGroup(stack));

            parentStack.Add(settingsGroupBox);

            return(parentStack);
        }
예제 #26
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack    = new NStackPanel();
            NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack);

            stack.Add(new NLabel("X Axis Title"));
            NTextBox xAxisTitleTextBox = new NTextBox();

            xAxisTitleTextBox.TextChanged += new Function <NValueChangeEventArgs>(OnXAxisTitleTextBoxTextChanged);
            stack.Add(NPairBox.Create("Text:", xAxisTitleTextBox));
            xAxisTitleTextBox.Text = "X Axis Title";

            NNumericUpDown xOffsetUpDown = new NNumericUpDown();

            xOffsetUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnXOffsetUpDownValueChanged);
            stack.Add(NPairBox.Create("Offset:", xOffsetUpDown));
            xOffsetUpDown.Value = 10;

            NComboBox xAlignmentCombo = new NComboBox();

            xAlignmentCombo.FillFromEnum <ENHorizontalAlignment>();
            xAlignmentCombo.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnXAlignmentComboSelectedIndexChanged);
            stack.Add(NPairBox.Create("Offset:", xAlignmentCombo));
            xAlignmentCombo.SelectedIndex = (int)ENHorizontalAlignment.Center;

            stack.Add(new NLabel("Y Axis Title"));

            NTextBox yAxisTitleTextBox = new NTextBox();

            yAxisTitleTextBox.TextChanged += new Function <NValueChangeEventArgs>(OnYAxisTitleTextBoxTextChanged);
            stack.Add(NPairBox.Create("Text:", yAxisTitleTextBox));
            yAxisTitleTextBox.Text = "Y Axis Title";

            NNumericUpDown yOffsetUpDown = new NNumericUpDown();

            yOffsetUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnYOffsetUpDownValueChanged);
            stack.Add(NPairBox.Create("Offset:", yOffsetUpDown));
            yOffsetUpDown.Value = 10;

            NComboBox yAlignmentCombo = new NComboBox();

            yAlignmentCombo.FillFromEnum <ENHorizontalAlignment>();
            yAlignmentCombo.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnYAlignmentComboSelectedIndexChanged);
            stack.Add(NPairBox.Create("Offset:", yAlignmentCombo));
            yAlignmentCombo.SelectedIndex = (int)ENHorizontalAlignment.Center;

            return(boxGroup);
        }
예제 #27
0
        protected override NWidget CreateExampleContent()
        {
            NStackPanel stack = new NStackPanel();

            m_NumericUpDown = new NNumericUpDown();
            m_NumericUpDown.HorizontalPlacement = ENHorizontalPlacement.Left;
            m_NumericUpDown.Minimum             = 0;
            m_NumericUpDown.Maximum             = 100;
            m_NumericUpDown.Value         = 50;
            m_NumericUpDown.Step          = 1;
            m_NumericUpDown.DecimalPlaces = 2;
            m_NumericUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnValueChanged);

            stack.Add(m_NumericUpDown);
            return(stack);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack = new NStackPanel();
            NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack);

            // begin angle
            NNumericUpDown beginAngleUpDown = new NNumericUpDown();

            beginAngleUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnBeginAngleUpDownValueChanged);
            stack.Add(NPairBox.Create("Begin Angle:", beginAngleUpDown));

            // red axis controls
            stack.Add(new NLabel("Degree Axis (Red):"));

            NCheckBox dockRedAxisCheckBox = new NCheckBox("Dock");

            stack.Add(dockRedAxisCheckBox);

            m_RedAxisCrossValueUpDown = new NNumericUpDown();
            stack.Add(NPairBox.Create("Cross Value:", m_RedAxisCrossValueUpDown));

            // green axis controls
            stack.Add(new NLabel("Grad Axis (Green):"));

            NCheckBox dockGreenAxisCheckBox = new NCheckBox("Dock");

            stack.Add(dockGreenAxisCheckBox);

            m_GreenAxisCrossValueUpDown = new NNumericUpDown();
            stack.Add(NPairBox.Create("Cross Value:", m_GreenAxisCrossValueUpDown));

            // wire events
            dockRedAxisCheckBox.CheckedChanged       += OnDockRedAxisCheckBoxCheckedChanged;
            m_RedAxisCrossValueUpDown.ValueChanged   += OnRedAxisCrossValueUpDownValueChanged;
            dockGreenAxisCheckBox.CheckedChanged     += OnDockGreenAxisCheckBoxCheckedChanged;
            m_GreenAxisCrossValueUpDown.ValueChanged += OnGreenAxisCrossValueUpDownValueChanged;

            // init values
            m_RedAxisCrossValueUpDown.Value = 50;
            dockRedAxisCheckBox.Checked     = true;

            dockGreenAxisCheckBox.Checked     = false;
            m_GreenAxisCrossValueUpDown.Value = 70;

            return(group);
        }
예제 #29
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack    = new NStackPanel();
            NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack);

            stack.Add(new NLabel("Y Axis Grid"));

            NNumericUpDown beginUpDown = new NNumericUpDown();

            beginUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnBeginUpDownValueChanged);
            stack.Add(NPairBox.Create("Begin:", beginUpDown));
            beginUpDown.Value = 0;

            NNumericUpDown endUpDown = new NNumericUpDown();

            endUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnEndUpDownValueChanged);
            stack.Add(NPairBox.Create("End:", endUpDown));
            endUpDown.Value = 0;

            NCheckBox infiniteCheckBox = new NCheckBox("Infinite");

            infiniteCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnInfiniteCheckBoxCheckedChanged);
            stack.Add(infiniteCheckBox);
            infiniteCheckBox.Checked = true;

            NNumericUpDown lengthUpDown = new NNumericUpDown();

            lengthUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnLengthUpDownValueChanged);
            stack.Add(NPairBox.Create("Length:", lengthUpDown));
            lengthUpDown.Value = 1;

            NNumericUpDown intervalUpDown = new NNumericUpDown();

            intervalUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnIntervalUpDownValueChanged);
            stack.Add(NPairBox.Create("Interval:", intervalUpDown));
            intervalUpDown.Value = 1;

            NColorBox colorBox = new NColorBox();

            colorBox.SelectedColorChanged += new Function <NValueChangeEventArgs>(OnColorBoxSelectedColorChanged);
            stack.Add(NPairBox.Create("Color:", colorBox));
            colorBox.SelectedColor = NColor.DarkGray;

            return(boxGroup);
        }
예제 #30
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack    = new NStackPanel();
            NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack);

            NNumericUpDown yAxisDecimalPlaces = new NNumericUpDown();

            yAxisDecimalPlaces.Minimum       = 0;
            yAxisDecimalPlaces.ValueChanged += OnYAxisDecimalPlacesValueChanged;
            stack.Add(NPairBox.Create("Y Axis Decimal Places:", yAxisDecimalPlaces));

            NCheckBox useCustomXAxisLabels = new NCheckBox("Use Custom X Axis Labels");

            useCustomXAxisLabels.CheckedChanged += OnUseCustomXAxisLabelsCheckedChanged;
            stack.Add(useCustomXAxisLabels);

            return(boxGroup);
        }