Example #1
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 #2
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;
        }