Example #1
0
        /// <summary>
        /// Adds new float value element.
        /// </summary>
        /// <returns>The created element.</returns>
        public FloatValueElement FloatValue()
        {
            FloatValueElement element = new FloatValueElement();

            OnAddElement(element);
            return(element);
        }
Example #2
0
        /// <inheritdoc />
        public override void Initialize(LayoutElementsContainer layout)
        {
            var grid        = layout.CustomContainer <UniformGridPanel>();
            var gridControl = grid.CustomControl;

            gridControl.ClipChildren      = false;
            gridControl.Height            = TextBox.DefaultHeight;
            gridControl.SlotsHorizontally = 2;
            gridControl.SlotsVertically   = 1;

            LimitAttribute limit      = null;
            var            attributes = Values.GetAttributes();

            if (attributes != null)
            {
                limit = (LimitAttribute)attributes.FirstOrDefault(x => x is LimitAttribute);
            }

            XElement = grid.FloatValue();
            XElement.SetLimits(limit);
            XElement.FloatValue.ValueChanged += OnValueChanged;
            XElement.FloatValue.SlidingEnd   += ClearToken;

            YElement = grid.FloatValue();
            YElement.SetLimits(limit);
            YElement.FloatValue.ValueChanged += OnValueChanged;
            YElement.FloatValue.SlidingEnd   += ClearToken;
        }
Example #3
0
        /// <inheritdoc />
        public override void Initialize(LayoutElementsContainer layout)
        {
            var grid        = layout.CustomContainer <UniformGridPanel>();
            var gridControl = grid.CustomControl;

            gridControl.Height            = TextBox.DefaultHeight;
            gridControl.SlotsHorizontally = 4;
            gridControl.SlotsVertically   = 1;

            LimitAttribute limit = null;

            if (Values.Info != null)
            {
                var attributes = Values.Info.GetCustomAttributes(true);
                limit = (LimitAttribute)attributes.FirstOrDefault(x => x is LimitAttribute);
            }

            xElement = grid.FloatValue();
            xElement.SetLimits(limit);
            xElement.FloatValue.ValueChanged += OnValueChanged;

            yElement = grid.FloatValue();
            yElement.SetLimits(limit);
            yElement.FloatValue.ValueChanged += OnValueChanged;

            zElement = grid.FloatValue();
            zElement.SetLimits(limit);
            zElement.FloatValue.ValueChanged += OnValueChanged;

            wElement = grid.FloatValue();
            wElement.SetLimits(limit);
            wElement.FloatValue.ValueChanged += OnValueChanged;
        }
Example #4
0
        /// <inheritdoc />
        public override void Initialize(LayoutElementsContainer layout)
        {
            float trackBallSize = 80.0f;
            float margin        = 4.0f;

            // Panel
            var masterPanel        = layout.CustomContainer <GridPanel>();
            var masterPanelControl = masterPanel.CustomControl;

            masterPanelControl.ClipChildren = false;
            masterPanelControl.SlotPadding  = new Margin(0, 0, margin, margin);
            masterPanelControl.Height       = trackBallSize + margin + margin;
            masterPanelControl.ColumnFill   = new[]
            {
                -trackBallSize,
                1.0f
            };
            masterPanelControl.RowFill = new[] { 1.0f };

            // Trackball
            _trackball = masterPanel.Custom <ColorSelector>();
            _trackball.CustomControl.ColorChanged += OnColorWheelChanged;
            _trackball.CustomControl.SlidingEnd   += ClearToken;

            // Scale editor
            {
                var grid        = masterPanel.CustomContainer <UniformGridPanel>();
                var gridControl = grid.CustomControl;
                gridControl.SlotPadding       = new Margin(4, 2, 2, 2);
                gridControl.ClipChildren      = false;
                gridControl.SlotsHorizontally = 1;
                gridControl.SlotsVertically   = 4;

                LimitAttribute limit      = null;
                var            attributes = Values.GetAttributes();
                if (attributes != null)
                {
                    limit = (LimitAttribute)attributes.FirstOrDefault(x => x is LimitAttribute);
                }

                _xElement = CreateFloatEditor(grid, limit, Color.Red);
                _yElement = CreateFloatEditor(grid, limit, Color.Green);
                _zElement = CreateFloatEditor(grid, limit, Color.Blue);
                _wElement = CreateFloatEditor(grid, limit, Color.White);
            }
        }
Example #5
0
        /// <inheritdoc />
        public override void Initialize(LayoutElementsContainer layout)
        {
            var grid        = layout.CustomContainer <UniformGridPanel>();
            var gridControl = grid.CustomControl;

            gridControl.Height            = TextBox.DefaultHeight;
            gridControl.SlotsHorizontally = 3;
            gridControl.SlotsVertically   = 1;

            XElement = grid.FloatValue();
            XElement.FloatValue.ValueChanged += OnValueChanged;

            YElement = grid.FloatValue();
            YElement.FloatValue.ValueChanged += OnValueChanged;

            ZElement = grid.FloatValue();
            ZElement.FloatValue.ValueChanged += OnValueChanged;
        }
        /// <inheritdoc />
        public override void Initialize(LayoutElementsContainer layout)
        {
            var grid        = layout.CustomContainer <UniformGridPanel>();
            var gridControl = grid.CustomControl;

            gridControl.ClipChildren      = false;
            gridControl.Height            = TextBox.DefaultHeight;
            gridControl.SlotsHorizontally = 3;
            gridControl.SlotsVertically   = 1;

            XElement = grid.FloatValue();
            XElement.ValueBox.ValueChanged += OnValueChanged;
            XElement.ValueBox.SlidingEnd   += ClearToken;

            YElement = grid.FloatValue();
            YElement.ValueBox.ValueChanged += OnValueChanged;
            YElement.ValueBox.SlidingEnd   += ClearToken;

            ZElement = grid.FloatValue();
            ZElement.ValueBox.ValueChanged += OnValueChanged;
            ZElement.ValueBox.SlidingEnd   += ClearToken;
        }