예제 #1
0
        /// <summary>
        /// A Action delegate which is restore button image as pressed situation. </summary>
        private void KeyDown()
        {
            float[]       hsb        = new float[3];
            ElementButton BtnElement = Element as ElementButton;

            if (BtnElement == null ||
                Control == null)
            {
                return;
            }

            isTouched               = true;
            Control.Color           = GetColor(BtnElement.BlendingPressedColor, 1f);
            Control.BackgroundColor = BackgroundPressedColor;
        }
        /// <summary>
        /// A Action delegate which is restore button image as pressed situation. </summary>
        private void KeyDown()
        {
            float[]       hsb          = new float[3];
            Image         imageControl = Control as Image;
            ElementButton BtnElement   = Element as ElementButton;

            if (BtnElement == null ||
                imageControl == null)
            {
                return;
            }

            Clicked                      = true;
            imageControl.Color           = GetColor(BtnElement.BlendingPressedColor, 1f);
            imageControl.BackgroundColor = BackgroundPressedColor;
        }
예제 #3
0
        public static IElement CreateElementFromDescriptor(ElementDescriptor elementDescriptor)
        {
            IElement element;

            if (elementDescriptor is ElementDescriptorChild)
            {
                element = new ElementChild();
            }
            else if (elementDescriptor is ElementDescriptorInput)
            {
                element = new ElementInput();
            }
            else if (elementDescriptor is ElementDescriptorButton)
            {
                element = new ElementButton();
            }
            else if (elementDescriptor is ElementDescriptorOutput)
            {
                element = new ElementOutput();
            }
            else if (elementDescriptor is ElementDescriptorInfo)
            {
                element = new ElementInfo();
            }
            else if (elementDescriptor is ElementDescriptorMap)
            {
                element = new ElementMap();
            }
            else if (elementDescriptor is ElementDescriptorBrowser)
            {
                element = new ElementBrowser();
            }
            else
            {
                throw new Exception("Invalid descriptor");
            }

            SetSharedAttributes(element, elementDescriptor);
            element.ElementDescriptor = elementDescriptor;

            return(element);
        }
예제 #4
0
        /// <summary>
        /// Set button image's blending color.
        /// It's right time after updating the button image source.
        /// </summary>
        //protected override void UpdateAfterLoading()
        //{
        //    base.UpdateAfterLoading();
        //    Control.Color = BlendingColor;
        //    Control.BackgroundColor = GetColor(Element.BackgroundColor, 1f);
        //}

        /// <summary>
        /// A Action delegate which is restore button image as default
        /// and execute button's Command with CommandParameter. </summary>
        private void KeyUp()
        {
            ElementButton BtnElement = Element as ElementButton;

            if (BtnElement == null)
            {
                isTouched = false;
                return;
            }

            Control.Color           = BlendingColor;
            Control.BackgroundColor = GetColor(BtnElement.BackgroundColor, 1f);

            if (isTouched)
            {
                BtnElement.Command?.Execute(BtnElement.CommandParameter);
            }

            isTouched = false;
        }
예제 #5
0
        /// <summary>
        /// 元素文本框
        /// </summary>
        public ElementTextBox()
        {
            InitializeComponent();
            //this.Multiline = true;
            this._hasMould = false;
            this._isPrint  = true;

            _mouldButton          = new ElementButton();
            _mouldButton.Name     = this.Name.Trim() + "_MouldButton";
            _mouldButton.Size     = new System.Drawing.Size(30, 20);
            _mouldButton.Text     = "...";
            _mouldButton.Location = new System.Drawing.Point(this.Location.X + this.Width, this.Location.Y);
            //_mouldButton.Tag = this.Tag;
            _mouldButton.Click += new EventHandler(MouldButton_Click);

            this.KeyUp           += new KeyEventHandler(ElementTextBox_KeyUp);
            this.SizeChanged     += new EventHandler(ElementTextBox_SizeChanged);
            this.LocationChanged += new EventHandler(ElementTextBox_LocationChanged);
            this.ParentChanged   += new EventHandler(ElementTextBox_ParentChanged);
        }
        /// <summary>
        /// A Action delegate which is restore button image as default
        /// and execute button's Command with CommandParameter. </summary>
        private void KeyUp()
        {
            ElementButton BtnElement   = Element as ElementButton;
            Image         imageControl = Control as Image;

            if (BtnElement == null)
            {
                Clicked = false;
                return;
            }

            imageControl.Color           = BlendingColor;
            imageControl.BackgroundColor = GetColor(BtnElement.BackgroundColor, 1f);

            if (Clicked)
            {
                BtnElement.Command?.Execute(BtnElement.CommandParameter);
            }

            Clicked = false;
        }
 public void ChoiseEvent (ButtonConfigType buttonConfigType, ElementButton elementButton)
 {
   
 }
 public void ChoiseEvent(ButtonConfigType buttonConfigType, ElementButton elementButton)
 {
 }