wjc
2023-08-21 e4ab7ba15864d2adb882646d8e09bd00effa4d1b
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
@@ -6,24 +6,22 @@
{
    public class MenuFramLayout : BaseFramLayout
    {
        private uint UpBackgroundColor = 0x00000000;
        private uint DownBackgroundColor = 0xff454635;
        public const int widthFrameLayout = 180;
        public const int heightFrameLayout = 180;
        public const int cornerValue = 90;
        public MenuFramLayout(int width = widthFrameLayout, int height = heightFrameLayout)
        {
            this.Width = Application.GetMinRealAverage(width);
            this.Height = Application.GetMinRealAverage(height);
            this.Width = Application.GetRealWidth(width);
            this.Height = Application.GetRealWidth(height);
            this.Radius = (uint)Application.GetRealHeight(cornerValue);
            this.BackgroundColor = MusicColor.ViewColor;
            this.Gravity = Gravity.CenterHorizontal;
        }
        Button btnTop = new Button
        {
            Y = Application.GetMinRealAverage(16),
            X = Application.GetMinRealAverage(78),
            Y = Application.GetRealWidth(16),
            X = Application.GetRealWidth(78),
            Width = Application.GetRealWidth(24),
            Height = Application.GetRealHeight(20),
            UnSelectedImagePath = "AksIcon/shang.png",
@@ -32,8 +30,8 @@
        };
        Button btnBottom = new Button
        {
            Y = Application.GetMinRealAverage(144),
            X = Application.GetMinRealAverage(78),
            Y = Application.GetRealWidth(144),
            X = Application.GetRealWidth(78),
            Width = Application.GetRealWidth(24),
            Height = Application.GetRealHeight(20),
            UnSelectedImagePath = "AksIcon/xia.png",
@@ -42,8 +40,8 @@
        };
        Button btnLeft = new Button
        {
            Y = Application.GetMinRealAverage(78),
            X = Application.GetMinRealAverage(16),
            Y = Application.GetRealWidth(78),
            X = Application.GetRealWidth(16),
            Width = Application.GetRealWidth(20),
            Height = Application.GetRealHeight(24),
            UnSelectedImagePath = "AksIcon/zuo.png",
@@ -53,8 +51,8 @@
        };
        Button btnRight = new Button
        {
            Y = Application.GetMinRealAverage(78),
            X = Application.GetMinRealAverage(144),
            Y = Application.GetRealWidth(78),
            X = Application.GetRealWidth(144),
            Width = Application.GetRealWidth(20),
            Height = Application.GetRealHeight(24),
            UnSelectedImagePath = "AksIcon/you.png",
@@ -65,10 +63,9 @@
        Button btnOkbj = new Button
        {
            Y = Application.GetMinRealAverage(52),
            X = Application.GetMinRealAverage(52),
            Width = Application.GetMinRealAverage(76),
            Height = Application.GetMinRealAverage(76),
            Gravity=Gravity.Center,
            Width = Application.GetRealWidth(76),
            Height = Application.GetRealWidth(76),
            Radius = (uint)Application.GetRealHeight(38),
            BackgroundColor = MusicColor.WhiteColor,
@@ -76,12 +73,12 @@
        };
        Button btnOk = new Button
        {
            Y = Application.GetMinRealAverage(76),
            X = Application.GetMinRealAverage(76),
            Width = Application.GetMinRealAverage(28),
            Height = Application.GetMinRealAverage(28),
            Gravity = Gravity.Center,
            Width = Application.GetRealWidth(28),
            Height = Application.GetRealWidth(28),
            Radius = (uint)Application.GetRealHeight(14),
            BackgroundColor = MusicColor.SelectedColor,
            BackgroundColor = 0xff1B2D4D,
            SelectedBackgroundColor = MusicColor.SelectedColor,
            Name= "确定"
        };
@@ -94,6 +91,7 @@
            this.AddChidren(btnOkbj);
            this.AddChidren(btnOk);
            layout.AddChidren(this);
            //btnBottom.Y = btnOkbj.Bottom + Application.GetRealWidth(16);
        }
@@ -211,7 +209,7 @@
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                btnOk.BackgroundColor = MusicColor.SelectedColor;// this.UpBackgroundColor;
                btnOk.IsSelected = false;
                //弹起来还原背景颜色
            };
            btnOk.MouseUpEventHandler += UpClick;
@@ -219,28 +217,15 @@
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                btnOk.IsSelected = true;
                KeypadEntity keypadEntity = new KeypadEntity();
                keypadEntity.name = btnOk.Name;
                keypadEntity.keypad = "key_ok";
                action?.Invoke(keypadEntity);
                //按下去改变背景颜色
                btnOk.BackgroundColor = this.DownBackgroundColor;
            };
            btnOk.MouseDownEventHandler += DownClick;
        }
        public void SetClickUpBackgroundColor(uint backgroundColor)
        {
            this.UpBackgroundColor = backgroundColor;
        }
        public void SetClickDownBackgroundColor(uint backgroundColor)
        {
            this.DownBackgroundColor = backgroundColor;
        }
    }
}