Exemple #1
0
        private void EhTickSpacingTypeChanged()
        {
            var selNode = _tickSpacingTypes.FirstSelectedNode; // FirstSelectedNode can be null when the content of the box changes

            if (null == selNode)
            {
                return;
            }

            var spaceType = (Type)_tickSpacingTypes.FirstSelectedNode.Tag;

            if (spaceType == _tempTickSpacing.GetType())
            {
                return;
            }

            _tempTickSpacing = (TickSpacing)Activator.CreateInstance(spaceType);
            InitTickSpacingController(true);
        }
Exemple #2
0
        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);
        }