private void Initialize(bool initData) { if (initData) { _operatorChoices = new SelectableListNodeList(); foreach (var s in new string[] { "", "=", ">", ">=", "<", "<=", "<>" }) _operatorChoices.Add(new SelectableListNode(s, s, false)); _value = _field.Filter; } if (null != _view) { _view.SetOperatorChoices(_operatorChoices); // initialize value _view.SetValueText(_value); // initialize fields if (_value.Length > 0) { Match m = _rx1.Match(_value); if (m.Success) { SetOperatorText(m.Groups[2].Value); _view.SingleValueText = m.Groups[3].Value; } m = _rx2.Match(_value); if (m.Success) { _view.IntervalFromText = m.Groups[2].Value; _view.intervalToText = m.Groups[3].Value; } } } }
void Initialize(bool bInit) { if (_view != null) { _view.ShowLine = true; _view.LinePen = _doc.AxisPen; _view.MajorPen = _doc.MajorPen; _view.MinorPen = _doc.MinorPen; _view.MajorTickLength = _doc.MajorTickLength; _view.MinorTickLength = _doc.MinorTickLength; SelectableListNodeList list = new SelectableListNodeList(); list.Clear(); if (_doc.CachedAxisInformation != null) { list.Add(new SelectableListNode(_doc.CachedAxisInformation.NameOfFirstDownSide, null, _doc.FirstDownMajorTicks)); list.Add(new SelectableListNode(_doc.CachedAxisInformation.NameOfFirstUpSide, null, _doc.FirstUpMajorTicks)); } _view.MajorPenTicks = list; list.Clear(); if (_doc.CachedAxisInformation != null) { list.Add(new SelectableListNode(_doc.CachedAxisInformation.NameOfFirstDownSide, null, _doc.FirstDownMinorTicks)); list.Add(new SelectableListNode(_doc.CachedAxisInformation.NameOfFirstUpSide, null, _doc.FirstUpMinorTicks)); } _view.MinorPenTicks = list; } }
public void SetDateTimeFormatsToAnalyze(SelectableListNodeList availableFormats, System.Collections.ObjectModel.ObservableCollection<Boxed<SelectableListNode>> currentlySelectedItems) { _guiDateTimeFormatsForAnalysis.ItemsSource = null; _guiDateTimeFormatsForAnalysisColumn.ItemsSource = null; _guiDateTimeFormatsForAnalysisColumn.ItemsSource = availableFormats; _guiDateTimeFormatsForAnalysis.ItemsSource = currentlySelectedItems; }
public static void UpdateList(ComboBox comboBox, SelectableListNodeList items) { comboBox.SelectedIndexChanged -= EhComboBoxSelectionChanged; comboBox.BeginUpdate(); comboBox.Items.Clear(); for (int i = 0; i < items.Count; i++) { comboBox.Items.Add(items[i]); if (items[i].Selected) comboBox.SelectedIndex = i; } comboBox.EndUpdate(); comboBox.SelectedIndexChanged += EhComboBoxSelectionChanged; }
public void Initialize(SelectableListNodeList choices) { _choices = choices; Children.Clear(); foreach (var choice in _choices) { var rb = new RadioButton(); rb.Content = choice.Text; rb.Tag = choice; rb.IsChecked = choice.IsSelected; rb.Checked += EhRadioButtonChecked; rb.Margin = new Thickness(4, 4, 0, 0); Children.Add(rb); } }
// copy QueryBuilder values to form public void UpdateDialogValues(bool isDistinct, int topN, SelectableListNodeList groupBy) { _chkDistinct.IsChecked = isDistinct; _numTopN.Value = topN; if (null != groupBy.FirstSelectedNode) { _cmbGroupBy.IsEnabled = true; GuiHelper.Initialize(_cmbGroupBy, groupBy); } else { _cmbGroupBy.IsEnabled = false; _cmbGroupBy.ItemsSource = null; } }
private void Initialize(bool initData) { if (initData) { _groupByChoices = new SelectableListNodeList(); _groupByChoices.FillWithEnumeration(_builder.GroupByExtension); } if (null != _view) { _groupByChoices.ClearSelectionsAll(); if (_builder.GroupBy) { _groupByChoices[(int)_builder.GroupByExtension].IsSelected = true; } _view.UpdateDialogValues(_builder.Distinct, _builder.Top, _groupByChoices); } }
public IntegerAndComboBoxController(string integerLabel, int intMin, int intMax, int intVal, string comboBoxLabel, SelectableListNodeList items, int defaultItem) { m_IntegerLabelText = integerLabel; m_IntegerMinimum = intMin; m_IntegerMaximum = intMax; m_IntegerValue = intVal; m_ComboBoxLabelText = comboBoxLabel; m_ComboBoxItems = items; m_SelectedItem = items[defaultItem]; SetElements(true); }
private void Initialize(bool initData) { if (initData) { _printLocationList = new SelectableListNodeList(_doc.PrintLocation); } if (null != _view) { _view.Init_PrintLocation(_printLocationList); _view.Init_FitGraphToPrintIfLarger(_doc.FitGraphToPrintIfLarger); _view.Init_FitGraphToPrintIfSmaller(_doc.FitGraphToPrintIfSmaller); _view.Init_PrintCopMarks(_doc.PrintCropMarks); _view.Init_RotatePageAutomatically(_doc.RotatePageAutomatically); _view.Init_TilePages(_doc.TilePages); _view.Init_UseFixedZoomFactor(_doc.UseFixedZoomFactor); _view.Init_ZoomFactor(_doc.ZoomFactor); } }
public void Initialize(SelectableListNodeList choices) { this.SelectionChanged -= EhSelectionChanged; // prevent firing event here _choices = choices; this.Items.Clear(); foreach (var choice in _choices) { var item = new ListViewItem(); item.Content = choice.Text; item.Tag = choice; Items.Add(item); } int selIndex = _choices.FirstSelectedNodeIndex; if (selIndex >= 0) this.SelectedIndex = selIndex; this.SelectionChanged += EhSelectionChanged; // now allow event again }
private void Initialize(bool initData) { if (initData) { _list = new SelectableListNodeList(); var values = System.Enum.GetValues(_doc.GetType()); foreach (var val in values) { var node = new SelectableListNode(System.Enum.GetName(_doc.GetType(), val), val, IsChecked(val, _tempDoc)); node.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(EhNode_PropertyChanged); _list.Add(node); } } if (_view != null) { _view.Initialize(_list); } }
public void Initialize(SelectableListNodeList choices) { _choices = choices; Children.Clear(); foreach (var choice in _choices) { var rb = new RadioButton(); rb.Content = choice.Text; rb.Tag = choice; rb.IsChecked = choice.IsSelected; rb.Checked += EhRadioButtonChecked; if (this.Orientation == System.Windows.Controls.Orientation.Horizontal) rb.Margin = new Thickness(3, 0, 3, 0); else rb.Margin = new Thickness(0, 3, 0, 3); Children.Add(rb); } }
public void InitRowSelections(List<RSEntry> rowSelections, SelectableListNodeList rowSelectionSimpleTypes, SelectableListNodeList rowSelectionCollectionTypes) { _rowSelections = rowSelections; _guiStackPanel.Children.Clear(); for (int i = 0; i < _rowSelections.Count; ++i) { var rsItem = _rowSelections[i]; var rsGuiItem = rsItem.GuiItem as RowSelectionItemControl; if (null == rsGuiItem) { var selTypes = new SelectableListNodeList(); if (rsItem.RowSelection is IRowSelectionCollection) { foreach (var item in rowSelectionCollectionTypes) { selTypes.Add(new SelectableListNode(item.Text, item.Tag, rsItem.RowSelection.GetType() == (Type)item.Tag)); } } else // simple type { foreach (var item in rowSelectionSimpleTypes) { selTypes.Add(new SelectableListNode(item.Text, item.Tag, rsItem.RowSelection.GetType() == (Type)item.Tag)); } } rsGuiItem = new RowSelectionItemControl(selTypes, rsItem.DetailsController?.ViewObject); } rsGuiItem.Tag = i; rsGuiItem.IndentationLevel = rsItem.IndentationLevel; rsGuiItem.RowSelectionDetailControl = rsItem.DetailsController?.ViewObject; rsItem.GuiItem = rsGuiItem; _guiStackPanel.Children.Add(rsGuiItem); } }
public void InitClassTypes(bool bInit) { if (bInit) { _availableClasses = new SelectableListNodeList(); Type[] classes = Altaxo.Main.Services.ReflectionService.GetNonAbstractSubclassesOf(typeof(IColorProvider)); for (int i = 0; i < classes.Length; i++) { if (classes[i] == typeof(LinkedScale)) { continue; } var node = new SelectableListNode(Current.Gui.GetUserFriendlyClassName(classes[i]), classes[i], _doc.GetType() == classes[i]); _availableClasses.Add(node); } } if (null != _view) { _view.InitializeAvailableClasses(_availableClasses); } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _sourceDpi = GetResolutions(_doc.SourceDpiResolution); } if (null != _view) { _view.SetSourceDpi(_sourceDpi); _view.OutputScaling = _doc.OutputScalingFactor; _view.BackgroundColor = _doc.BackgroundColorForFormatsWithoutAlphaChannel; _view.BackgroundBrush = null == _doc.BackgroundBrush ? new BrushX(NamedColors.Transparent) : _doc.BackgroundBrush; _view.RenderEnhancedMetafile = _doc.RenderEnhancedMetafile; _view.RenderEnhancedMetafileAsVectorFormat = _doc.RenderEnhancedMetafileAsVectorFormat; _view.RenderWindowsMetafile = _doc.RenderWindowsMetafile; _view.RenderBitmap = _doc.RenderBitmap; } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _tempTickSpacing = (TickSpacing)_doc.TickSpacing.Clone(); // Tick spacing types _tickSpacingTypes = new SelectableListNodeList(); Type[] classes = Altaxo.Main.Services.ReflectionService.GetNonAbstractSubclassesOf(typeof(TickSpacing)); for (int i = 0; i < classes.Length; i++) { var node = new SelectableListNode(Current.Gui.GetUserFriendlyClassName(classes[i]), classes[i], _tempTickSpacing.GetType() == classes[i]); _tickSpacingTypes.Add(node); } _axisStyleControllerGlue = new AxisStyleControllerGlue(_doc.AxisStyle); } if (null != _view) { _view.DocPosition = _doc.Position; _view.ScaleNumber = _doc.ScaleNumber; _view.ScaleSpanType = _doc.ScaleSpanType; _view.ScaleSpanValue = _doc.ScaleSpanValue; _view.ScaleSegmentType = _doc.ScaleType; _view.InitializeTickSpacingTypes(_tickSpacingTypes); _view.TitleFormatView = _axisStyleControllerGlue.AxisStyleView; _view.MajorLabelView = _axisStyleControllerGlue.MajorLabelCondView; _view.MinorLabelView = _axisStyleControllerGlue.MinorLabelCondView; _view.BackgroundPadding = _doc.BackgroundPadding; _view.SelectedBackground = _doc.Background; } InitTickSpacingController(initData); }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { if (null == _availableTables) { _availableTables = new SelectableListNodeList(); } foreach (var table in Current.Project.DataTableCollection) { _availableTables.Add(new SelectableListNode(table.Name, table, object.ReferenceEquals(table, _doc.Document))); } } if (null != _view) { _view.InitializeTables(_availableTables); } }
private void Initialize(bool initData) { if (initData) { _viewList = new List <SelectableListNodeList>(); foreach (var srcGroup in _doc) { var destGroup = new SelectableListNodeList(); _viewList.Add(destGroup); foreach (var srcEle in srcGroup) { var destEle = new SelectableListNode(AbsoluteDocumentPath.GetAbsolutePath(srcEle).ToString(), srcEle, false); destGroup.Add(destEle); } } } if (null != _view) { _view.InitializeListData(_viewList); } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { var shapes = new List <Tuple <string, Type> >(Altaxo.Main.Services.ReflectionService.GetNonAbstractSubclassesOf(typeof(IScatterSymbol)).Select(t => new Tuple <string, Type>(t.Name, t))); var frames = new List <Tuple <string, Type> >(Altaxo.Main.Services.ReflectionService.GetNonAbstractSubclassesOf(typeof(IScatterSymbolFrame)).Select(t => new Tuple <string, Type>(t.Name, t))); var insets = new List <Tuple <string, Type> >(Altaxo.Main.Services.ReflectionService.GetNonAbstractSubclassesOf(typeof(IScatterSymbolInset)).Select(t => new Tuple <string, Type>(t.Name, t))); shapes.Sort((x, y) => string.Compare(x.Item1, y.Item1)); frames.Sort((x, y) => string.Compare(x.Item1, y.Item1)); insets.Sort((x, y) => string.Compare(x.Item1, y.Item1)); _shapes = new SelectableListNodeList(shapes.Select(tuple => new SelectableListNode(tuple.Item1, tuple.Item2, _doc.GetType() == tuple.Item2))); _frames = new SelectableListNodeList(frames.Select(tuple => new SelectableListNode(tuple.Item1, tuple.Item2, _doc.Frame?.GetType() == tuple.Item2))); _frames.Insert(0, new SelectableListNode("None", null, _doc.Frame == null)); _insets = new SelectableListNodeList(insets.Select(tuple => new SelectableListNode(tuple.Item1, tuple.Item2, _doc.Inset?.GetType() == tuple.Item2))); _insets.Insert(0, new SelectableListNode("None", null, _doc.Inset == null)); } if (null != _view) { _view.ShapeChoices = _shapes; _view.FrameChoices = _frames; _view.InsetChoices = _insets; _view.RelativeStructureWidth = _doc.RelativeStructureWidth; _view.PlotColorInfluence = _doc.PlotColorInfluence; _view.FillColor = _doc.FillColor; _view.FrameColor = _doc.Frame?.Color ?? NamedColors.Transparent; _view.InsetColor = _doc.Inset?.Color ?? NamedColors.Transparent; _view.ScatterSymbolForPreview = _doc; } }
private SelectableListNodeList GetFourierWindowChoice(Altaxo.Calc.Fourier.Windows.IWindows2D currentWindowChoice) { var result = new SelectableListNodeList(); var types = Altaxo.Main.Services.ReflectionService.GetNonAbstractSubclassesOf(typeof(Altaxo.Calc.Fourier.Windows.IWindows2D)); result.Add(new SelectableListNode("None", null, currentWindowChoice == null)); var currentType = null != currentWindowChoice?currentWindowChoice.GetType() : null; foreach (var type in types) { try { var o = Activator.CreateInstance(type); result.Add(new SelectableListNode(Current.Gui.GetUserFriendlyClassName(type), o, type == currentType)); } catch (Exception) { } } return(result); }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _listOfUniqueItem = new SelectableListNodeList { new SelectableListNode("Common", null, true) }; } if (null != _view) { // add all necessary Tabs _view.AddTab("GraphicItems", "GraphicItems"); _view.AddTab("Position", "Position"); _view.AddTab("HostGrid", "HostGrid"); // Set the controller of the current visible Tab SetCurrentTabController(true); } }
private SelectableListNodeList GetResolutions(double actualResolution) { var resolutions = new SortedList <double, object>(); foreach (int res in Resolutions) { resolutions.Add(res, null); } if (!resolutions.ContainsKey(actualResolution)) { resolutions.Add(actualResolution, null); } var result = new SelectableListNodeList(); foreach (double res in resolutions.Keys) { result.Add(new SelectableListNode(GUIConversion.ToString(res), res, res == actualResolution)); } return(result); }
public static void Initialize(ListView view, SelectableListNodeList data) { view.ItemsSource = null; view.ItemsSource = data; if (view.SelectionMode == SelectionMode.Single) { view.SelectedIndex = data.FirstSelectedNodeIndex; } else { if (data != null) { foreach (var n in data) { if (n.IsSelected) { view.SelectedItems.Add(n); } } } } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _orgRescalingChoices = LinearScaleRescaleConditionsController.CreateListNodeList(_doc.OrgRescaling); _endRescalingChoices = LinearScaleRescaleConditionsController.CreateListNodeList(_doc.EndRescaling); _orgRelativeToChoices = new SelectableListNodeList(_doc.OrgRelativeTo); _endRelativeToChoices = new SelectableListNodeList(_doc.EndRelativeTo); } if (null != _view) { _view.OrgRescaling = _orgRescalingChoices; _view.EndRescaling = _endRescalingChoices; _view.OrgRelativeTo = _orgRelativeToChoices; _view.EndRelativeTo = _endRelativeToChoices; _view.OrgValue = GetOrgValueToShow(); _view.EndValue = GetEndValueToShow(); } }
private void SetCoordinateSystemDependentObjects(CSLineID id) { // Scales _axisScaleController = new ScaleWithTicksController[_doc.Scales.Count]; _listOfScales = new SelectableListNodeList(); if (_doc.Scales.Count > 0) { _listOfScales.Add(new SelectableListNode("X-Scale", 0, false)); } if (_doc.Scales.Count > 1) { _listOfScales.Add(new SelectableListNode("Y-Scale", 1, false)); } if (_doc.Scales.Count > 2) { _listOfScales.Add(new SelectableListNode("Z-Scale", 2, false)); } // collect the AxisStyleIdentifier from the actual layer and also all possible AxisStyleIdentifier _axisControl = new Dictionary <CSLineID, AxisStyleControllerConditionalGlue>(); _listOfAxes = new SelectableListNodeList(); foreach (CSLineID ids in _doc.CoordinateSystem.GetJoinedAxisStyleIdentifier(_doc.AxisStyles.AxisStyleIDs, new CSLineID[] { id })) { CSAxisInformation info = _doc.CoordinateSystem.GetAxisStyleInformation(ids); var axisInfo = new AxisStyleControllerConditionalGlue(info, _doc.AxisStyles); _axisControl.Add(info.Identifier, axisInfo); _listOfAxes.Add(new SelectableListNode(info.NameOfAxisStyle, info.Identifier, false)); } // Planes _listOfPlanes = new SelectableListNodeList(); _currentPlaneID = CSPlaneID.Front; _listOfPlanes.Add(new SelectableListNode("Front", _currentPlaneID, true)); _GridStyleController = new Dictionary <CSPlaneID, IMVCANController>(); }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { bool hasMatched; bool select; _imageFormat = new SelectableListNodeList(); foreach (ImageFormat item in ImageFormats) { _imageFormat.Add(new SelectableListNode(item.ToString(), item, _doc.ImageFormat == item)); } _pixelFormat = new SelectableListNodeList(); hasMatched = false; // special prog to account for doubling of items in PixelFormats foreach (PixelFormat item in PixelFormats) { select = _doc.PixelFormat == item; _pixelFormat.Add(new SelectableListNode(item.ToString(), item, !hasMatched && select)); hasMatched |= select; } _sourceDpi = GetResolutions(_doc.SourceDpiResolution); _destinationDpi = GetResolutions(_doc.DestinationDpiResolution); } if (null != _view) { _view.SetImageFormat(_imageFormat); _view.SetPixelFormat(_pixelFormat); _view.SetSourceDpi(_sourceDpi); _view.SetDestinationDpi(_destinationDpi); _view.BackgroundBrush = null == _doc.BackgroundBrush ? new BrushX(NamedColors.Transparent) : _doc.BackgroundBrush; } }
private void Initialize(bool initData) { if (initData) { _operatorChoices = new SelectableListNodeList(); foreach (var s in new string[] { "", "=", ">", ">=", "<", "<=", "<>" }) { _operatorChoices.Add(new SelectableListNode(s, s, false)); } _value = _field.Filter; } if (null != _view) { _view.SetOperatorChoices(_operatorChoices); // initialize value _view.SetValueText(_value); // initialize fields if (_value.Length > 0) { Match m = _rx1.Match(_value); if (m.Success) { SetOperatorText(m.Groups[2].Value); _view.SingleValueText = m.Groups[3].Value; } m = _rx2.Match(_value); if (m.Success) { _view.IntervalFromText = m.Groups[2].Value; _view.intervalToText = m.Groups[3].Value; } } } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _baseController = new MultiLineLabelFormattingBaseController() { UseDocumentCopy = UseDocument.Directly }; _baseController.InitializeDocument(_doc); _timeConversionChoices = new SelectableListNodeList(_doc.LabelTimeConversion); } if (null != _view) { _baseController.ViewObject = _view.MultiLineLabelFormattingBaseView; _view.InitializeTimeConversion(_timeConversionChoices); _view.FormattingString = _doc.FormattingString; _view.ShowAlternateFormattingOnMidnight = _doc.ShowAlternateFormattingAtMidnight; _view.ShowAlternateFormattingOnNoon = _doc.ShowAlternateFormattingAtNoon; _view.FormattingStringAlternate = _doc.FormattingStringAlternate; } }
private void Initialize(bool initData) { if (initData) { _xCommonColumns = new SelectableListNodeList(); _yCommonColumns = new SelectableListNodeList(); var names = _doc.GetCommonColumnNamesOrderedByAppearanceInFirstTable(); bool isFirst = true; foreach (var name in names) { _xCommonColumns.Add(new SelectableListNode(name, name, name == _doc.XCommonColumnNameForPlot || (isFirst && null == _doc.XCommonColumnNameForPlot))); _yCommonColumns.Add(new SelectableListNode(name, name, false)); isFirst = false; } } if (null != _view) { _view.InitializeXCommonColumns(_xCommonColumns); _view.InitializeYCommonColumns(_yCommonColumns); _view.UseCurrentXColumn = _doc.XCommonColumnNameForPlot == null; } }
public void ChangeRowSelection(int idx, SelectableListNodeList rowSelectionTypes) { var rsItem = _rowSelections[idx]; var rsGuiItem = rsItem.GuiItem as RowSelectionItemControl; if (null == rsGuiItem) { var selTypes = new SelectableListNodeList(); foreach (var item in rowSelectionTypes) { selTypes.Add(new SelectableListNode(item.Text, item.Tag, rsItem.RowSelection.GetType() == (Type)item.Tag)); } rsGuiItem = new RowSelectionItemControl(selTypes, rsItem.DetailsController?.ViewObject); } rsGuiItem.Tag = idx; rsGuiItem.IndentationLevel = rsItem.IndentationLevel; rsGuiItem.RowSelectionDetailControl = rsItem.DetailsController?.ViewObject; rsItem.GuiItem = rsGuiItem; _guiStackPanel.Children.RemoveAt(idx); _guiStackPanel.Children.Insert(idx, rsGuiItem); }
/// <summary>Searches for common substrings in the selected table names. The character entity here is not a character from a string, but a name part, as created by <see cref="SplitNameIntoParts"/>.</summary> private void UpdateListOfCommonSubstringsSubfolderWise() { var words = new List <string[]>(); foreach (var tableName in _listOfSelectedTableNames) { var parts = SplitNameIntoParts(tableName); words.Add(parts); } var gsa = Altaxo.Collections.Text.GeneralizedSuffixArray.FromSeparateWords(words, true); var lcs = new Altaxo.Collections.Text.LongestCommonSubstringA(gsa) { StoreVerboseResults = true }; lcs.Evaluate(); if (lcs.MaximumNumberOfWordsWithCommonSubstring == _listOfSelectedTableNames.Count) { _commonSubstringsList = new SelectableListNodeList(); foreach (var pos in lcs.GetSubstringPositionsCommonToTheNumberOfWords(_listOfSelectedTableNames.Count)) { var first = pos.FirstPosition; var commonString = JoinPartsToName(words[first.WordIndex], first.Start, first.Count); var poss = new List <Altaxo.Collections.Text.SubstringPosition>(); foreach (var entry in pos) // we have to convert our positions which ar subfolderWise into character-wise positions { var word = words[entry.WordIndex]; var toStart = JoinPartsToName(word, 0, entry.Start); poss.Add(new Collections.Text.SubstringPosition(entry.WordIndex, toStart.Length, commonString.Length)); } _commonSubstringsList.Add(new SelectableListNode(commonString, poss, false)); } _commonSubstringsList[0].IsSelected = true; } }
public void Initialize(SelectableListNodeList choices) { SelectionChanged -= EhSelectionChanged; // prevent firing event here _choices = choices; Items.Clear(); foreach (var choice in _choices) { var item = new ListViewItem { Content = choice.Text, Tag = choice }; Items.Add(item); } int selIndex = _choices.FirstSelectedNodeIndex; if (selIndex >= 0) { SelectedIndex = selIndex; } SelectionChanged += EhSelectionChanged; // now allow event again }
private void GetAvailablePrefixes(IUnit unit, SelectableListNodeList result) { result.Clear(); HashSet <SIPrefix> previouslySelectedPrefixes = null; if (_prefixesForUnit.TryGetValue(unit, out var list)) { previouslySelectedPrefixes = new HashSet <SIPrefix>(list); } foreach (var prefix in unit.Prefixes) { bool isSelected = null != previouslySelectedPrefixes?previouslySelectedPrefixes.Contains(prefix) : string.IsNullOrEmpty(prefix.Name); string name = prefix.Name; if (string.IsNullOrEmpty(prefix.Name)) { name = "<< without prefix >>"; } result.Add(new SelectableListNode(name, prefix, isSelected)); } }
/// <summary> /// This fills the "Extend file name by column" combobox with appropriate column names. /// </summary> /// <remarks>The columns shown are either table columns (if a spectrum is a single row), or /// a property column (if a spectrum is a single column).</remarks> public void FillExtFileNameColumnBox() { Altaxo.Data.DataColumnCollection colcol; if (m_CreateSpectrumFrom == CreateSpectrumFrom.Row) { colcol = m_Table.DataColumns; } else { colcol = m_Table.PropCols; } // Fill the Combo Box with Column names var colnames = new SelectableListNodeList(); for (int i = 0; i < colcol.ColumnCount; i++) { colnames.Add(new SelectableListNode(colcol.GetColumnName(i), colcol[i], i == 0)); } // now set the contents of the combo box _view.FillExtFileNameColumnBox(colnames); _view.EnableExtFileNameColumnBox = true; }
public void CurrentItemList_Initialize(SelectableListNodeList items) { _guiSL.CurrentItemList_Initialize(items); }
public void ComboBox_Initialize(SelectableListNodeList items, SelectableListNode defaultItem) { m_ComboBox.Items.Clear(); m_ComboBox.Items.AddRange(items.ToArray()); m_ComboBox.SelectedItem = defaultItem; }
public void Initialize_MeaningOfValues(SelectableListNodeList list) { _guiMeaningOfValues.Initialize(list); }
public void InitializeClassList(SelectableListNodeList list) { GuiHelper.UpdateList(_cbInterpolationClass, list); }
public void InitializeLineConnect(SelectableListNodeList list) { GuiHelper.Initialize(_guiLineConnect, list); }
public void InitializeLinkTargets(SelectableListNodeList names) { GuiHelper.UpdateList(this._cbLinkTarget, names); }
public void InitializeColumnsToAverage(SelectableListNodeList list) { _guiColumnsToAverage.Initialize(list); }
public override void Dispose(bool isDisposing) { _textBlockAlignmentChoices = null; base.Dispose(isDisposing); }
public void Initialize(Enum value) { _choices = new SelectableListNodeList(value); _listView.ItemsSource = _choices; }
public void Initialize(SelectableListNodeList choices) { _choices = choices; _listView.ItemsSource = _choices; }
public void InitializeParticipatingColumns(SelectableListNodeList items) { GuiHelper.Initialize(_guiColumnsParticipating, items); }
public void InitializeSymbolStyle(SelectableListNodeList list) { }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { // available Update modes _availableUpdateModes = new SelectableListNodeList(); foreach (object obj in Enum.GetValues(typeof(PlotGroupStrictness))) { _availableUpdateModes.Add(new SelectableListNode(obj.ToString(), obj, ((PlotGroupStrictness)obj) == PlotGroupStrictness.Normal)); } Type[] types; // Transfo-Styles _currentTransfoStyle = _doc.CoordinateTransformingStyle == null ? null : (ICoordinateTransformingGroupStyle)_doc.CoordinateTransformingStyle.Clone(); _availableTransfoStyles = new SelectableListNodeList { new SelectableListNode("None", null, null == _currentTransfoStyle) }; types = ReflectionService.GetNonAbstractSubclassesOf(typeof(ICoordinateTransformingGroupStyle)); foreach (Type t in types) { Type currentStyleType = _currentTransfoStyle == null ? null : _currentTransfoStyle.GetType(); ICoordinateTransformingGroupStyle style; if (t == currentStyleType) { style = _currentTransfoStyle; } else { style = (ICoordinateTransformingGroupStyle)Activator.CreateInstance(t); } _availableTransfoStyles.Add(new SelectableListNode(Current.Gui.GetUserFriendlyClassName(t), style, t == currentStyleType)); } // Normal Styles _availableNormalStyles = new SelectableListNodeList(); if (_parent != null) // if possible, collect only those styles that are applicable { var avstyles = new PlotGroupStyleCollection(); _parent.CollectStyles(avstyles); foreach (IPlotGroupStyle style in avstyles) { if (!_doc.ContainsType(style.GetType())) { _availableNormalStyles.Add(new SelectableListNode(Current.Gui.GetUserFriendlyClassName(style.GetType()), style.GetType(), false)); } } } else // or else, find all available styles { types = ReflectionService.GetNonAbstractSubclassesOf(typeof(IPlotGroupStyle)); foreach (Type t in types) { if (!_doc.ContainsType(t)) { _availableNormalStyles.Add(new SelectableListNode(Current.Gui.GetUserFriendlyClassName(t), t, false)); } } } var list = _doc.GetOrderedListOfItems(ComparePlotGroupStyles); _currentNormalStyles = new CheckableSelectableListNodeList(); _currentNoOfItemsThatCanHaveChilds = 0; foreach (var item in list) { if (item.CanCarryOver) { ++_currentNoOfItemsThatCanHaveChilds; } var node = new MyListNode(Current.Gui.GetUserFriendlyClassName(item.GetType()), item.GetType(), false, item.IsStepEnabled, item.CanStep); _currentNormalStyles.Add(node); } UpdateCurrentNormalIndentation(); } if (_view != null) { _view.InitializeAvailableCoordinateTransformingGroupStyles(_availableTransfoStyles); _view.InitializeAvailableNormalGroupStyles(_availableNormalStyles); _view.InitializeCurrentNormalGroupStyles(_currentNormalStyles); _view.InitializeUpdateMode(_availableUpdateModes, _doc.InheritFromParentGroups, _doc.DistributeToChildGroups); } }
public void InitializeAxisType(SelectableListNodeList names) { GuiHelper.UpdateList(this.m_Scale_cbType, names); }
public void SetTabItemsSource(SelectableListNodeList tabItems) { GuiHelper.Initialize(_tab, tabItems); }
public override void Dispose(bool isDisposing) { _scaleTypes = null; base.Dispose(isDisposing); }
public void InitializeTickSpacingType(SelectableListNodeList names) { GuiHelper.UpdateList(_cbTickSpacingType, names); }
public void InitializeCyclingVariableColumn(SelectableListNodeList list) { GuiHelper.Initialize(_guiColumnWithCyclingVariable, list); }
public void InitializeAvailableTables(SelectableListNodeList items) { GuiHelper.Initialize(_guiAvailableTables, items); }
public void InitializeSymbolShape(SelectableListNodeList list) { _cbSymbolShape.SelectedItem = list.FirstSelectedNode?.Tag as IScatterSymbol; }
public static void UpdateList(ListBox listView, SelectableListNodeList items) { listView.SelectedIndexChanged -= EhListBoxSelectedIndexChanged; listView.BeginUpdate(); listView.Items.Clear(); for (int i = 0; i < items.Count; i++) { listView.Items.Add(items[i]); if (items[i].Selected) listView.SelectedIndex = i; } listView.EndUpdate(); listView.SelectedIndexChanged += EhListBoxSelectedIndexChanged; }
public void SetConnectionListSource(SelectableListNodeList list, string currentItem) { GuiHelper.Initialize(_cmbConnString, list); _cmbConnString.Text = currentItem; }
public static void UpdateList( ListView listView, SelectableListNodeList items) { listView.BeginUpdate(); if (listView.Items.Count > items.Count) { // delete some items for (int i = listView.Items.Count - 1; i >= items.Count; --i) listView.Items.RemoveAt(i); } // Update all listitems now for (int i = 0; i < items.Count; i++) { ListViewItem litem; if (listView.Items.Count <= i) { litem = new ListViewItem(string.Empty); for(int j=0;j<items[i].SubItemCount;j++) litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, string.Empty)); listView.Items.Add(litem); } else { litem = listView.Items[i]; } litem.Text = items[i].Name; litem.ToolTipText = items[i].Description; litem.ImageIndex = items[i].ImageIndex; for (int j = 0; j < items[i].SubItemCount; j++) { litem.SubItems[j + 1].Text = items[i].SubItemText(j); System.Drawing.Color? col = items[i].SubItemBackColor(j); if (col == null) { litem.SubItems[j + 1].BackColor = litem.BackColor; } else { litem.UseItemStyleForSubItems = false; litem.SubItems[j + 1].BackColor = (System.Drawing.Color)col; } } litem.Tag = items[i]; litem.Selected = items[i].Selected; } listView.EndUpdate(); }