コード例 #1
0
        public void InitializeSecondaryChoice(Altaxo.Collections.SelectableListNodeList items, LayerControllerTabType primaryChoice)
        {
            ++_suppressEventCounter;

            GuiHelper.Initialize(_lbEdges, items);

            _guiCreateNewAxis.Visibility = primaryChoice == LayerControllerTabType.Axes ? Visibility.Visible : Visibility.Collapsed;
            _guiMoveAxis.Visibility      = primaryChoice == LayerControllerTabType.Axes ? Visibility.Visible : Visibility.Collapsed;

            --_suppressEventCounter;
        }
コード例 #2
0
ファイル: GUIConversion.cs プロジェクト: olesar/Altaxo
        /// <summary>
        /// For a given enum value, this gives the list of possible choices for that enumeration (must not be a flag enumeration).
        /// </summary>
        /// <param name="value">The enum value that is currently selected.</param>
        /// <returns>List of all enumeration values. The current value is marked as (Selected is true for this list node).</returns>
        public static Altaxo.Collections.SelectableListNodeList GetListOfChoices(Enum value)
        {
            var  list     = new Altaxo.Collections.SelectableListNodeList();
            Type enumtype = value.GetType();

            foreach (Enum v in Enum.GetValues(enumtype))
            {
                string name = Current.Gui.GetUserFriendlyName(v);
                list.Add(new Altaxo.Collections.SelectableListNode(name, v, Enum.Equals(v, value)));
            }
            return(list);
        }
コード例 #3
0
ファイル: ArrangeLayersControl.cs プロジェクト: olesar/Altaxo
 public void InitializeSuperfluosLayersQuestion(Altaxo.Collections.SelectableListNodeList list)
 {
     _cbSuperfluousLayersAction.BeginUpdate();
     _cbSuperfluousLayersAction.Items.Clear();
     for (int i = 0; i < list.Count; i++)
     {
         _cbSuperfluousLayersAction.Items.Add(list[i]);
         if (list[i].Selected)
         {
             _cbSuperfluousLayersAction.SelectedIndex = i;
         }
     }
     _cbSuperfluousLayersAction.EndUpdate();
 }
コード例 #4
0
 public static void InitComboBox(System.Windows.Forms.ComboBox box, Altaxo.Collections.SelectableListNodeList names)
 {
     box.BeginUpdate();
     box.Items.Clear();
     foreach (Altaxo.Collections.SelectableListNode node in names)
     {
         box.Items.Add(node);
     }
     foreach (Altaxo.Collections.SelectableListNode node in names)
     {
         if (node.Selected)
         {
             box.SelectedItem = node;
             break;
         }
     }
     box.EndUpdate();
 }
コード例 #5
0
        protected override void Initialize(bool initData)
        {
            base.Initialize(initData);

            if (initData)
            {
                _triggerChoices = new Collections.SelectableListNodeList(_doc.ImportTriggerSource);
            }
            if (null != _view)
            {
                _view.InitializeTriggerSource(_triggerChoices);
                _view.DoNotSaveTableData       = _doc.DoNotSaveCachedTableData;
                _view.ExecuteScriptAfterImport = _doc.ExecuteTableScriptAfterImport;
                _view.MinimumWaitingTimeAfterUpdateInSeconds       = _doc.MinimumWaitingTimeAfterUpdateInSeconds;
                _view.MaximumWaitingTimeAfterUpdateInSeconds       = _doc.MaximumWaitingTimeAfterUpdateInSeconds;
                _view.MinimumWaitingTimeAfterFirstTriggerInSeconds = _doc.MinimumWaitingTimeAfterFirstTriggerInSeconds;
                _view.MaximumWaitingTimeAfterFirstTriggerInSeconds = _doc.MaximumWaitingTimeAfterFirstTriggerInSeconds;
                _view.MinimumWaitingTimeAfterLastTriggerInSeconds  = _doc.MinimumWaitingTimeAfterLastTriggerInSeconds;
            }
        }
コード例 #6
0
        /// <summary>
        /// Shows a dialog to add columns to a table.
        /// </summary>
        /// <param name="table">The table where to add the columns.</param>
        /// <param name="bAddToPropertyColumns">If true, the columns are added to the property columns instead of the data columns collection.</param>
        public static void ShowAddColumnsDialog(Altaxo.Data.DataTable table, bool bAddToPropertyColumns)
        {
            var lbitems = new Altaxo.Collections.SelectableListNodeList
            {
                new Altaxo.Collections.SelectableListNode("Numeric", typeof(Altaxo.Data.DoubleColumn), true),
                new Altaxo.Collections.SelectableListNode("Date/Time", typeof(Altaxo.Data.DateTimeColumn), false),
                new Altaxo.Collections.SelectableListNode("Text", typeof(Altaxo.Data.TextColumn), false)
            };

            var ct = new IntegerAndComboBoxController(
                "Number of colums to add:", 1, int.MaxValue, 1,
                "Type of columns to add:", lbitems, 0);

            Current.Gui.FindAndAttachControlTo(ct);

            if (true == Current.Gui.ShowDialog(ct, "Add new column(s)", false))
            {
                var columntype = (System.Type)ct.SelectedItem.Tag;

                using (var suspendToken = table.SuspendGetToken())
                {
                    if (bAddToPropertyColumns)
                    {
                        for (int i = 0; i < ct.IntegerValue; i++)
                        {
                            table.PropCols.Add((Altaxo.Data.DataColumn)System.Activator.CreateInstance(columntype));
                        }
                    }
                    else
                    {
                        for (int i = 0; i < ct.IntegerValue; i++)
                        {
                            table.DataColumns.Add((Altaxo.Data.DataColumn)System.Activator.CreateInstance(columntype));
                        }
                    }

                    suspendToken.Dispose();
                }
            }
        }
コード例 #7
0
        /// <summary>
        /// Shows a dialog to add columns to a table.
        /// </summary>
        /// <param name="table">The table where to add the columns.</param>
        /// <param name="bAddToPropertyColumns">If true, the columns are added to the property columns instead of the data columns collection.</param>
        public static void ShowAddColumnsDialog(Altaxo.Data.DataTable table, bool bAddToPropertyColumns)
        {
            Altaxo.Collections.SelectableListNodeList lbitems = new Altaxo.Collections.SelectableListNodeList();
            lbitems.Add(new Altaxo.Collections.SelectableListNode("Numeric", typeof(Altaxo.Data.DoubleColumn), true));
            lbitems.Add(new Altaxo.Collections.SelectableListNode("Date/Time", typeof(Altaxo.Data.DateTimeColumn), false));
            lbitems.Add(new Altaxo.Collections.SelectableListNode("Text", typeof(Altaxo.Data.TextColumn), false));

            IntegerAndComboBoxController ct = new IntegerAndComboBoxController(
                "Number of colums to add:", 1, int.MaxValue, 1,
                "Type of columns to add:", lbitems, 0);

            SpinAndComboBoxControl panel = new SpinAndComboBoxControl();

            ct.View = panel;

            if (true == Current.Gui.ShowDialog(ct, "Add new column(s)", false))
            {
                System.Type columntype = (System.Type)ct.SelectedItem.Item;

                table.Suspend();

                if (bAddToPropertyColumns)
                {
                    for (int i = 0; i < ct.IntegerValue; i++)
                    {
                        table.PropCols.Add((Altaxo.Data.DataColumn)System.Activator.CreateInstance(columntype));
                    }
                }
                else
                {
                    for (int i = 0; i < ct.IntegerValue; i++)
                    {
                        table.DataColumns.Add((Altaxo.Data.DataColumn)System.Activator.CreateInstance(columntype));
                    }
                }

                table.Resume();
            }
        }
コード例 #8
0
 public void SetPixelFormat(Altaxo.Collections.SelectableListNodeList list)
 {
     GuiHelper.Initialize(_cbPixelFormat, list);
 }
コード例 #9
0
ファイル: ColorProviderControl.cs プロジェクト: olesar/Altaxo
 public void InitializeAvailableClasses(Altaxo.Collections.SelectableListNodeList names)
 {
     GuiHelper.UpdateList(_cbColorProvider, names);
 }
コード例 #10
0
 public void InitializeTriggerSource(Altaxo.Collections.SelectableListNodeList list)
 {
     _guiTrigger.Initialize(list);
 }
コード例 #11
0
    /// <summary>
    /// Shows a dialog to add columns to a table.
    /// </summary>
    /// <param name="table">The table where to add the columns.</param>
    /// <param name="bAddToPropertyColumns">If true, the columns are added to the property columns instead of the data columns collection.</param>
    public static void ShowAddColumnsDialog(Altaxo.Data.DataTable table, bool bAddToPropertyColumns)
    {
      Altaxo.Collections.SelectableListNodeList lbitems = new Altaxo.Collections.SelectableListNodeList();
      lbitems.Add(new Altaxo.Collections.SelectableListNode("Numeric", typeof(Altaxo.Data.DoubleColumn), true));
      lbitems.Add(new Altaxo.Collections.SelectableListNode("Date/Time", typeof(Altaxo.Data.DateTimeColumn), false));
      lbitems.Add(new Altaxo.Collections.SelectableListNode("Text", typeof(Altaxo.Data.TextColumn), false));

      IntegerAndComboBoxController ct = new IntegerAndComboBoxController(
        "Number of colums to add:", 1, int.MaxValue, 1,
        "Type of columns to add:", lbitems, 0);

      SpinAndComboBoxControl panel = new SpinAndComboBoxControl();
      ct.View = panel;

      if (true == Current.Gui.ShowDialog(ct,"Add new column(s)",false))
      {
        System.Type columntype = (System.Type)ct.SelectedItem.Item;

        table.Suspend();

        if (bAddToPropertyColumns)
        {
          for (int i = 0; i < ct.IntegerValue; i++)
          {
            table.PropCols.Add((Altaxo.Data.DataColumn)System.Activator.CreateInstance(columntype));
          }
        }
        else
        {
          for (int i = 0; i < ct.IntegerValue; i++)
          {
            table.DataColumns.Add((Altaxo.Data.DataColumn)System.Activator.CreateInstance(columntype));
          }
        }

        table.Resume();
      }
    }
コード例 #12
0
 public void SetClipboardFormat(Altaxo.Collections.SelectableListNodeList list)
 {
     GuiHelper.UpdateList(_cbClipboardFormat, list);
 }
コード例 #13
0
 public void SetDestinationDpi(Altaxo.Collections.SelectableListNodeList list)
 {
     GuiHelper.UpdateList(_cbDestinationResolution, list);
 }
コード例 #14
0
 public void SetSourceDpi(Altaxo.Collections.SelectableListNodeList list)
 {
     GuiHelper.UpdateList(_cbSourceResolution, list);
 }
コード例 #15
0
 public void SetExportArea(Altaxo.Collections.SelectableListNodeList list)
 {
     GuiHelper.UpdateList(_cbExportArea, list);
 }
コード例 #16
0
ファイル: GUIConversion.cs プロジェクト: Altaxo/Altaxo
		/// <summary>
		/// For a given enum value, this gives the list of possible choices for that enumeration (must not be a flag enumeration).
		/// </summary>
		/// <param name="value">The enum value that is currently selected.</param>
		/// <returns>List of all enumeration values. The current value is marked as (Selected is true for this list node).</returns>
		public static Altaxo.Collections.SelectableListNodeList GetListOfChoices(Enum value)
		{
			Altaxo.Collections.SelectableListNodeList list = new Altaxo.Collections.SelectableListNodeList();
			Type enumtype = value.GetType();
			foreach (Enum v in Enum.GetValues(enumtype))
			{
				string name = Current.Gui.GetUserFriendlyName(v);
				list.Add(new Altaxo.Collections.SelectableListNode(name, v, Enum.Equals(v, value)));
			}
			return list;
		}
コード例 #17
0
ファイル: MultiChoiceControl.cs プロジェクト: olesar/Altaxo
 public void InitializeList(Altaxo.Collections.SelectableListNodeList list)
 {
     GuiHelper.UpdateList(_lvItems, list);
 }
コード例 #18
0
ファイル: WorksheetCommands.cs プロジェクト: Altaxo/Altaxo
		/// <summary>
		/// Shows a dialog to add columns to a table.
		/// </summary>
		/// <param name="table">The table where to add the columns.</param>
		/// <param name="bAddToPropertyColumns">If true, the columns are added to the property columns instead of the data columns collection.</param>
		public static void ShowAddColumnsDialog(Altaxo.Data.DataTable table, bool bAddToPropertyColumns)
		{
			var lbitems = new Altaxo.Collections.SelectableListNodeList();
			lbitems.Add(new Altaxo.Collections.SelectableListNode("Numeric", typeof(Altaxo.Data.DoubleColumn), true));
			lbitems.Add(new Altaxo.Collections.SelectableListNode("Date/Time", typeof(Altaxo.Data.DateTimeColumn), false));
			lbitems.Add(new Altaxo.Collections.SelectableListNode("Text", typeof(Altaxo.Data.TextColumn), false));

			IntegerAndComboBoxController ct = new IntegerAndComboBoxController(
				"Number of colums to add:", 1, int.MaxValue, 1,
				"Type of columns to add:", lbitems, 0);
			Current.Gui.FindAndAttachControlTo(ct);

			if (true == Current.Gui.ShowDialog(ct, "Add new column(s)", false))
			{
				System.Type columntype = (System.Type)ct.SelectedItem.Tag;

				using (var suspendToken = table.SuspendGetToken())
				{
					if (bAddToPropertyColumns)
					{
						for (int i = 0; i < ct.IntegerValue; i++)
						{
							table.PropCols.Add((Altaxo.Data.DataColumn)System.Activator.CreateInstance(columntype));
						}
					}
					else
					{
						for (int i = 0; i < ct.IntegerValue; i++)
						{
							table.DataColumns.Add((Altaxo.Data.DataColumn)System.Activator.CreateInstance(columntype));
						}
					}

					suspendToken.Dispose();
				}
			}
		}
コード例 #19
0
 public void Init_UpperInclusive(Altaxo.Collections.SelectableListNodeList list)
 {
     GuiHelper.Initialize(_guiUpperInclusive, list);
 }
コード例 #20
0
 public void SetDropFileImageFormat(Altaxo.Collections.SelectableListNodeList list)
 {
     GuiHelper.Initialize(_cbImageFormat, list);
 }
コード例 #21
0
 public void SetPixelFormat(Altaxo.Collections.SelectableListNodeList list)
 {
     GuiHelper.UpdateList(_cbPixelFormat, list);
 }
コード例 #22
0
 public void InitializeAxisType(Altaxo.Collections.SelectableListNodeList names)
 {
     GuiHelper.UpdateList(_cbScales, names);
 }