/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); m_FirstRowGridStyleComboBox = new NComboBox(); m_FirstRowGridStyleComboBox.FillFromEnum <ENFirstRowGridStyle>(); m_FirstRowGridStyleComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnUpdateScale); stack.Add(NPairBox.Create("Grid Style:", m_FirstRowGridStyleComboBox)); m_FirstRowTickModeComboBox = new NComboBox(); m_FirstRowTickModeComboBox.FillFromEnum <ENRangeLabelTickMode>(); m_FirstRowTickModeComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnUpdateScale); stack.Add(NPairBox.Create("Tick Mode:", m_FirstRowTickModeComboBox)); m_GroupRowGridStyleComboBox = new NComboBox(); m_GroupRowGridStyleComboBox.FillFromEnum <ENGroupRowGridStyle>(); m_GroupRowGridStyleComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnUpdateScale); stack.Add(NPairBox.Create("Grid Style:", m_GroupRowGridStyleComboBox)); m_GroupRowTickModeComboBox = new NComboBox(); m_GroupRowTickModeComboBox.FillFromEnum <ENRangeLabelTickMode>(); m_GroupRowTickModeComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnUpdateScale); stack.Add(NPairBox.Create("Tick Mode:", m_GroupRowTickModeComboBox)); m_CreateSeparatorForEachLevelCheckBox = new NCheckBox("Create Separator For Each Level"); m_CreateSeparatorForEachLevelCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnUpdateScale); stack.Add(m_CreateSeparatorForEachLevelCheckBox); NButton changeDataButton = new NButton("Change Data"); changeDataButton.Click += new Function <NEventArgs>(OnChangeDataButtonClick); stack.Add(changeDataButton); m_FirstRowGridStyleComboBox.SelectedIndex = (int)ENFirstRowGridStyle.Individual; m_FirstRowTickModeComboBox.SelectedIndex = (int)ENRangeLabelTickMode.Separators; m_GroupRowGridStyleComboBox.SelectedIndex = (int)ENGroupRowGridStyle.Individual; m_GroupRowTickModeComboBox.SelectedIndex = (int)ENRangeLabelTickMode.Separators; m_CreateSeparatorForEachLevelCheckBox.Checked = true; OnChangeDataButtonClick(null); OnUpdateScale(null); return(boxGroup); }
private NGroupBox CreatePropertiesGroupBox() { NStackPanel propertiesStack = new NStackPanel(); NList <NPropertyEditor> editors = NDesigner.GetDesigner(m_TreeView).CreatePropertyEditors(m_TreeView, NTreeView.EnabledProperty, NTreeView.HorizontalPlacementProperty, NTreeView.VerticalPlacementProperty, NTreeView.NoScrollHAlignProperty, NTreeView.NoScrollVAlignProperty, NTreeView.HScrollModeProperty, NTreeView.VScrollModeProperty, NTreeView.IntegralVScrollProperty ); for (int i = 0, count = editors.Count; i < count; i++) { propertiesStack.Add(editors[i]); } NGroupBox propertiesGroupBox = new NGroupBox("Properties", new NUniSizeBoxGroup(propertiesStack)); return(propertiesGroupBox); }
private NGroupBox CreatePropertiesGroupBox() { NStackPanel propertiesStack = new NStackPanel(); NList <NPropertyEditor> editors = NDesigner.GetDesigner(m_NavigationBar).CreatePropertyEditors(m_NavigationBar, NNavigationBar.EnabledProperty, NNavigationBar.HorizontalPlacementProperty, NNavigationBar.VerticalPlacementProperty, NNavigationBar.VisibleHeadersCountProperty, NNavigationBar.HeadersPaddingProperty, NNavigationBar.HeadersSpacingProperty, NNavigationBar.IconsPaddingProperty, NNavigationBar.IconsSpacingProperty ); for (int i = 0, count = editors.Count; i < count; i++) { propertiesStack.Add(editors[i]); } NGroupBox propertiesGroupBox = new NGroupBox("Properties", new NUniSizeBoxGroup(propertiesStack)); return(propertiesGroupBox); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); // Create the property editors NList <NPropertyEditor> editors = NDesigner.GetDesigner(m_Barcode).CreatePropertyEditors( m_Barcode, NMatrixBarcode.HorizontalPlacementProperty, NMatrixBarcode.VerticalPlacementProperty, NMatrixBarcode.BackgroundFillProperty, NMatrixBarcode.TextFillProperty, NMatrixBarcode.ErrorCorrectionProperty, NMatrixBarcode.SizeModeProperty, NMatrixBarcode.ScaleProperty, NMatrixBarcode.TextProperty ); for (int i = 0, count = editors.Count; i < count; i++) { stack.Add(editors[i]); } return(new NUniSizeBoxGroup(stack)); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack); NCheckBox showVerticalDropLinesCheckBox = new NCheckBox("Show Vertical Drop Lines"); showVerticalDropLinesCheckBox.CheckedChanged += OnShowVerticalDropLinesCheckBoxCheckedChanged; stack.Add(showVerticalDropLinesCheckBox); NComboBox verticalDropLinesOriginModeCombo = new NComboBox(); verticalDropLinesOriginModeCombo.FillFromEnum <ENDropLineOriginMode>(); verticalDropLinesOriginModeCombo.SelectedIndexChanged += OnVerticalDropLinesOriginModeComboSelectedIndexChanged; verticalDropLinesOriginModeCombo.SelectedIndex = (int)ENDropLineOriginMode.CustomValue; stack.Add(NPairBox.Create("Origin Mode:", verticalDropLinesOriginModeCombo)); NNumericUpDown verticalDropLinesOriginUpDown = new NNumericUpDown(); verticalDropLinesOriginUpDown.ValueChanged += OnVerticalDropLinesOriginUpDownValueChanged; verticalDropLinesOriginUpDown.Value = 180.0; stack.Add(NPairBox.Create("Origin", verticalDropLinesOriginUpDown)); NCheckBox showHorizontalDropLinesCheckBox = new NCheckBox("Show Horizontal Drop Lines"); showHorizontalDropLinesCheckBox.CheckedChanged += OnShowHorizontalDropLinesCheckBoxCheckedChanged; showHorizontalDropLinesCheckBox.Checked = true; stack.Add(showHorizontalDropLinesCheckBox); NComboBox horizontalDropLinesOriginModeCombo = new NComboBox(); horizontalDropLinesOriginModeCombo.FillFromEnum <ENDropLineOriginMode>(); horizontalDropLinesOriginModeCombo.SelectedIndexChanged += OnHorizontalDropLinesOriginModeComboSelectedIndexChanged; horizontalDropLinesOriginModeCombo.SelectedIndex = (int)ENDropLineOriginMode.CustomValue; stack.Add(NPairBox.Create("Origin Mode:", horizontalDropLinesOriginModeCombo)); NNumericUpDown horizontalDropLinesOriginUpDown = new NNumericUpDown(); horizontalDropLinesOriginUpDown.ValueChanged += OnHorizontalDropLinesOriginUpDownValueChanged; stack.Add(NPairBox.Create("Origin:", horizontalDropLinesOriginUpDown)); return(group); }
protected override NWidget CreateExampleControls() { m_WrapModeCombo = new NComboBox(); m_WrapModeCombo.FillFromEnum <ENTextWrapMode>(); m_WrapModeCombo.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnWrapModeComboSelectedIndexChanged); m_HorizontalAlignmentCombo = new NComboBox(); m_HorizontalAlignmentCombo.FillFromEnum <ENTextHorzAlign>(); m_HorizontalAlignmentCombo.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnHorizontalAlignmentComboSelectedIndexChanged); m_VerticalAlignmentCombo = new NComboBox(); m_VerticalAlignmentCombo.FillFromEnum <ENTextVertAlign>(); m_VerticalAlignmentCombo.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnVerticalAlignmentComboSelectedIndexChanged); m_SingleLineCheckBox = new NCheckBox("Single Line"); m_SingleLineCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnSingleLineCheckBoxCheckedChanged); m_WidthPercentUpDown = new NNumericUpDown(); m_WidthPercentUpDown.Value = 50; m_WidthPercentUpDown.Minimum = 0; m_WidthPercentUpDown.Maximum = 100.0; m_WidthPercentUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnWidthPercentValueChanged); m_HeightPercentUpDown = new NNumericUpDown(); m_HeightPercentUpDown.Value = 50; m_HeightPercentUpDown.Minimum = 0; m_HeightPercentUpDown.Maximum = 100.0; m_HeightPercentUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnHeightPercentValueChanged); NStackPanel stack = new NStackPanel(); stack.FillMode = ENStackFillMode.None; stack.FitMode = ENStackFitMode.None; stack.Add(NPairBox.Create("Wrap Mode", m_WrapModeCombo)); stack.Add(NPairBox.Create("Horizontal Alignment", m_HorizontalAlignmentCombo)); stack.Add(NPairBox.Create("Vertical Alignment", m_VerticalAlignmentCombo)); stack.Add(m_SingleLineCheckBox); stack.Add(NPairBox.Create("Width Percent:", m_WidthPercentUpDown)); stack.Add(NPairBox.Create("Height Percent:", m_HeightPercentUpDown)); return(new NUniSizeBoxGroup(stack)); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack); NComboBox bubbleShapeComboBox = new NComboBox(); bubbleShapeComboBox.FillFromEnum <ENPointShape>(); bubbleShapeComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnBubbleShapeComboBoxSelectedIndexChanged); stack.Add(NPairBox.Create("Bubble Shape: ", bubbleShapeComboBox)); bubbleShapeComboBox.SelectedIndex = (int)ENPointShape.Ellipse; NNumericUpDown minBubbleSizeUpDown = new NNumericUpDown(); minBubbleSizeUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnMinBubbleSizeUpDownValueChanged); stack.Add(NPairBox.Create("Min Bubble Size:", minBubbleSizeUpDown)); minBubbleSizeUpDown.Value = 50; NNumericUpDown maxBubbleSizeUpDown = new NNumericUpDown(); maxBubbleSizeUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnMaxBubbleSizeUpDownValueChanged); stack.Add(NPairBox.Create("Max Bubble Size:", maxBubbleSizeUpDown)); maxBubbleSizeUpDown.Value = 200; NCheckBox inflateMarginsCheckBox = new NCheckBox(); inflateMarginsCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnInflateMarginsCheckBoxCheckedChanged); stack.Add(NPairBox.Create("Inflate Margins: ", inflateMarginsCheckBox)); inflateMarginsCheckBox.Checked = true; NButton changeYValuesButton = new NButton("Change Y Values"); changeYValuesButton.Click += new Function <NEventArgs>(OnChangeYValuesButtonClick); stack.Add(changeYValuesButton); NButton changeXValuesButton = new NButton("Change X Values"); changeXValuesButton.Click += new Function <NEventArgs>(OnChangeXValuesButtonClick); stack.Add(changeXValuesButton); return(group); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); m_MajorTickModeComboBox = new NComboBox(); m_MajorTickModeComboBox.FillFromEnum <ENMajorTickMode>(); m_MajorTickModeComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnMajorTickModeComboBoxSelectedIndexChanged); stack.Add(NPairBox.Create("Major Tick Mode:", m_MajorTickModeComboBox)); m_MinDistanceUpDown = new NNumericUpDown(); m_MinDistanceUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnMinDistanceUpDownValueChanged); stack.Add(NPairBox.Create("Min Distance:", m_MinDistanceUpDown)); m_MinDistanceUpDown.Value = 25; m_MaxCountNumericUpDown = new NNumericUpDown(); m_MaxCountNumericUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnMaxCountNumericUpDownValueChanged); stack.Add(NPairBox.Create("Max Count:", m_MaxCountNumericUpDown)); m_MaxCountNumericUpDown.Value = 10; m_CustomStepUpDown = new NNumericUpDown(); m_CustomStepUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnCustomStepUpDownValueChanged); stack.Add(NPairBox.Create("Custom Step:", m_CustomStepUpDown)); m_CustomStepUpDown.Value = 1; NCheckBox invertedCheckBox = new NCheckBox("Inverted"); invertedCheckBox.CheckedChanged += OnInvertedCheckBoxCheckedChanged; invertedCheckBox.Checked = false; stack.Add(invertedCheckBox); NButton generateRandomDataButton = new NButton("Generate Random Data"); generateRandomDataButton.Click += new Function <NEventArgs>(OnGenerateRandomDataButtonClick); stack.Add(generateRandomDataButton); m_MajorTickModeComboBox.SelectedIndex = (int)ENMajorTickMode.AutoMinDistance; OnMajorTickModeComboBoxSelectedIndexChanged(null); return(boxGroup); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); NTextBox legendHeaderTextBox = new NTextBox(); legendHeaderTextBox.TextChanged += OnLegendHeaderTextBoxChanged; stack.Add(NPairBox.Create("Header: ", legendHeaderTextBox)); NTextBox legendFooterTextBox = new NTextBox(); legendFooterTextBox.TextChanged += OnLegendFooterTextBoxChanged; stack.Add(NPairBox.Create("Footer: ", legendFooterTextBox)); m_HorizontalInterlaceStripesCheckBox = new NCheckBox("Horizontal Interlace Stripes"); m_HorizontalInterlaceStripesCheckBox.CheckedChanged += OnVerticalInterlaceStripesCheckBoxCheckedChanged; stack.Add(m_HorizontalInterlaceStripesCheckBox); m_VerticalInterlaceStripesCheckBox = new NCheckBox("Vertical Interlace Stripes"); m_VerticalInterlaceStripesCheckBox.CheckedChanged += OnHorizontalInterlaceStripesCheckBoxCheckedChanged; stack.Add(m_VerticalInterlaceStripesCheckBox); NCheckBox showHorizontalGridLinesCheckBox = new NCheckBox("Show Horizontal Gridlines"); showHorizontalGridLinesCheckBox.Checked = true; showHorizontalGridLinesCheckBox.CheckedChanged += OnShowHorizontalGridLinesCheckBoxCheckedChanged; stack.Add(showHorizontalGridLinesCheckBox); NCheckBox showVerticalGridLinesCheckBox = new NCheckBox("Show Vertical Gridlines"); showVerticalGridLinesCheckBox.Checked = true; showVerticalGridLinesCheckBox.CheckedChanged += OnShowVerticalGridLinesCheckBoxCheckedChanged; stack.Add(showVerticalGridLinesCheckBox); return(boxGroup); }
protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); stack.HorizontalPlacement = ENHorizontalPlacement.Left; NButton messageBoxLikeButton = new NButton("Message Box Like"); messageBoxLikeButton.Click += OnMessageBoxLikeButtonClick; stack.Add(messageBoxLikeButton); NButton customButtonsButton = new NButton("Custom Buttons"); customButtonsButton.Click += OnCustomButtonsButtonClick; stack.Add(customButtonsButton); NButton advancedCustomButtonsButton = new NButton("Advanced Custom Buttons"); advancedCustomButtonsButton.Click += OnAdvancedCustomButtonsButtonClick; stack.Add(advancedCustomButtonsButton); NButton radioButtonsButton = new NButton("Radio Buttons"); radioButtonsButton.Click += OnRadioButtonsButtonClick; stack.Add(radioButtonsButton); NButton verificationButton = new NButton("Verification Check Box"); verificationButton.Click += OnVerificationButtonClick; stack.Add(verificationButton); NButton allFeaturesButton = new NButton("All Features"); allFeaturesButton.Click += OnAllFeaturesButtonClick; stack.Add(allFeaturesButton); return(stack); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); stack.Add(new NLabel("Y Axis Grid")); NColorBox yAxisGridColor = new NColorBox(); yAxisGridColor.SelectedColorChanged += new Function <NValueChangeEventArgs>(OnYAxisGridColorSelectedColorChanged); stack.Add(NPairBox.Create("Color", yAxisGridColor)); yAxisGridColor.SelectedColor = NColor.Black; NComboBox yAxisGridStyle = new NComboBox(); yAxisGridStyle.FillFromEnum <ENDashStyle>(); yAxisGridStyle.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnYAxisGridStyleSelectedIndexChanged); stack.Add(NPairBox.Create("Style:", yAxisGridStyle)); yAxisGridStyle.SelectedIndex = (int)ENDashStyle.Solid; stack.Add(new NLabel("X Axis Grid")); NColorBox xAxisGridColor = new NColorBox(); xAxisGridColor.SelectedColorChanged += new Function <NValueChangeEventArgs>(OnXAxisGridColorSelectedColorChanged); stack.Add(NPairBox.Create("Color", xAxisGridColor)); xAxisGridColor.SelectedColor = NColor.Black; NComboBox xAxisGridStyle = new NComboBox(); xAxisGridStyle.FillFromEnum <ENDashStyle>(); xAxisGridStyle.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnXAxisGridStyleSelectedIndexChanged); stack.Add(NPairBox.Create("Style:", xAxisGridStyle)); xAxisGridStyle.SelectedIndex = (int)ENDashStyle.Solid; return(boxGroup); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); NStackPanel controlStack = new NStackPanel(); controlStack.Padding = new NMargins(20); stack.Add(controlStack); m_LinearGauge = new NLinearGauge(); m_LinearGauge.Padding = new NMargins(30); m_LinearGauge.PreferredSize = defaultLinearHorizontalGaugeSize; controlStack.Add(m_LinearGauge); NGaugeAxis axis = new NGaugeAxis(); m_LinearGauge.Axes.Add(axis); axis.Anchor = new NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, true, ENScaleOrientation.Left, 0, 100); axis = new NGaugeAxis(); m_LinearGauge.Axes.Add(axis); axis.Anchor = new NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, true, ENScaleOrientation.Left, 0, 50); // create the radial gauge m_RadialGauge = new NRadialGauge(); m_RadialGauge.PreferredSize = defaultRadialGaugeSize; m_RadialGauge.NeedleCap.Visible = false; controlStack.Add(m_RadialGauge); // create the radial gauge m_RadialGauge.SweepAngle = new NAngle(270, NUnit.Degree); m_RadialGauge.BeginAngle = new NAngle(-90, NUnit.Degree); m_RadialGauge.PreferredHeight = 400; // configure the axis axis = new NGaugeAxis(); m_RadialGauge.Axes.Add(axis); axis.Range = new NRange(0, 100); axis.Anchor = new NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, true, ENScaleOrientation.Left, 0.0f, 100.0f); // configure the axis axis = new NGaugeAxis(); m_RadialGauge.Axes.Add(axis); axis.Range = new NRange(0, 100); axis.Anchor = new NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, true, ENScaleOrientation.Left, 0.0f, 50.0f); NNeedleValueIndicator indicator = new NNeedleValueIndicator(); indicator.ScaleAxis = axis; indicator.OffsetFromScale = 20; m_RadialGauge.Indicators.Add(indicator); NMarkerValueIndicator markerValueIndicator = new NMarkerValueIndicator(10); markerValueIndicator.Shape = ENScaleValueMarkerShape.Bar; m_RadialGauge.Indicators.Add(new NMarkerValueIndicator(10)); m_RadialGauge.Indicators.Add(new NMarkerValueIndicator(90)); NNeedleValueIndicator needle = new NNeedleValueIndicator(); needle.Value = 10; needle.Shape = ENNeedleShape.Needle4; needle.Fill = new NColorFill(NColor.DarkGreen); needle.Stroke = new NStroke(NColor.DarkGreen); // radialGauge.Indicators.Add(needle); markerValueIndicator.Width = 20; markerValueIndicator.Height = 20; markerValueIndicator.Fill = new NColorFill(NColor.DarkGreen); markerValueIndicator.Stroke = new NStroke(1.0, NColor.DarkGreen); return(stack); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); stack.Add(new NLabel("Y Axis Stripe")); NNumericUpDown yStripeBeginValueUpDown = new NNumericUpDown(); yStripeBeginValueUpDown.ValueChanged += OnYStripeBeginValueUpDownValueChanged; yStripeBeginValueUpDown.Value = m_YStripe.Range.Begin; stack.Add(NPairBox.Create("Begin Value:", yStripeBeginValueUpDown)); NNumericUpDown yStripeEndValueUpDown = new NNumericUpDown(); yStripeEndValueUpDown.ValueChanged += OnYStripeEndValueUpDownValueChanged; yStripeEndValueUpDown.Value = m_YStripe.Range.End; stack.Add(NPairBox.Create("End Value:", yStripeEndValueUpDown)); NCheckBox yStripeIncludeInAxisRangeCheckBox = new NCheckBox("Include in Axis Range"); yStripeIncludeInAxisRangeCheckBox.Checked = false; yStripeIncludeInAxisRangeCheckBox.CheckedChanged += OnStripeIncludeInAxisRangeCheckBoxCheckedChanged; stack.Add(yStripeIncludeInAxisRangeCheckBox); NCheckBox yStripePaintAfterSeriesCheckBox = new NCheckBox("Paint After Series"); yStripePaintAfterSeriesCheckBox.Checked = m_YStripe.PaintAfterChartContent; yStripePaintAfterSeriesCheckBox.CheckedChanged += OnYStripePaintAfterSeriesCheckBoxCheckedChanged; stack.Add(yStripePaintAfterSeriesCheckBox); NComboBox yTextAlignmentComboBox = new NComboBox(); yTextAlignmentComboBox.FillFromEnum <ENContentAlignment>(); yTextAlignmentComboBox.SelectedIndex = (int)m_YStripe.TextAlignment; yTextAlignmentComboBox.SelectedIndexChanged += OnYTextAlignmentComboBoxSelectedIndexChanged; stack.Add(NPairBox.Create("Text Alignment:", yTextAlignmentComboBox)); stack.Add(new NLabel("X Axis Stripe")); NNumericUpDown xStripeBeginValueUpDown = new NNumericUpDown(); xStripeBeginValueUpDown.Value = m_XStripe.Range.Begin; xStripeBeginValueUpDown.ValueChanged += OnXStripeBeginValueUpDownValueChanged; stack.Add(NPairBox.Create("Begin Value:", xStripeBeginValueUpDown)); NNumericUpDown xStripeEndValueUpDown = new NNumericUpDown(); xStripeEndValueUpDown.Value = m_XStripe.Range.End; xStripeEndValueUpDown.ValueChanged += OnXStripeEndValueUpDownValueChanged; stack.Add(NPairBox.Create("End Value:", xStripeEndValueUpDown)); NCheckBox xStripeIncludeInAxisRangeCheckBox = new NCheckBox("Include in Axis Range"); xStripeIncludeInAxisRangeCheckBox.Checked = false; xStripeIncludeInAxisRangeCheckBox.CheckedChanged += OnXStripeIncludeInAxisRangeCheckBoxCheckedChanged; stack.Add(xStripeIncludeInAxisRangeCheckBox); NCheckBox xStripePaintAfterSeriesCheckBox = new NCheckBox("Paint After Series"); xStripePaintAfterSeriesCheckBox.Checked = m_XStripe.PaintAfterChartContent; xStripePaintAfterSeriesCheckBox.CheckedChanged += OnXStripePaintAfterSeriesCheckBoxCheckedChanged; stack.Add(xStripePaintAfterSeriesCheckBox); NComboBox xTextAlignmentComboBox = new NComboBox(); xTextAlignmentComboBox.FillFromEnum <ENContentAlignment>(); xTextAlignmentComboBox.SelectedIndex = (int)m_XStripe.TextAlignment; xTextAlignmentComboBox.SelectedIndexChanged += OnXTextAlignmentComboBoxSelectedIndexChanged; stack.Add(NPairBox.Create("Text Alignment:", xTextAlignmentComboBox)); return(boxGroup); }
protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); NStackPanel controlStack = new NStackPanel(); stack.Add(controlStack); // create the radial gauge NRadialGauge radialGauge = new NRadialGauge(); controlStack.Add(radialGauge); radialGauge.Dial = new NDial(ENDialShape.Circle, new NEdgeDialRim()); radialGauge.PreferredSize = defaultRadialGaugeSize; radialGauge.Dial.BackgroundFill = new NStockGradientFill(NColor.DarkGray, NColor.Black); radialGauge.CapEffect = new NGlassCapEffect(); // configure the axis NGaugeAxis axis = new NGaugeAxis(); radialGauge.Axes.Add(axis); NStandardScale scale = (NStandardScale)axis.Scale; scale.SetPredefinedScale(ENPredefinedScaleStyle.Scientific); scale.Labels.Style.TextStyle.Fill = new NColorFill(NColor.White); scale.Labels.Style.TextStyle.Font = new NFont("Tinos", 10, ENFontStyle.Italic | ENFontStyle.Bold); scale.OuterMajorTicks.Stroke.Color = NColor.White; scale.OuterMajorTicks.Length = 6; scale.OuterMinorTicks.Stroke.Color = NColor.White; scale.OuterMinorTicks.Length = 4; scale.Ruler.Stroke.Color = NColor.White; scale.MinorTickCount = 4; // add some indicators m_RangeIndicator = new NRangeIndicator(); m_RangeIndicator.Value = 50; m_RangeIndicator.Palette = new NTwoColorPalette(NColor.DarkBlue, NColor.LightBlue); m_RangeIndicator.Stroke = null; m_RangeIndicator.EndWidth = 20; m_RangeIndicator.AllowDragging = true; radialGauge.Indicators.Add(m_RangeIndicator); m_NeedleIndicator = new NNeedleValueIndicator(); m_NeedleIndicator.Value = 79; m_NeedleIndicator.AllowDragging = true; radialGauge.Indicators.Add(m_NeedleIndicator); radialGauge.SweepAngle = new NAngle(270, NUnit.Degree); m_MarkerIndicator = new NMarkerValueIndicator(); m_MarkerIndicator.Value = 90; m_MarkerIndicator.AllowDragging = true; m_MarkerIndicator.OffsetOriginMode = ENIndicatorOffsetOriginMode.ScaleEnd; m_MarkerIndicator.OffsetFromScale = 0.0; radialGauge.Indicators.Add(m_MarkerIndicator); return(stack); }
protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); stack.HorizontalPlacement = Layout.ENHorizontalPlacement.Left; NStackPanel controlStack = new NStackPanel(); stack.Add(controlStack); // create the radial gauge m_RadialGauge = new NRadialGauge(); m_RadialGauge.SweepAngle = new NAngle(270, NUnit.Degree); m_RadialGauge.BeginAngle = new NAngle(-225, NUnit.Degree); m_RadialGauge.PreferredSize = defaultRadialGaugeSize; m_RadialGauge.CapEffect = new NGlassCapEffect(); m_RadialGauge.Dial = new NDial(ENDialShape.CutCircle, new NEdgeDialRim()); m_RadialGauge.Dial.BackgroundFill = new NStockGradientFill(NColor.DarkGray, NColor.Black); // configure scale NGaugeAxis axis = new NGaugeAxis(); m_RadialGauge.Axes.Add(axis); NLinearScale scale = (NLinearScale)axis.Scale; scale.SetPredefinedScale(ENPredefinedScaleStyle.Presentation); scale.Labels.Style.TextStyle.Font = new NFont("Arimo", 10, ENFontStyle.Bold); scale.Labels.Style.TextStyle.Fill = new NColorFill(NColor.White); scale.Labels.Style.Angle = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 90.0); scale.MinorTickCount = 4; scale.Ruler.Stroke.Width = 0; scale.Ruler.Fill = new NColorFill(NColor.DarkGray); // add radial gauge indicators m_ValueIndicator = new NNeedleValueIndicator(); m_ValueIndicator.Fill = new NStockGradientFill(ENGradientStyle.Horizontal, ENGradientVariant.Variant1, NColor.White, NColor.Red); m_ValueIndicator.Stroke.Color = NColor.Red; m_ValueIndicator.Width = 15; m_ValueIndicator.OffsetFromScale = -10; m_RadialGauge.Indicators.Add(m_ValueIndicator); NStackPanel verticalStack = new NStackPanel(); verticalStack.Direction = Layout.ENHVDirection.TopToBottom; verticalStack.Padding = new NMargins(80, 200, 80, 0); m_NumericLedDisplay = new NNumericLedDisplay(); m_NumericLedDisplay.Value = 0.0; m_NumericLedDisplay.CellCountMode = ENDisplayCellCountMode.Fixed; m_NumericLedDisplay.CellCount = 7; m_NumericLedDisplay.BackgroundFill = new NColorFill(NColor.Black); m_NumericLedDisplay.Border = NBorder.CreateSunken3DBorder(new NUIThemeColorMap(ENUIThemeScheme.WindowsClassic)); m_NumericLedDisplay.BorderThickness = new NMargins(6); m_NumericLedDisplay.Margins = new NMargins(5); m_NumericLedDisplay.Padding = new NMargins(5); NGelCapEffect gelCap = new NGelCapEffect(); gelCap.Shape = ENCapEffectShape.RoundedRect; m_NumericLedDisplay.CapEffect = gelCap; m_NumericLedDisplay.PreferredHeight = 60; verticalStack.Add(m_NumericLedDisplay); m_RadialGauge.Content = verticalStack; // add radial gauge controlStack.Add(m_RadialGauge); m_DataFeedTimer = new NTimer(); m_DataFeedTimer.Tick += new Function(OnDataFeedTimerTick); m_DataFeedTimer.Start(); return(stack); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); // default gridlines { NStackPanel pstack = new NStackPanel(); pstack.VerticalSpacing = 2; NList <NPropertyEditor> editors = NDesigner.GetDesigner(m_GridView.Grid).CreatePropertyEditors( m_GridView.Grid, NGrid.HorizontalGridlinesStrokeProperty, NGrid.VerticalGridlinesStrokeProperty ); for (int i = 0; i < editors.Count; i++) { pstack.Add(editors[i]); } stack.Add(new NGroupBox("Grid Gridlines", new NUniSizeBoxGroup(pstack))); } // column gridlines { NStackPanel pstack = new NStackPanel(); pstack.VerticalSpacing = 2; NList <NPropertyEditor> editors = NDesigner.GetDesigner(NColumnCollection.NColumnCollectionSchema).CreatePropertyEditors( m_GridView.Grid.Columns, NColumnCollection.VisibleProperty, NColumnCollection.TopGridlineStrokeProperty, NColumnCollection.BottomGridlineStrokeProperty, NColumnCollection.VerticalGridlinesStrokeProperty ); for (int i = 0; i < editors.Count; i++) { pstack.Add(editors[i]); } stack.Add(new NGroupBox("Columns Properties", new NUniSizeBoxGroup(pstack))); } // row headers gridlines { NStackPanel pstack = new NStackPanel(); pstack.VerticalSpacing = 2; NList <NPropertyEditor> editors = NDesigner.GetDesigner(NRowHeaderCollection.NRowHeaderCollectionSchema).CreatePropertyEditors( m_GridView.Grid.RowHeaders, NRowHeaderCollection.VisibleProperty, NRowHeaderCollection.LeftGridlineStrokeProperty, NRowHeaderCollection.RightGridlineStrokeProperty, NRowHeaderCollection.HorizontalGridlinesStrokeProperty ); for (int i = 0; i < editors.Count; i++) { pstack.Add(editors[i]); } stack.Add(new NGroupBox("Row Headers Properties", new NUniSizeBoxGroup(pstack))); } return(stack); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); stack.Add(new NLabel("Allowed Date Time Units")); NDateTimeUnit[] dateTimeUnits = new NDateTimeUnit[] { NDateTimeUnit.Century, NDateTimeUnit.Decade, NDateTimeUnit.Year, NDateTimeUnit.HalfYear, NDateTimeUnit.Quarter, NDateTimeUnit.Month, NDateTimeUnit.Week, NDateTimeUnit.Day, NDateTimeUnit.HalfDay, NDateTimeUnit.Hour, NDateTimeUnit.Minute, NDateTimeUnit.Second, NDateTimeUnit.Millisecond, NDateTimeUnit.Tick }; m_DateTimeUnitListBox = new NListBox(); for (int i = 0; i < dateTimeUnits.Length; i++) { NDateTimeUnit dateTimeUnit = dateTimeUnits[i]; NCheckBox dateTimeUnitCheckBox = new NCheckBox(NStringHelpers.InsertSpacesBeforeUppersAndDigits(dateTimeUnit.DateTimeUnit.ToString())); dateTimeUnitCheckBox.Checked = true; dateTimeUnitCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnDateTimeUnitCheckBoxCheckedChanged); dateTimeUnitCheckBox.Tag = dateTimeUnit; m_DateTimeUnitListBox.Items.Add(new NListBoxItem(dateTimeUnitCheckBox)); } stack.Add(m_DateTimeUnitListBox); OnDateTimeUnitCheckBoxCheckedChanged(null); NCheckBox enableUnitSensitiveFormattingCheckBox = new NCheckBox("Enable Unit Sensitive Formatting"); enableUnitSensitiveFormattingCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnEnableUnitSensitiveFormattingCheckBoxCheckedChanged); stack.Add(enableUnitSensitiveFormattingCheckBox); enableUnitSensitiveFormattingCheckBox.Checked = true; stack.Add(new NLabel("Start Date:")); m_StartDateTimeBox = new NDateTimeBox(); m_StartDateTimeBox.SelectedDateChanged += new Function <NValueChangeEventArgs>(OnStartDateTimeBoxSelectedDateChanged); stack.Add(m_StartDateTimeBox); stack.Add(new NLabel("End Date:")); m_EndDateTimeBox = new NDateTimeBox(); m_EndDateTimeBox.SelectedDateChanged += new Function <NValueChangeEventArgs>(OnEndDateTimeBoxSelectedDateChanged); stack.Add(m_EndDateTimeBox); NButton generateRandomDataButton = new NButton("Generate Random Data"); generateRandomDataButton.Click += new Function <NEventArgs>(OnGenerateRandomDataButtonClick); stack.Add(generateRandomDataButton); m_StartDateTimeBox.SelectedDate = DateTime.Now; m_EndDateTimeBox.SelectedDate = CultureInfo.CurrentCulture.Calendar.AddYears(m_StartDateTimeBox.SelectedDate, 2); return(boxGroup); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); // properties stack NList <NPropertyEditor> editors = NDesigner.GetDesigner(m_DockPanel).CreatePropertyEditors( m_DockPanel, NDockPanel.EnabledProperty, NDockPanel.HorizontalPlacementProperty, NDockPanel.VerticalPlacementProperty, NDockPanel.VerticalSpacingProperty, NDockPanel.HorizontalSpacingProperty, NDockPanel.UniformWidthsProperty, NDockPanel.UniformHeightsProperty); NStackPanel propertiesStack = new NStackPanel(); for (int i = 0; i < editors.Count; i++) { propertiesStack.Add(editors[i]); } stack.Add(new NGroupBox("Properties", new NUniSizeBoxGroup(propertiesStack))); // items stack NStackPanel itemsStack = new NStackPanel(); m_DockAreaCombo = new NComboBox(); m_DockAreaCombo.Items.Add(new NComboBoxItem("Left")); m_DockAreaCombo.Items.Add(new NComboBoxItem("Top")); m_DockAreaCombo.Items.Add(new NComboBoxItem("Right")); m_DockAreaCombo.Items.Add(new NComboBoxItem("Bottom")); m_DockAreaCombo.Items.Add(new NComboBoxItem("Center")); m_DockAreaCombo.SelectedIndex = 1; NLabel dockAreaLabel = new NLabel("Dock Area:"); dockAreaLabel.VerticalPlacement = ENVerticalPlacement.Center; itemsStack.Add(new NPairBox(dockAreaLabel, m_DockAreaCombo, true)); NButton addSmallItemButton = new NButton("Add Small Item"); addSmallItemButton.Click += new Function <NEventArgs>(OnAddSmallItemButtonClick); itemsStack.Add(addSmallItemButton); NButton addLargeItemButton = new NButton("Add Large Item"); addLargeItemButton.Click += new Function <NEventArgs>(OnAddLargeItemButtonClick); itemsStack.Add(addLargeItemButton); NButton addRandomItemButton = new NButton("Add Random Item"); addRandomItemButton.Click += new Function <NEventArgs>(OnAddRandomItemButtonClick); itemsStack.Add(addRandomItemButton); NButton removeAllItemsButton = new NButton("Remove All Items"); removeAllItemsButton.Click += new Function <NEventArgs>(OnRemoveAllItemsButtonClick); itemsStack.Add(removeAllItemsButton); stack.Add(new NGroupBox("Items", itemsStack)); return(new NUniSizeBoxGroup(stack)); }
protected override NWidget CreateExampleContent() { // create a view and get its grid m_View = new NTableGridView(); NTableGrid grid = m_View.Grid; // bind the grid to the data source grid.DataSource = NDummyDataSource.CreatePersonsDataSource(); // configure the master grid grid.AllowEdit = false; // assign some icons to the columns for (int i = 0; i < grid.Columns.Count; i++) { NDataColumn dataColumn = grid.Columns[i] as NDataColumn; if (dataColumn == null) { continue; } NImage image = null; switch (dataColumn.FieldName) { case "Name": image = NResources.Image__16x16_Contacts_png; break; case "Gender": image = NResources.Image__16x16_Gender_png; break; case "Birthday": image = NResources.Image__16x16_Birthday_png; break; case "Country": image = NResources.Image__16x16_Globe_png; break; case "Phone": image = NResources.Image__16x16_Phone_png; break; case "Email": image = NResources.Image__16x16_Mail_png; break; default: continue; } // NOTE: The CreateHeaderContentDelegate is invoked whenever the Title changes or the UpdateHeaderContent() is called. // you can use this event to create custom column header content dataColumn.CreateHeaderContentDelegate = delegate(NColumn theColumn) { NPairBox pairBox = new NPairBox(image, theColumn.Title, ENPairBoxRelation.Box1BeforeBox2); pairBox.Spacing = 2; return(pairBox); }; dataColumn.UpdateHeaderContent(); } // create the custom detail that creates a widget displaying information about the row. // NOTE: The widget is created by the OnCustomDetailCreateWidget event handler. NMasterDetails masterDetails = grid.MasterDetails; NCustomDetail customDetail = new NCustomDetail(); masterDetails.Details.Add(customDetail); customDetail.CreateWidgetDelegate = delegate(NCustomDetailCreateWidgetArgs arg) { // get information about the data source row string name = (string)arg.DataSource.GetValue(arg.RowIndex, "Name"); ENGender gender = (ENGender)arg.DataSource.GetValue(arg.RowIndex, "Gender"); DateTime birthday = (DateTime)arg.DataSource.GetValue(arg.RowIndex, "Birthday"); ENCountry country = (ENCountry)arg.DataSource.GetValue(arg.RowIndex, "Country"); string phone = (string)arg.DataSource.GetValue(arg.RowIndex, "Phone"); string email = (string)arg.DataSource.GetValue(arg.RowIndex, "Email"); // display the information as a widget NPairBox namePair = new NPairBox("Name:", name); NPairBox genderPair = new NPairBox("Gender:", gender.ToString()); NPairBox birthdayPair = new NPairBox("Birthday:", birthday.ToString()); NPairBox countryPair = new NPairBox("Country:", country.ToString()); NPairBox phonePair = new NPairBox("Phone:", phone.ToString()); NPairBox emailPair = new NPairBox("Email:", email.ToString()); NImageBox image = new NImageBox(); switch (gender) { case ENGender.Male: image.Image = Nevron.Nov.Examples.NResources.Image__256x256_MaleIcon_jpg; break; case ENGender.Female: image.Image = Nevron.Nov.Examples.NResources.Image__256x256_FemaleIcon_jpg; break; default: break; } NStackPanel infoStack = new NStackPanel(); infoStack.VerticalSpacing = 2.0d; infoStack.Add(namePair); infoStack.Add(genderPair); infoStack.Add(birthdayPair); infoStack.Add(countryPair); infoStack.Add(phonePair); infoStack.Add(emailPair); NDockPanel dock = new NDockPanel(); dock.Add(image, ENDockArea.Left); dock.Add(infoStack, ENDockArea.Center); // assign the widget to the event arguments. return(dock); }; return(m_View); }
/// <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)); // radian angle step NComboBox radianAngleStepComboBox = new NComboBox(); radianAngleStepComboBox.Items.Add(new NComboBoxItem("15")); radianAngleStepComboBox.Items.Add(new NComboBoxItem("30")); radianAngleStepComboBox.Items.Add(new NComboBoxItem("45")); radianAngleStepComboBox.Items.Add(new NComboBoxItem("90")); radianAngleStepComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnRadianAngleStepComboBoxSelectedIndexChanged); stack.Add(NPairBox.Create("Radian Angle Step", radianAngleStepComboBox)); // red axis position stack.Add(new NLabel("Red Axis:")); { NCheckBox dockRedAxisToBottomCheckBox = new NCheckBox("Dock Bottom"); dockRedAxisToBottomCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnDockRedAxisToBottomCheckBoxCheckedChanged); stack.Add(dockRedAxisToBottomCheckBox); m_RedAxisAngleUpDown = new NNumericUpDown(); m_RedAxisAngleUpDown.Value = 0; m_RedAxisAngleUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnRedAxisAngleUpDownValueChanged); stack.Add(NPairBox.Create("Angle:", m_RedAxisAngleUpDown)); NCheckBox redAxisPaintRefelectionCheckBox = new NCheckBox("Paint Reflection"); redAxisPaintRefelectionCheckBox.Checked = true; redAxisPaintRefelectionCheckBox.CheckedChanged += OnRedAxisPaintRefelectionCheckBoxCheckedChanged; stack.Add(redAxisPaintRefelectionCheckBox); m_RedAxisScaleLabelAngleMode = new NComboBox(); m_RedAxisScaleLabelAngleMode.FillFromEnum <ENScaleLabelAngleMode>(); m_RedAxisScaleLabelAngleMode.SelectedIndex = (int)ENScaleLabelAngleMode.View; m_RedAxisScaleLabelAngleMode.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnUpdateRedAxisSaleLabelAngle); stack.Add(NPairBox.Create("Scale Label Angle Mode:", m_RedAxisScaleLabelAngleMode)); m_RedAxisSaleLabelAngleUpDown = new NNumericUpDown(); m_RedAxisSaleLabelAngleUpDown.ValueChanged += OnUpdateRedAxisSaleLabelAngle; stack.Add(NPairBox.Create("Scale Label Angle:", m_RedAxisSaleLabelAngleUpDown)); NNumericUpDown redAxisBeginPercentUpDown = new NNumericUpDown(); redAxisBeginPercentUpDown.Value = m_RedAxis.Anchor.BeginPercent; redAxisBeginPercentUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnRedAxisBeginPercentUpDownValueChanged); stack.Add(NPairBox.Create("Begin percent:", redAxisBeginPercentUpDown)); NNumericUpDown redAxisEndPercentUpDown = new NNumericUpDown(); redAxisEndPercentUpDown.Value = m_RedAxis.Anchor.EndPercent; redAxisEndPercentUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnRedAxisEndPercentUpDownValueChanged); stack.Add(NPairBox.Create("End percent:", redAxisEndPercentUpDown)); } // green axis position stack.Add(new NLabel("Green Axis:")); { NCheckBox dockGreenAxisToLeftCheckBox = new NCheckBox("Dock Left"); dockGreenAxisToLeftCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnDockGreenAxisToLeftCheckBoxCheckedChanged); stack.Add(dockGreenAxisToLeftCheckBox); m_GreenAxisAngleUpDown = new NNumericUpDown(); m_GreenAxisAngleUpDown.Value = 90; m_GreenAxisAngleUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnGreenAxisAngleUpDownValueChanged); stack.Add(NPairBox.Create("Angle:", m_GreenAxisAngleUpDown)); NCheckBox greenAxisPaintRefelectionCheckBox = new NCheckBox("Paint Reflection"); greenAxisPaintRefelectionCheckBox.Checked = true; greenAxisPaintRefelectionCheckBox.CheckedChanged += OnGreenAxisPaintRefelectionCheckBoxCheckedChanged; stack.Add(greenAxisPaintRefelectionCheckBox); m_GreenAxisScaleLabelAngleMode = new NComboBox(); m_GreenAxisScaleLabelAngleMode.FillFromEnum <ENScaleLabelAngleMode>(); m_GreenAxisScaleLabelAngleMode.SelectedIndex = (int)ENScaleLabelAngleMode.View; m_GreenAxisScaleLabelAngleMode.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnUpdateGreenAxisSaleLabelAngle); stack.Add(NPairBox.Create("Scale Label Angle Mode:", m_GreenAxisScaleLabelAngleMode)); m_GreenAxisSaleLabelAngleUpDown = new NNumericUpDown(); m_GreenAxisSaleLabelAngleUpDown.ValueChanged += OnUpdateGreenAxisSaleLabelAngle; stack.Add(NPairBox.Create("Scale Label Angle:", m_GreenAxisSaleLabelAngleUpDown)); NNumericUpDown greenAxisBeginPercentUpDown = new NNumericUpDown(); greenAxisBeginPercentUpDown.Value = m_GreenAxis.Anchor.BeginPercent; greenAxisBeginPercentUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnGreenAxisBeginPercentUpDownValueChanged); stack.Add(NPairBox.Create("Begin percent:", greenAxisBeginPercentUpDown)); NNumericUpDown greenAxisEndPercentUpDown = new NNumericUpDown(); greenAxisEndPercentUpDown.Value = m_GreenAxis.Anchor.EndPercent; greenAxisEndPercentUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnGreenAxisEndPercentUpDownValueChanged); stack.Add(NPairBox.Create("End percent:", greenAxisEndPercentUpDown)); } return(group); }
protected override NWidget CreateExampleContent() { // sources NGroupBox sourcesGroup = new NGroupBox("Drag Drop Sources"); { NStackPanel sourcesStack = new NStackPanel(); sourcesGroup.Content = sourcesStack; NContentHolder textSource1 = CreateDemoElement("Drag Source Text 1"); NDataObject dataObject1 = new NDataObject(); dataObject1.SetData(NDataFormat.TextFormat, "Text string 1"); textSource1.Tag = dataObject1; sourcesStack.Add(textSource1); textSource1.MouseDown += new Function <NMouseButtonEventArgs>(OnSourceMouseDown); NContentHolder textSource2 = CreateDemoElement("Drag Source Text 2"); NDataObject dataObject2 = new NDataObject(); dataObject2.SetData(NDataFormat.TextFormat, "Text string 2"); textSource2.Tag = dataObject2; sourcesStack.Add(textSource2); textSource2.MouseDown += new Function <NMouseButtonEventArgs>(OnSourceMouseDown); //NContentHolder widgetSource1 = CreateDemoElement("Drag Button"); //widgetSource1.Tag = new NContentDataObject(new NButton("Widget In Drag and Drop")); //sourcesStack.Add(widgetSource1); //widgetSource1.MouseDown += new Function<NMouseEventArgs>(OnSourceMouseDown); //NContentHolder compositeSource1 = CreateDemoElement("Composite Data Object"); //compositeSource1.Tag = new NCompositeDataObject( // new NContentDataObject(new NButton("Widget In Drag and Drop")), // new NContentDataObject("Hello there")); //sourcesStack.Add(compositeSource1); //compositeSource1.MouseDown += new Function<NMouseEventArgs>(OnSourceMouseDown); } // targets NGroupBox targetsGroup = new NGroupBox("Drop Targets"); { NStackPanel targetsStack = new NStackPanel(); targetsGroup.Content = targetsStack; NContentHolder dropTextTarget = CreateDemoElement("Drop Text On Me"); targetsStack.Add(dropTextTarget); dropTextTarget.DragOver += new Function <NDragActionEventArgs>(OnDragOverTextTarget); dropTextTarget.DragDrop += new Function <NDragActionEventArgs>(OnDragDropTextTarget); } // create the source and targets splitter NSplitter splitter = new NSplitter(); splitter.SplitMode = ENSplitterSplitMode.Proportional; splitter.SplitFactor = 0.5d; splitter.Pane1.Content = sourcesGroup; splitter.Pane2.Content = targetsGroup; // create the inspector on the bottom NGroupBox inspectorGroup = new NGroupBox("Data Object Ispector"); NListBox inspector = new NListBox(); inspectorGroup.Content = inspector; inspector.DragEnter += new Function <NDragOverChangeEventArgs>(OnInspectorDragEnter); inspector.DragLeave += new Function <NDragOverChangeEventArgs>(OnInspectorDragLeave); NStackPanel stack = new NStackPanel(); stack.HorizontalPlacement = ENHorizontalPlacement.Fit; stack.VerticalPlacement = ENVerticalPlacement.Fit; stack.FillMode = ENStackFillMode.Last; stack.Add(splitter); stack.Add(inspectorGroup); return(stack); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); stack.Add(new NLabel("Y Axis Reference Line")); NNumericUpDown yReferenceLineValueUpDown = new NNumericUpDown(); yReferenceLineValueUpDown.ValueChanged += OnYReferenceLineValueUpDownValueChanged; yReferenceLineValueUpDown.Value = m_YReferenceLine.Value; stack.Add(NPairBox.Create("Value:", yReferenceLineValueUpDown)); NCheckBox yReferenceLineIncludeInAxisRangeCheckBox = new NCheckBox("Include Value in Axis Range"); yReferenceLineIncludeInAxisRangeCheckBox.Checked = m_YReferenceLine.IncludeValueInAxisRange; yReferenceLineIncludeInAxisRangeCheckBox.CheckedChanged += OnYReferenceLineIncludeInAxisRangeCheckBoxCheckedChanged; stack.Add(yReferenceLineIncludeInAxisRangeCheckBox); NCheckBox yReferenceLinePaintAfterSeriesCheckBox = new NCheckBox("Paint After Series"); yReferenceLinePaintAfterSeriesCheckBox.Checked = m_YReferenceLine.PaintAfterChartContent; yReferenceLinePaintAfterSeriesCheckBox.CheckedChanged += OnYReferenceLinePaintAfterSeriesCheckBoxCheckedChanged; stack.Add(yReferenceLinePaintAfterSeriesCheckBox); NComboBox yTextAlignmentComboBox = new NComboBox(); yTextAlignmentComboBox.FillFromEnum <ENContentAlignment>(); yTextAlignmentComboBox.SelectedIndex = (int)m_YReferenceLine.TextAlignment; yTextAlignmentComboBox.SelectedIndexChanged += OnYTextAlignmentComboBoxSelectedIndexChanged; stack.Add(NPairBox.Create("Text Alignment:", yTextAlignmentComboBox)); stack.Add(new NLabel("X Axis Reference Line")); NNumericUpDown xReferenceLineValueUpDown = new NNumericUpDown(); xReferenceLineValueUpDown.Value = m_XReferenceLine.Value; xReferenceLineValueUpDown.ValueChanged += OnXReferenceLineValueUpDownValueChanged; stack.Add(NPairBox.Create("Value:", xReferenceLineValueUpDown)); NCheckBox xReferenceLinePaintAfterSeriesCheckBox = new NCheckBox("Paint After Series"); xReferenceLinePaintAfterSeriesCheckBox.Checked = m_XReferenceLine.PaintAfterChartContent; xReferenceLinePaintAfterSeriesCheckBox.CheckedChanged += OnXReferenceLinePaintAfterSeriesCheckBoxCheckedChanged; stack.Add(xReferenceLinePaintAfterSeriesCheckBox); NCheckBox xReferenceLineIncludeInAxisRangeCheckBox = new NCheckBox("Include Value in Axis Range"); xReferenceLineIncludeInAxisRangeCheckBox.Checked = m_YReferenceLine.IncludeValueInAxisRange; xReferenceLineIncludeInAxisRangeCheckBox.CheckedChanged += OnXReferenceLineIncludeInAxisRangeCheckBoxCheckedChanged; stack.Add(xReferenceLineIncludeInAxisRangeCheckBox); NComboBox xTextAlignmentComboBox = new NComboBox(); xTextAlignmentComboBox.FillFromEnum <ENContentAlignment>(); xTextAlignmentComboBox.SelectedIndex = (int)m_XReferenceLine.TextAlignment; xTextAlignmentComboBox.SelectedIndexChanged += OnXTextAlignmentComboBoxSelectedIndexChanged; stack.Add(NPairBox.Create("Text Alignment:", xTextAlignmentComboBox)); return(boxGroup); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); // create the predefined borders combo and populate it stack.Add(CreateLabel("Apply Predefined Border:")); m_PredefinedBorderCombo = new NComboBox(); stack.Add(m_PredefinedBorderCombo); m_PredefinedBorderCombo.Items.Add(new NComboBoxItem("3D Raised Border")); m_PredefinedBorderCombo.Items.Add(new NComboBoxItem("3D Sunken Border")); m_PredefinedBorderCombo.Items.Add(new NComboBoxItem("Filled Border")); m_PredefinedBorderCombo.Items.Add(new NComboBoxItem("Filled Border with Outlines")); m_PredefinedBorderCombo.SelectedIndex = 0; m_PredefinedBorderCombo.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnPredefinedBorderComboSelectedIndexChanged); // create the combos for the border thickness stack.Add(CreateLabel("Border Thickness:")); m_BorderThicknessCombo = CreateBorderSideThicknessCombo(); stack.Add(m_BorderThicknessCombo); stack.Add(CreateLabel("Left Side Thickness:")); m_LeftSideThicknessCombo = CreateBorderSideThicknessCombo(); stack.Add(m_LeftSideThicknessCombo); stack.Add(CreateLabel("Right Side Thickness:")); m_RightSideThicknessCombo = CreateBorderSideThicknessCombo(); stack.Add(m_RightSideThicknessCombo); stack.Add(CreateLabel("Top Side Thickness:")); m_TopSideThicknessCombo = CreateBorderSideThicknessCombo(); stack.Add(m_TopSideThicknessCombo); stack.Add(CreateLabel("Bottom Side Thickness:")); m_BottomSideThicknessCombo = CreateBorderSideThicknessCombo(); stack.Add(m_BottomSideThicknessCombo); stack.Add(CreateLabel("Inner Corner Radius:")); m_InnerRadiusCombo = CreateCornerRadiusCombo(); stack.Add(m_InnerRadiusCombo); stack.Add(CreateLabel("Outer Corner Radius:")); m_OuterRadiusCombo = CreateCornerRadiusCombo(); stack.Add(m_OuterRadiusCombo); return(stack); }
protected override NWidget CreateExampleContent() { // Create a table panel to hold the canvases and the labels m_Table = new NTableFlowPanel(); m_Table.HorizontalPlacement = ENHorizontalPlacement.Left; m_Table.VerticalPlacement = ENVerticalPlacement.Top; m_Table.Padding = new NMargins(30); m_Table.HorizontalSpacing = 30; m_Table.VerticalSpacing = 30; m_Table.MaxOrdinal = 4; string[] names = new string[] { "Rectangle", "Rounded Rectangle", "Ellipse", "Ellipse Segment", "Elliptical Arc", "Pie", "Circle", "Circle Segment", "Triangle", "Quad", "Polygon", "Line Segment", "Polyline", "Cubic Bezier", "Nurbs Curve", "Path with Multiple Figures" }; NGraphicsPath[] paths = CreatePaths(defaultCanvasWidth, defaultCanvasHeight); int count = paths.Length; for (int i = 0; i < count; i++) { NStackPanel stack = new NStackPanel(); m_Table.Add(stack); stack.VerticalSpacing = 5; // Create a canvas to draw the graphics path in NCanvas canvas = new NCanvas(); canvas.PreferredSize = new NSize(defaultCanvasWidth, defaultCanvasHeight); canvas.Tag = paths[i]; canvas.PrePaint += new Function <NCanvasPaintEventArgs>(OnCanvasPrePaint); canvas.BackgroundFill = new NColorFill(NColor.LightGreen); stack.Add(canvas); // Create a label for the geometry primitive's name NLabel label = new NLabel(names[i]); label.HorizontalPlacement = ENHorizontalPlacement.Center; stack.Add(label); } // The table must be scrollable NScrollContent scroll = new NScrollContent(); scroll.Content = m_Table; return(scroll); }
protected override NWidget CreateExampleContent() { // Create and initialize a top level window m_Window = new NTopLevelWindow(); m_Window.Title = "Top Level Window"; m_Window.RemoveFromParentOnClose = true; m_Window.AllowXResize = true; m_Window.AllowYResize = true; m_Window.PreferredSize = new NSize(300, 300); m_Window.QueryManualStartPosition += new Function <NEventArgs>(OnWindowQueryManualStartPosition); m_Window.Closed += new Function <NEventArgs>(OnWindowClosed); // Create the top level window's content NStackPanel stack = new NStackPanel(); stack.FitMode = ENStackFitMode.First; stack.FillMode = ENStackFillMode.First; NLabel label = new NLabel("This is a top level window."); label.HorizontalPlacement = ENHorizontalPlacement.Center; label.VerticalPlacement = ENVerticalPlacement.Center; stack.Add(label); NButton closeButton = new NButton("Close"); closeButton.HorizontalPlacement = ENHorizontalPlacement.Center; closeButton.Click += new Function <NEventArgs>(OnCloseButtonClick); stack.Add(closeButton); m_Window.Content = stack; // Create example content m_SettingsStack = new NStackPanel(); m_SettingsStack.HorizontalPlacement = ENHorizontalPlacement.Left; NList <NPropertyEditor> editors = NDesigner.GetDesigner(m_Window).CreatePropertyEditors(m_Window, NTopLevelWindow.TitleProperty, NTopLevelWindow.StartPositionProperty, NTopLevelWindow.XProperty, NTopLevelWindow.YProperty, NStylePropertyEx.ExtendedLookPropertyEx, NTopLevelWindow.ModalProperty, NTopLevelWindow.ShowInTaskbarProperty, NTopLevelWindow.ShowTitleBarProperty, NTopLevelWindow.ShowControlBoxProperty, NTopLevelWindow.AllowMinimizeProperty, NTopLevelWindow.AllowMaximizeProperty, NTopLevelWindow.AllowXResizeProperty, NTopLevelWindow.AllowYResizeProperty ); // Change the text of the extended look property editor label = (NLabel)editors[4].GetFirstDescendant(new NInstanceOfSchemaFilter(NLabel.NLabelSchema)); label.Text = "Extended Look:"; // Add the created property editors to the stack for (int i = 0, count = editors.Count; i < count; i++) { m_SettingsStack.Add(editors[i]); } // Create a button that opens the window NButton openWindowButton = new NButton("Open Window..."); openWindowButton.Content.HorizontalPlacement = ENHorizontalPlacement.Center; openWindowButton.Click += new Function <NEventArgs>(OnOpenWindowButtonClick); m_SettingsStack.Add(openWindowButton); return(new NUniSizeBoxGroup(m_SettingsStack)); }
protected override NWidget CreateExampleControls() { NRadioButton drawAtPointButton = new NRadioButton("Draw Image at Point"); NRadioButton drawInRectButton = new NRadioButton("Draw Image in Rectangle"); NStackPanel radioStack = new NStackPanel(); radioStack.Add(drawAtPointButton); radioStack.Add(drawInRectButton); m_RadioGroup = new NRadioButtonGroup(); m_RadioGroup.HorizontalPlacement = ENHorizontalPlacement.Left; m_RadioGroup.VerticalPlacement = ENVerticalPlacement.Top; m_RadioGroup.Content = radioStack; m_RadioGroup.SelectedIndex = m_PaintImageInRectangle ? 1 : 0; m_RadioGroup.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnValueChanged); // Image X position editor m_PositionXUpDown = new NNumericUpDown(); m_PositionXUpDown.Minimum = 0; m_PositionXUpDown.Maximum = 800; m_PositionXUpDown.Value = m_PosX; m_PositionXUpDown.Step = 1; m_PositionXUpDown.DecimalPlaces = 0; m_PositionXUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnValueChanged); // Image Y position editor m_PositionYUpDown = new NNumericUpDown(); m_PositionYUpDown.Minimum = 0; m_PositionYUpDown.Maximum = 600; m_PositionYUpDown.Value = m_PosY; m_PositionYUpDown.Step = 1; m_PositionYUpDown.DecimalPlaces = 0; m_PositionYUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnValueChanged); // Image height editor m_WidthUpDown = new NNumericUpDown(); m_WidthUpDown.Enabled = m_PaintImageInRectangle; m_WidthUpDown.Minimum = 0; m_WidthUpDown.Maximum = 400; m_WidthUpDown.Value = m_Width; m_WidthUpDown.Step = 1; m_WidthUpDown.DecimalPlaces = 0; m_WidthUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnValueChanged); // Image height editor m_HeightUpDown = new NNumericUpDown(); m_HeightUpDown.Enabled = m_PaintImageInRectangle; m_HeightUpDown.Minimum = 0; m_HeightUpDown.Maximum = 400; m_HeightUpDown.Value = m_Height; m_HeightUpDown.Step = 1; m_HeightUpDown.DecimalPlaces = 0; m_HeightUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnValueChanged); NStackPanel stack = new NStackPanel(); stack.FillMode = ENStackFillMode.None; stack.FitMode = ENStackFitMode.None; stack.Add(m_RadioGroup); stack.Add(NPairBox.Create("X Position:", m_PositionXUpDown)); stack.Add(NPairBox.Create("Y Position:", m_PositionYUpDown)); stack.Add(NPairBox.Create("Width:", m_WidthUpDown)); stack.Add(NPairBox.Create("Height:", m_HeightUpDown)); return(new NUniSizeBoxGroup(stack)); }
private NShape CreateTrapezoidShape(double width, double height, double pinX, double pinY) { NShape shape = new NShape(); shape.Init2DShape(); shape.Width = width; shape.Height = height; shape.PinX = pinX; shape.PinY = pinY; // add controls NControl control = new NControl(); control.SetFx(NControl.XProperty, new NShapeWidthFactorFx(0.3)); control.Y = 0.0d; control.XBehavior = ENCoordinateBehavior.OffsetFromMax; control.YBehavior = ENCoordinateBehavior.Locked; control.Tooltip = "Modify strip width"; shape.Controls.Add(control); // add a geometry NGeometry geometry1 = new NGeometry(); { NMoveTo plotFigure = geometry1.MoveTo("MIN(Controls.0.X,Width-Controls.0.X)", 0.0d); geometry1.LineTo("Width-Geometry.0.X", 0.0d); geometry1.LineTo(new NShapeWidthFactorFx(1), new NShapeHeightFactorFx(1)); geometry1.LineTo(0.0d, "Height"); geometry1.LineTo("Geometry.0.X", "Geometry.0.Y"); plotFigure.CloseFigure = true; } shape.Geometry = geometry1; // add ports // top NPort port = new NPort(); port.SetFx(NPort.XProperty, new NShapeWidthFactorFx(0.5)); port.Y = 0.0d; port.GlueMode = ENPortGlueMode.Outward; port.DirX = 0.0d; port.DirY = -1; shape.Ports.Add(port); // right port = new NPort(); port.SetFx(NPort.XProperty, new NShapeWidthFactorFx(1)); port.SetFx(NPort.YProperty, new NShapeHeightFactorFx(0.5)); port.GlueMode = ENPortGlueMode.InwardAndOutward; port.DirX = 1; port.DirY = 0.0d; shape.Ports.Add(port); // bottom port = new NPort(); port.SetFx(NPort.XProperty, "Controls.0.X"); port.SetFx(NPort.YProperty, new NShapeHeightFactorFx(1)); port.DirX = 0.0d; port.DirY = 1; shape.Ports.Add(port); // left port = new NPort(); port.X = 0.0d; port.SetFx(NPort.YProperty, new NShapeHeightFactorFx(0.5)); port.DirX = -1; port.DirY = 0.0d; shape.Ports.Add(port); // shape.FillStyle = new NColorFillStyle(Color.Gray); shape.Geometry.Stroke = new NStroke(1, NColor.Black); shape.Geometry.Stroke.LineJoin = ENLineJoin.Miter; /* NShadow shadow = new NShadow(NColor.Green, 50, 50); * shadow.ScalePinPoint = new NPoint(0.5, 0.5); * shadow.Scale = 1.0; * shadow.UseFillAndStrokeAlpha = false; * shadow.ApplyToFilling = true; * shadow.ApplyToOutline = true; * shape.Shadow = shadow;*/ NStackPanel stack = new NStackPanel(); NButton button = new NButton("Hello Joro"); //button.Click += new Function<NEventArgs>(button_Click); stack.Add(button); NLabel label = new NLabel("Hello World"); stack.Add(label); //shape.Widget = stack; //shape.Widget = new NLabel("Hello World"); return(shape); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); NStackPanel controlStack = new NStackPanel(); controlStack.Direction = ENHVDirection.LeftToRight; stack.Add(controlStack); m_LinearGauge = new NLinearGauge(); m_LinearGauge.Orientation = ENLinearGaugeOrientation.Vertical; m_LinearGauge.PreferredSize = defaultLinearVerticalGaugeSize; m_LinearGauge.CapEffect = new NGelCapEffect(); m_LinearGauge.Border = base.CreateBorder(); m_LinearGauge.Padding = new NMargins(20); m_LinearGauge.BorderThickness = new NMargins(6); controlStack.Add(m_LinearGauge); // create the background panel NAdvancedGradientFill advGradient = new NAdvancedGradientFill(); advGradient.BackgroundColor = NColor.Black; advGradient.Points.Add(new NAdvancedGradientPoint(NColor.LightGray, new NAngle(10, NUnit.Degree), 0.1f, 0, 1.0f, ENAdvancedGradientPointShape.Circle)); m_LinearGauge.BackgroundFill = advGradient; m_LinearGauge.Axes.Clear(); NGaugeAxis axis = new NGaugeAxis(); m_LinearGauge.Axes.Add(axis); axis.Anchor = new NModelGaugeAxisAnchor(24.0, ENVerticalAlignment.Center, ENScaleOrientation.Left); ConfigureScale((NLinearScale)axis.Scale); // add some indicators m_LinearGauge.Indicators.Add(new NMarkerValueIndicator(60)); // create the radial gauge m_RadialGauge = new NRadialGauge(); controlStack.Add(m_RadialGauge); m_RadialGauge.CapEffect = new NGlassCapEffect(); m_RadialGauge.Dial = new NDial(ENDialShape.Circle, new NEdgeDialRim()); // set some background advGradient = new NAdvancedGradientFill(); advGradient.BackgroundColor = NColor.Black; advGradient.Points.Add(new NAdvancedGradientPoint(NColor.LightGray, new NAngle(10, NUnit.Degree), 0.1f, 0, 1.0f, ENAdvancedGradientPointShape.Circle)); m_RadialGauge.Dial.BackgroundFill = advGradient; m_RadialGauge.CapEffect = new NGlassCapEffect(ENCapEffectShape.Ellipse); // create the radial gauge m_RadialGauge.SweepAngle = new NAngle(270, NUnit.Degree); m_RadialGauge.BeginAngle = new NAngle(-90, NUnit.Degree); // FIX remove axis.Scale.Title.Text = "Axis Title"; NStandardScale scale = axis.Scale as NStandardScale; scale.MajorTickMode = ENMajorTickMode.AutoMinDistance; scale.MinTickDistance = 50; // configure the axis m_RadialGauge.Axes.Clear(); axis = new NGaugeAxis(); axis.Range = new NRange(0, 100); axis.Anchor.ScaleOrientation = ENScaleOrientation.Right; axis.Anchor = new NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, true, ENScaleOrientation.Right, 0, 100); m_RadialGauge.Axes.Add(axis); ConfigureScale((NLinearScale)axis.Scale); // add some indicators NNeedleValueIndicator needle = new NNeedleValueIndicator(60); needle.OffsetOriginMode = ENIndicatorOffsetOriginMode.ScaleMiddle; needle.OffsetFromScale = 15; m_RadialGauge.Indicators.Add(needle); return(stack); }
private void InitializeComponent() { /* * Window setup * */ this.Text = "Dagobar"; this.Size = new System.Drawing.Size(16 * windowCoeff, 9 * windowCoeff); this.MinimumSize = new System.Drawing.Size(this.Width / 2, this.Height / 2); #region "Controls Setup & Layout Setup" textBoxSend = new NTextBox(); textBoxSend.Font = new Nevron.Nov.Graphics.NFont("Lucidia Console", 12); textBoxSend.VerticalPlacement = Nevron.Nov.Layout.ENVerticalPlacement.Center; textBoxSend.Margins = new Nevron.Nov.Graphics.NMargins(1, 3, 0, 3); textBoxSend.KeyUp += textBoxSend_KeyUp; buttonSend = new NButton("Envoyer"); buttonSend.PreferredWidth = 100; buttonSend.Content.HorizontalPlacement = Nevron.Nov.Layout.ENHorizontalPlacement.Center; buttonSend.Margins = new Nevron.Nov.Graphics.NMargins(3.0); buttonSend.Click += buttonSend_Click; panelSend = new NStackPanel(); panelSend.Direction = Nevron.Nov.Layout.ENHVDirection.LeftToRight; panelSend.FillMode = Nevron.Nov.Layout.ENStackFillMode.First; panelSend.Add(textBoxSend); panelSend.Add(buttonSend); listBoxChat = new NListBox(); listBoxChat.Margins = new Nevron.Nov.Graphics.NMargins(1.0); panelChat = new NStackPanel(); panelChat.Direction = Nevron.Nov.Layout.ENHVDirection.TopToBottom; panelChat.FillMode = Nevron.Nov.Layout.ENStackFillMode.First; panelChat.Add(listBoxChat); panelChat.Add(panelSend); labelChannel = new NLabel("/--/"); labelChannel.HorizontalPlacement = Nevron.Nov.Layout.ENHorizontalPlacement.Center; labelChannel.Font = new Nevron.Nov.Graphics.NFont("Lucidia Console", 14); listBoxUsers = new NListBox(); listBoxUsers.Margins = new Nevron.Nov.Graphics.NMargins(1.0); panelUsers = new NStackPanel(); panelUsers.Direction = Nevron.Nov.Layout.ENHVDirection.TopToBottom; panelUsers.FillMode = Nevron.Nov.Layout.ENStackFillMode.Last; panelUsers.Add(labelChannel); panelUsers.Add(listBoxUsers); panelUsers.PreferredWidth = 150; panelTabChat = new NStackPanel(); panelTabChat.FillMode = Nevron.Nov.Layout.ENStackFillMode.First; panelTabChat.Direction = Nevron.Nov.Layout.ENHVDirection.LeftToRight; panelTabChat.Add(panelChat); panelTabChat.Add(panelUsers); panelMain = new NStackPanel(); panelMain.Direction = Nevron.Nov.Layout.ENHVDirection.LeftToRight; panelMain.FillMode = Nevron.Nov.Layout.ENStackFillMode.Last; panelMain.Add(panelTabChat); panelRibbonInformations = new NStackPanel(); panelRibbonInformations.FillMode = Nevron.Nov.Layout.ENStackFillMode.Equal; labelRibbonChannel = new NLabel("Chaîne : /--/"); labelRibbonChannel.HorizontalPlacement = Nevron.Nov.Layout.ENHorizontalPlacement.Center; labelRibbonViewers = new NLabel("Nombre de spectateurs : /--/"); labelRibbonViewers.HorizontalPlacement = Nevron.Nov.Layout.ENHorizontalPlacement.Center; labelRibbonVersion = new NLabel("Version : " + Properties.Settings.Default.Version); labelRibbonVersion.HorizontalPlacement = Nevron.Nov.Layout.ENHorizontalPlacement.Center; panelRibbonInformations.Add(labelRibbonChannel); panelRibbonInformations.Add(labelRibbonViewers); panelRibbonInformations.Add(labelRibbonVersion); ribbonGroupInformations = new NRibbonGroup("Informations"); ribbonGroupInformations.Header.DialogLauncherButton.Visibility = ENVisibility.Hidden; ribbonGroupInformations.PreferredHeight = 64; ribbonGroupInformations.Items.Add(panelRibbonInformations); listBoxPlugins = new NListBox(); listBoxPlugins.VScrollMode = ENScrollMode.Always; listBoxPlugins.PreferredHeight = 64; listBoxPlugins.PreferredWidth = 256; ribbonGroupPlugins = new NRibbonGroup("Plugins"); ribbonGroupPlugins.Header.DialogLauncherButton.Visibility = ENVisibility.Hidden; ribbonGroupPlugins.Items.Add(listBoxPlugins); ribbonButtonConfiguration = new NRibbonButton("Configuration", NImage.FromFile(Application.StartupPath + @"\Resources\settings.png"), NImage.FromFile(Application.StartupPath + @"\Resources\settings.png")); ribbonButtonConfiguration.PreferredWidth = 86; ribbonButtonConfiguration.Click += ribbonButtonConfiguration_Click; ribbonButtonChannel = new NRibbonButton("Changer de chaîne", NImage.FromFile(Application.StartupPath + @"\Resources\move_shit_around.png"), NImage.FromFile(Application.StartupPath + @"\Resources\move_shit_around.png")); ribbonButtonChannel.PreferredWidth = 86; ribbonButtonChannel.Click += ribbonButtonChannel_Click; ribbonButtonQuit = new NRibbonButton("Quitter", NImage.FromFile(Application.StartupPath + @"\Resources\quit.png"), NImage.FromFile(Application.StartupPath + @"\Resources\quit.png")); ribbonButtonQuit.PreferredWidth = 86; ribbonButtonQuit.Click += ribbonButtonQuit_Click; ribbonGroupActions = new NRibbonGroup("Actions"); ribbonGroupActions.Header.DialogLauncherButton.Visibility = ENVisibility.Hidden; ribbonGroupActions.Items.Add(ribbonButtonConfiguration); ribbonGroupActions.Items.Add(ribbonButtonChannel); ribbonGroupActions.Items.Add(ribbonButtonQuit); ribbonTagPageMain = new NRibbonTabPage("Dagobar"); ribbonTagPageMain.Groups.Add(ribbonGroupInformations); ribbonTagPageMain.Groups.Add(ribbonGroupPlugins); ribbonTagPageMain.Groups.Add(ribbonGroupActions); ribbon = new NRibbon(); ribbon.Tab.TabPages.Add(ribbonTagPageMain); panelRibbon = new NStackPanel(); panelRibbon.FillMode = Nevron.Nov.Layout.ENStackFillMode.Last; panelRibbon.Add(ribbon); panelRibbon.Add(panelMain); #endregion // Create main control controlMain = new NNovWidgetHost<NStackPanel>(panelRibbon); controlMain.Dock = DockStyle.Fill; }
protected override NWidget CreateExampleControls() { m_Layout.Changed += OnLayoutChanged; NStackPanel stack = (NStackPanel)base.CreateExampleControls(); // property editor NEditor editor = NDesigner.GetDesigner(m_Layout).CreateInstanceEditor(m_Layout); stack.Add(new NGroupBox("Properties", editor)); NButton arrangeButton = new NButton("Arrange Diagram"); arrangeButton.Click += OnArrangeButtonClick; stack.Add(arrangeButton); // items stack NStackPanel itemsStack = new NStackPanel(); if ((m_Layout is NBoxLayout) && !(m_Layout is NDockLayout)) { // NOTE: For Cells layout we provide the user with the ability to add shapes with different sizes so that he/she can test the layouts NButton addSmallItemButton = new NButton("Add Small Shape"); addSmallItemButton.Click += new Function <NEventArgs>(OnAddSmallItemButtonClick); itemsStack.Add(addSmallItemButton); NButton addLargeItemButton = new NButton("Add Large Shape"); addLargeItemButton.Click += new Function <NEventArgs>(OnAddLargeItemButtonClick); itemsStack.Add(addLargeItemButton); NButton addRandomItemButton = new NButton("Add Random Shape"); addRandomItemButton.Click += new Function <NEventArgs>(OnAddRandomItemButtonClick); itemsStack.Add(addRandomItemButton); NButton removeAllItemsButton = new NButton("Remove All Shapes"); removeAllItemsButton.Click += new Function <NEventArgs>(OnRemoveAllItemsButtonClick); itemsStack.Add(removeAllItemsButton); } else if (m_Layout is NTreeLayout) { // NOTE: For Tree layouts we provide the user with the ability to generate random tree diagrams so that he/she can test the layouts NButton randomTree1Button = new NButton("Random Tree (max 6 levels, max 3 branch nodes)"); randomTree1Button.Click += OnRandomTree1ButtonClick; itemsStack.Add(randomTree1Button); NButton randomTree2Button = new NButton("Random Tree (max 8 levels, max 2 branch nodes)"); randomTree2Button.Click += OnRandomTree2ButtonClick; itemsStack.Add(randomTree2Button); } else if ((m_Layout is NGraphLayout) && !(m_Layout is NBarycenterGraphLayout)) { // NOTE: For Graph layouts we provide the user with the ability to generate random graph diagrams so that he/she can test the layouts NButton randomGraph1Button = new NButton("Random Graph (10 vertices, 15 edges)"); randomGraph1Button.Click += OnRandomGraph1ButtonClick; itemsStack.Add(randomGraph1Button); NButton randomGraph2Button = new NButton("Random Graph (20 vertices, 30 edges)"); randomGraph2Button.Click += OnRandomGraph2ButtonClick; itemsStack.Add(randomGraph2Button); } else { // NOTE: Not any of the predefined cases -> create custom controls CreateItemsControls(itemsStack); } stack.Add(new NGroupBox("Items", itemsStack)); return(stack); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NStackPanel propertyStack = new NStackPanel(); stack.Add(new NUniSizeBoxGroup(propertyStack)); NButton toggleTimerButton = new NButton("Stop Timer"); toggleTimerButton.Click += OnToggleTimerButtonClick; toggleTimerButton.Tag = 0; stack.Add(toggleTimerButton); NComboBox rangeIndicatorShapeCombo = new NComboBox(); rangeIndicatorShapeCombo.FillFromEnum <ENRangeIndicatorShape>(); rangeIndicatorShapeCombo.SelectedIndexChanged += OnRangeIndicatorShapeComboSelectedIndexChanged; rangeIndicatorShapeCombo.SelectedIndex = (int)ENRangeIndicatorShape.Bar; stack.Add(NPairBox.Create("Shape:", rangeIndicatorShapeCombo)); NComboBox paletteColorModeCombo = new NComboBox(); paletteColorModeCombo.FillFromEnum <ENPaletteColorMode>(); paletteColorModeCombo.SelectedIndexChanged += OnPaletteColorModeComboSelectedIndexChanged; paletteColorModeCombo.SelectedIndex = (int)ENPaletteColorMode.Spread; stack.Add(NPairBox.Create("Palette Color Mode:", paletteColorModeCombo)); NComboBox orientationCombo = new NComboBox(); orientationCombo.FillFromEnum <ENLinearGaugeOrientation>(); orientationCombo.SelectedIndexChanged += OnOrientationComboSelectedIndexChanged; orientationCombo.SelectedIndex = (int)ENLinearGaugeOrientation.Vertical; stack.Add(NPairBox.Create("Orientation", orientationCombo)); NNumericUpDown beginAngleUpDown = new NNumericUpDown(); beginAngleUpDown.Value = m_RadialGauge.BeginAngle.Value; beginAngleUpDown.ValueChanged += OnBeginAngleUpDownValueChanged; stack.Add(NPairBox.Create("Begin Angle:", beginAngleUpDown)); NNumericUpDown sweepAngleUpDown = new NNumericUpDown(); sweepAngleUpDown.Value = m_RadialGauge.BeginAngle.Value; sweepAngleUpDown.ValueChanged += OnSweepAngleUpDownValueChanged; stack.Add(NPairBox.Create("Sweep Angle:", sweepAngleUpDown)); NCheckBox invertScaleCheckBox = new NCheckBox("Invert Scale"); invertScaleCheckBox.CheckedChanged += OnInvertScaleCheckBoxCheckedChanged; invertScaleCheckBox.Checked = false; stack.Add(invertScaleCheckBox); NCheckBox smoothPaletteCheckBox = new NCheckBox("Smooth Palette"); smoothPaletteCheckBox.CheckedChanged += OnSmoothPaletteCheckBoxCheckedChanged; smoothPaletteCheckBox.Checked = true; stack.Add(smoothPaletteCheckBox); return(stack); }