private void OnHexagonColorPickerSelectedIndexChanged(NValueChangeEventArgs arg) { NHexagonColorPicker colorPicker = (NHexagonColorPicker)arg.TargetNode; NColor selectedColor = colorPicker.SelectedColor; m_EventsLog.LogEvent(selectedColor.GetHEX().ToUpper()); }
private void OnProjectionComboSelectedIndexChanged(NValueChangeEventArgs arg) { NComboBox projectionCombo = (NComboBox)arg.TargetNode; NMapProjection projection = (NMapProjection)projectionCombo.SelectedItem.Tag; m_MapImporter.Projection = projection; // Reimport the map applying the newly selected projection if (m_MapImporter.Projection is NOrthographicProjection) { GetOwnerPairBox(m_CenterParalelNumericUpDown).Visibility = ENVisibility.Visible; GetOwnerPairBox(m_CenterMeridianNumericUpDown).Visibility = ENVisibility.Visible; NOrthographicProjection ortographicProjection = (NOrthographicProjection)m_MapImporter.Projection; ortographicProjection.CenterPoint = new NPoint(m_CenterMeridianNumericUpDown.Value, m_CenterParalelNumericUpDown.Value); } else if (m_MapImporter.Projection is NBonneProjection) { GetOwnerPairBox(m_CenterParalelNumericUpDown).Visibility = ENVisibility.Visible; GetOwnerPairBox(m_CenterMeridianNumericUpDown).Visibility = ENVisibility.Hidden; ((NBonneProjection)m_MapImporter.Projection).StandardParallel = m_CenterParalelNumericUpDown.Value; } else { GetOwnerPairBox(m_CenterParalelNumericUpDown).Visibility = ENVisibility.Hidden; GetOwnerPairBox(m_CenterMeridianNumericUpDown).Visibility = ENVisibility.Hidden; } ImportMap(); }
private void OnEnabledCheckBoxCheckedChanged(NValueChangeEventArgs args) { bool enabled = (bool)args.NewValue; m_ComboBox.Enabled = enabled; m_AdvancedComboBox.Enabled = enabled; }
private void OnHeightUpDownValueChanged(NValueChangeEventArgs arg) { if (!m_bViewModeChanging) { m_ScheduleView.Content.ActiveViewMode.Height = (double)arg.NewValue; } }
private void OnRadioGroupSelectedIndexChanged(NValueChangeEventArgs arg) { NSchedule schedule = m_ScheduleView.Content; NAppointment appointment = (NAppointment)schedule.Appointments[0]; int selectedIndex = (int)arg.NewValue; switch (selectedIndex) { case 0: appointment.RecurrenceRule = null; schedule.ViewMode = ENScheduleViewMode.Week; break; case 1: appointment.RecurrenceRule = CreateHourlyRule(); schedule.ViewMode = ENScheduleViewMode.Week; break; case 2: appointment.RecurrenceRule = CreateDailyRule(); schedule.ViewMode = ENScheduleViewMode.Week; break; case 3: appointment.RecurrenceRule = CreateWeeklyRule(); schedule.ViewMode = ENScheduleViewMode.Week; break; case 4: appointment.RecurrenceRule = CreateAbsoluteMonthlyRule(); schedule.ViewMode = ENScheduleViewMode.Month; break; case 5: appointment.RecurrenceRule = CreateRelativeMonthlyRule(); schedule.ViewMode = ENScheduleViewMode.Month; break; case 6: appointment.RecurrenceRule = CreateAbsoluteYearlyRule(); schedule.ViewMode = ENScheduleViewMode.Month; break; case 7: appointment.RecurrenceRule = CreateRelativeYearlyRule(); schedule.ViewMode = ENScheduleViewMode.Month; break; case 8: appointment.RecurrenceRule = CreateDailyRuleForOneMonth(); schedule.ViewMode = ENScheduleViewMode.Month; break; case 9: appointment.RecurrenceRule = CreateDailyRuleForFiveOccurrences(); schedule.ViewMode = ENScheduleViewMode.Month; break; } }
void OnSideThicknessComboSelectedIndexChanged(NValueChangeEventArgs args) { NComboBox combo = args.TargetNode as NComboBox; double sideThickness = combo.SelectedIndex; NMargins bt = m_BoxBorderElement.BorderThickness; if (combo == m_BorderThicknessCombo) { bt = new NMargins(sideThickness); } else if (combo == m_LeftSideThicknessCombo) { bt.Left = sideThickness; } else if (combo == m_RightSideThicknessCombo) { bt.Right = sideThickness; } else if (combo == m_TopSideThicknessCombo) { bt.Top = sideThickness; } else if (combo == m_BottomSideThicknessCombo) { bt.Bottom = sideThickness; } NCustomBorderWallWidget[] elements = GetCustomBorderElements(); for (int i = 0; i < elements.Length; i++) { elements[i].BorderThickness = bt; } }
void OnRadianAngleStepComboBoxSelectedIndexChanged(NValueChangeEventArgs arg) { NAngularScale angleScale = (NAngularScale)m_Chart.Axes[ENPolarAxis.PrimaryAngle].Scale; angleScale.MajorTickMode = ENMajorTickMode.CustomStep; switch (((NComboBox)arg.TargetNode).SelectedIndex) { case 0: angleScale.CustomStep = new NAngle(15, NUnit.Degree); break; case 1: angleScale.CustomStep = new NAngle(30, NUnit.Degree); break; case 2: angleScale.CustomStep = new NAngle(45, NUnit.Degree); break; case 3: angleScale.CustomStep = new NAngle(90, NUnit.Degree); break; default: NDebug.Assert(false); break; } }
private void OnCheckBoxCheckedChanged(NValueChangeEventArgs arg) { // Enable/Disable the tool based on the new value of the check box's Check property NTool tool = (NTool)arg.CurrentTargetNode.Tag; tool.Enabled = (bool)arg.NewValue; }
void item_CheckedChanging(NValueChangeEventArgs arg) { bool isChecked = (bool)arg.NewValue; if (isChecked) { return; } // Make sure the user is not trying to uncheck the checked item NCheckableMenuItem item = (NCheckableMenuItem)arg.TargetNode; NMenuItemCollection items = item.ParentNode as NMenuItemCollection; for (int i = 0, count = items.Count; i < count; i++) { NCheckableMenuItem currentItem = items[i] as NCheckableMenuItem; if (currentItem == null) { continue; } if (currentItem != item && currentItem.Checked) { return; } } arg.Cancel = true; }
private void OnSliderValueChanged(NValueChangeEventArgs args) { string text = args.TargetNode == m_HSlider ? "Horizontal: " : "Vertical: "; text += args.NewValue.ToString(); m_EventsLog.LogEvent(text); }
private void OnFillButtonSelectedValueChanged(NValueChangeEventArgs args) { NAutomaticValue <NFill> newValue = ((NAutomaticValue <NFill>)args.NewValue); NFill fill = newValue.Value; m_Label.TextFill = (NFill)fill.DeepClone(); }
private void OnTreeViewSelectedPathChanged(NValueChangeEventArgs arg) { m_DataTable.RemoveAllRows(); m_GridView.Grid.Update(); NTreeView treeView = (NTreeView)arg.CurrentTargetNode; NTreeViewItem selectedItem = treeView.SelectedItem; if (selectedItem == null) { return; } // Get the resource container and the images for the selected item NEmbeddedResourceContainer resourceContainer = GetResourceContainer(selectedItem); NList <string> images = GetImageNames(selectedItem); // Populate the stack with the images in the selected resources folder string containerType = resourceContainer.GetType().FullName; for (int i = 0; i < images.Count; i++) { string resourceName = images[i]; string imageName = resourceName.Replace("RIMG", "Image"); NImage image = NImage.FromResource(resourceContainer.GetResource(resourceName)); string imageSize = image.Width.ToString( CultureInfo.InvariantCulture) + " x " + image.Height.ToString(CultureInfo.InvariantCulture); string code = containerType + "." + imageName; m_DataTable.AddRow(image, imageName, imageSize, code); } }
void OnColumnsComboBoxSelectedIndexChanged(NValueChangeEventArgs arg) { NComboBoxItem item = m_ColumnsComboBox.SelectedItem; if (item == null) { m_ColumnPropertiesHolder.Content = null; return; } NColumn column = (NColumn)item.Tag; NStackPanel columnPropertiesStack = new NStackPanel(); m_ColumnPropertiesHolder.Content = new NUniSizeBoxGroup(columnPropertiesStack); NDesigner designer = NDesigner.GetDesigner(column); NList <NPropertyEditor> editors = designer.CreatePropertyEditors(column, NColumn.AllowFilterProperty, NColumn.AllowSortProperty, NColumn.AllowGroupProperty, NColumn.AllowFormatProperty, NColumn.AllowEditProperty, NColumn.AllowReorderProperty, NColumn.AllowResizeProperty); for (int i = 0; i < editors.Count; i++) { columnPropertiesStack.Add(editors[i]); } }
void OnColumnsComboBoxSelectedIndexChanged(NValueChangeEventArgs arg) { NComboBoxItem item = m_ColumnsComboBox.SelectedItem; if (item == null) { m_ColumnPropertiesHolder.Content = null; } else { NColumn column = (NColumn)item.Tag; NStackPanel columnPropertiesStack = new NStackPanel(); m_ColumnPropertiesHolder.Content = new NUniSizeBoxGroup(columnPropertiesStack); NDesigner designer = NDesigner.GetDesigner(column); NList <NPropertyEditor> editors = designer.CreatePropertyEditors(column, NColumn.WidthModeProperty, NColumn.FixedWidthProperty, NColumn.WidthPercentProperty); for (int i = 0; i < editors.Count; i++) { columnPropertiesStack.Add(editors[i]); } } }
private void OnFontStyleChanged(NValueChangeEventArgs args) { string fontFamily = (m_FontFamiliesComboBox.SelectedItem.Content as NLabel).Text; int fontSize = Int32.Parse((m_FontSizeComboBox.SelectedItem.Content as NLabel).Text); ENFontStyle fontStyle = ENFontStyle.Regular; if (m_BoldCheckBox.Checked) { fontStyle |= ENFontStyle.Bold; } if (m_ItalicCheckBox.Checked) { fontStyle |= ENFontStyle.Italic; } if (m_UnderlineCheckBox.Checked) { fontStyle |= ENFontStyle.Underline; } if (m_StrikeTroughCheckBox.Checked) { fontStyle |= ENFontStyle.Strikethrough; } m_TextBox.Font = new NFont(fontFamily, fontSize, fontStyle); }
void item_CheckedChanged(NValueChangeEventArgs arg) { bool isChecked = (bool)arg.NewValue; if (isChecked == false) { return; } NCheckableMenuItem item = (NCheckableMenuItem)arg.TargetNode; NMenuItemCollection items = item.ParentNode as NMenuItemCollection; for (int i = 0, count = items.Count; i < count; i++) { NCheckableMenuItem currentItem = items[i] as NCheckableMenuItem; if (currentItem == null) { continue; } if (currentItem != item && currentItem.Checked) { // We've found the previously checked item, so uncheck it currentItem.Checked = false; break; } } }
private void OnSelectedIndexChanged(NValueChangeEventArgs args) { NPaletteColorPicker colorPicker = (NPaletteColorPicker)args.TargetNode; NColor selectedColor = colorPicker.SelectedColor; m_EventsLog.LogEvent(selectedColor.GetHEX().ToUpper()); }
void OnShowScrollbarsWhenZoomedCheckBoxCheckedChanged(NValueChangeEventArgs arg) { bool showScrollbars = ((NCheckBox)arg.TargetNode).Checked; m_Chart.Axes[ENCartesianAxis.PrimaryX].ShowScrollbarWhenZoomed = showScrollbars; m_Chart.Axes[ENCartesianAxis.PrimaryY].ShowScrollbarWhenZoomed = showScrollbars; }
void OnEnableInitialPositioningCheckBoxCheckedChanged(NValueChangeEventArgs arg) { m_RemoveOverlappedLabelsCheckBox.Enabled = m_EnableInitialPositioningCheckBox.Checked; m_LocationsComboBox.Enabled = m_EnableInitialPositioningCheckBox.Checked; m_Chart.LabelLayout.EnableInitialPositioning = m_EnableInitialPositioningCheckBox.Checked; }
private void OnMeasureUpDownValueChanged(NValueChangeEventArgs args) { NMeasureUpDown measureUpDown = (NMeasureUpDown)args.TargetNode; double value = (double)args.NewValue; NUnit unit = measureUpDown.SelectedUnit; string unitString = unit.ToString(); if (value != 1) { // Make the unit string plural if (unit == NUnit.Inch) { unitString = "inches"; } else if (unit == NUnit.Foot) { unitString = "feet"; } else { unitString += "s"; } } // Log the event m_EventsLog.LogEvent("New value: " + value.ToString() + " " + unitString); }
void OnUpdateSections(NValueChangeEventArgs arg) { NStandardScale standardScale; // configure horizontal axis sections standardScale = (NStandardScale)m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale; standardScale.Sections.Clear(); if (m_ShowFirstXSectionCheckBox.Checked) { standardScale.Sections.Add(m_FirstHorizontalSection); } if (m_ShowSecondXSectionCheckBox.Checked) { standardScale.Sections.Add(m_SecondHorizontalSection); } // configure vertical axis sections standardScale = (NStandardScale)m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale; standardScale.Sections.Clear(); if (m_ShowFirstYSectionCheckBox.Checked) { standardScale.Sections.Add(m_FirstVerticalSection); } if (m_ShowSecondYSectionCheckBox.Checked) { standardScale.Sections.Add(m_SecondVerticalSection); } }
void OnEditStrokeChanged(NEventArgs args) { NValueChangeEventArgs localValueChangeArgs = args as NValueChangeEventArgs; if (localValueChangeArgs != null) { for (int i = 0; i < m_arrStrokes.Length; i++) { NStroke stroke = m_arrStrokes[i]; stroke.SetValue(localValueChangeArgs.Property, localValueChangeArgs.NewValue); NCanvas canvas = m_CanvasStack[i] as NCanvas; double strokeWidth = stroke.Width; if (strokeWidth < 0) { strokeWidth = 0; } canvas.PreferredSize = GetCanvasPreferredSize(strokeWidth); if (canvas != null) { canvas.InvalidateDisplay(); } } } }
void OnAxisZoneComboBoxSelectedIndexChanged(NValueChangeEventArgs arg) { if (m_RedAxisZoneComboBox.SelectedIndex == 0) { m_RedAxis.Anchor = new NDockCartesianAxisAnchor(ENCartesianAxisDockZone.Left); } else { m_RedAxis.Anchor = new NDockCartesianAxisAnchor(ENCartesianAxisDockZone.Right); } if (m_GreenAxisZoneComboBox.SelectedIndex == 0) { m_GreenAxis.Anchor = new NDockCartesianAxisAnchor(ENCartesianAxisDockZone.Left); } else { m_GreenAxis.Anchor = new NDockCartesianAxisAnchor(ENCartesianAxisDockZone.Right); } if (m_BlueAxisZoneComboBox.SelectedIndex == 0) { m_BlueAxis.Anchor = new NDockCartesianAxisAnchor(ENCartesianAxisDockZone.Left); } else { m_BlueAxis.Anchor = new NDockCartesianAxisAnchor(ENCartesianAxisDockZone.Right); } }
void OnInvertScaleCheckBoxCheckedChanged(NValueChangeEventArgs arg) { for (int i = 0; i < m_Chart.Axes.Count; i++) { m_Chart.Axes[i].Scale.Invert = ((NCheckBox)arg.TargetNode).Checked; } }
void OnStripeIncludeInAxisRangeCheckBoxCheckedChanged(NValueChangeEventArgs arg) { bool isChecked = ((NCheckBox)arg.TargetNode).Checked; m_YStripe.IncludeRangeBeginInAxisRange = isChecked; m_YStripe.IncludeRangeEndInAxisRange = isChecked; }
private void OnEnabledCheckBoxCheckedChanged(NValueChangeEventArgs arg) { bool enabled = (bool)arg.NewValue; m_TextBox.Enabled = enabled; m_AdvancedTextBox.Enabled = enabled; }
private void OnHeadersPositionComboSelectedIndexChanged(NValueChangeEventArgs args) { NComboBox combo = (NComboBox)args.TargetNode; ENTabHeadersPosition headersPosition = (ENTabHeadersPosition)args.NewValue; m_Tab.HeadersPosition = headersPosition; }
private void OnCaseSensitiveCheckBoxCheckedChanged(NValueChangeEventArgs arg) { bool autocompleteCaseSensitive = (bool)arg.NewValue; m_TextBox.CaseSensitive = autocompleteCaseSensitive; m_AdvancedTextBox.CaseSensitive = autocompleteCaseSensitive; }
private void OnNumericUpDownValueChanged(NValueChangeEventArgs args) { if (m_Table == null) { return; } double width = m_CanvasWidthUpDown.Value; double height = m_CanvasHeightUpDown.Value; // Recreate all graphics paths NGraphicsPath[] paths = CreatePaths(width, height); int index = 0; // Resize the canvases INIterator <NNode> iterator = m_Table.GetSubtreeIterator(ENTreeTraversalOrder.DepthFirstPreOrder, new NInstanceOfSchemaFilter(NCanvas.NCanvasSchema)); while (iterator.MoveNext()) { NCanvas canvas = (NCanvas)iterator.Current; ((NWidget)canvas.ParentNode).PreferredWidth = width; canvas.PreferredHeight = height; canvas.Tag = paths[index++]; } }
private void OnRadioGroupSelectedIndexChanged(NValueChangeEventArgs arg) { int selectedIndex = (int)arg.NewValue; NSchedule schedule = m_ScheduleView.Content; if (selectedIndex == 0) { // Time grouping should be first if (schedule.DayViewMode.Groupings[0] is NGroupGrouping) { SwapGroupings(schedule.DayViewMode); SwapGroupings(schedule.WeekViewMode); SwapGroupings(schedule.MonthViewMode); } } else { // Schedule group grouping should be first if (schedule.DayViewMode.Groupings[0] is NDateRangeGrouping) { SwapGroupings(schedule.DayViewMode); SwapGroupings(schedule.WeekViewMode); SwapGroupings(schedule.MonthViewMode); } } }