mac
2024-07-25 3f6685c77beeb12baf840733fb890860f4c26e7c
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
@@ -14,7 +14,7 @@
        {
            this.Width = Application.GetRealWidth(width);
            this.Height = Application.GetRealWidth(height);
            this.Radius = (uint)Application.GetRealHeight(cornerValue);
            this.Radius = (uint)Application.GetRealWidth(cornerValue);
            this.BackgroundColor = MusicColor.ViewColor;
            this.Gravity = Gravity.CenterHorizontal;
        }
@@ -22,31 +22,53 @@
        {
            Y = Application.GetRealWidth(16),
            X = Application.GetRealWidth(78),
            Width = Application.GetRealWidth(24),
            Height = Application.GetRealHeight(20),
            Width = Application.GetRealWidth(24),//高度和宽高不一样,以宽度为维度计算,否则变形
            Height = Application.GetRealWidth(20),
            UnSelectedImagePath = "AksIcon/shang.png",
            SelectedImagePath = "AksIcon/shang_selected.png",
            Name = "上",
        };
        Button btnTopClick = new Button
        {
            X = Application.GetRealWidth(52),
            Width = Application.GetRealWidth(76),
            Height = Application.GetRealHeight(40),
        };
        Button btnBottom = new Button
        {
            Y = Application.GetRealWidth(144),
            X = Application.GetRealWidth(78),
            Width = Application.GetRealWidth(24),
            Height = Application.GetRealHeight(20),
            Height = Application.GetRealWidth(20),
            UnSelectedImagePath = "AksIcon/xia.png",
            SelectedImagePath = "AksIcon/xia_selected.png",
            Name = "下",
        };
        Button btnBottomClick = new Button
        {
            Y = Application.GetRealWidth(128),
            X = Application.GetRealWidth(52),
            Width = Application.GetRealWidth(76),
            Height = Application.GetRealHeight(52),
        };
        Button btnLeft = new Button
        {
            Y = Application.GetRealWidth(78),
            X = Application.GetRealWidth(16),
            Width = Application.GetRealWidth(20),
            Height = Application.GetRealHeight(24),
            Height = Application.GetRealWidth(24),
            UnSelectedImagePath = "AksIcon/zuo.png",
            SelectedImagePath = "AksIcon/zuo_selected.png",
            Name = "左",
        };
        Button btnLeftClick = new Button
        {
            Y = Application.GetRealWidth(52),
            Width = Application.GetRealWidth(52),
            Height = Application.GetRealHeight(76),
        };
        Button btnRight = new Button
@@ -54,19 +76,28 @@
            Y = Application.GetRealWidth(78),
            X = Application.GetRealWidth(144),
            Width = Application.GetRealWidth(20),
            Height = Application.GetRealHeight(24),
            Height = Application.GetRealWidth(24),
            UnSelectedImagePath = "AksIcon/you.png",
            SelectedImagePath = "AksIcon/you_selected.png",
            Name = "右",
        };
        Button btnRightClick = new Button
        {
            X = Application.GetRealWidth(128),
            Y = Application.GetRealWidth(52),
            Width = Application.GetRealWidth(52),
            Height = Application.GetRealHeight(76),
        };
        Button btnOkbj = new Button
        {
            Gravity=Gravity.Center,
            Gravity = Gravity.Center,
            Width = Application.GetRealWidth(76),
            Height = Application.GetRealWidth(76),
            Radius = (uint)Application.GetRealHeight(38),
            Radius = (uint)Application.GetRealWidth(38),
            BackgroundColor = MusicColor.WhiteColor,
@@ -76,7 +107,7 @@
            Gravity = Gravity.Center,
            Width = Application.GetRealWidth(28),
            Height = Application.GetRealWidth(28),
            Radius = (uint)Application.GetRealHeight(14),
            Radius = (uint)Application.GetRealWidth(14),
            BackgroundColor = 0xff1B2D4D,
            SelectedBackgroundColor = MusicColor.SelectedColor,
            Name = "确定"
@@ -85,11 +116,17 @@
        public void AddView(FrameLayout layout)
        {
            this.AddChidren(btnTop);
            this.AddChidren(btnTopClick);
            this.AddChidren(btnBottom);
            this.AddChidren(btnBottomClick);
            this.AddChidren(btnLeft);
            this.AddChidren(btnLeftClick);
            this.AddChidren(btnRight);
            this.AddChidren(btnRightClick);
            this.AddChidren(btnOkbj);
            this.AddChidren(btnOk);
            layout.AddChidren(this);
            //btnBottom.Y = btnOkbj.Bottom + Application.GetRealWidth(16);
@@ -103,22 +140,15 @@
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                btnTop.IsSelected = false;
                //弹起来还原背景颜色
            };
            btnTop.MouseUpEventHandler += UpClick;
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                //按下去改变背景颜色
                btnTop.IsSelected = true;
                KeypadEntity keypadEntity = new KeypadEntity();
                keypadEntity.name = btnTop.Name;
                keypadEntity.keypad = "key_up";
                action?.Invoke(keypadEntity);
                SetButtonIsSelected(btnTop);
            };
            btnTop.MouseDownEventHandler += DownClick;
            btnTop.MouseUpEventHandler += UpClick;
            btnTopClick.MouseUpEventHandler += UpClick;
        }
        /// <summary>
@@ -129,24 +159,15 @@
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                btnBottom.IsSelected = false;
                //弹起来还原背景颜色
            };
            btnBottom.MouseUpEventHandler += UpClick;
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                btnBottom.IsSelected = true;
                KeypadEntity keypadEntity = new KeypadEntity();
                keypadEntity.name = btnBottom.Name;
                keypadEntity.keypad = "key_down";
                action?.Invoke(keypadEntity);
                //按下去改变背景颜色
                SetButtonIsSelected(btnBottom);
            };
            btnBottom.MouseDownEventHandler += DownClick;
            btnBottom.MouseUpEventHandler += UpClick;
            btnBottomClick.MouseUpEventHandler += UpClick;
        }
        /// <summary>
        /// 左
@@ -156,22 +177,15 @@
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                btnLeft.IsSelected = false;
                //弹起来还原背景颜色
            };
            btnLeft.MouseUpEventHandler += UpClick;
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                btnLeft.IsSelected = true;
                KeypadEntity keypadEntity = new KeypadEntity();
                keypadEntity.name = btnLeft.Name;
                keypadEntity.keypad = "key_left";
                action?.Invoke(keypadEntity);
                //按下去改变背景颜色
                SetButtonIsSelected(btnLeft);
            };
            btnLeft.MouseDownEventHandler += DownClick;
            btnLeft.MouseUpEventHandler += UpClick;
            btnLeftClick.MouseUpEventHandler += UpClick;
        }
        /// <summary>
        /// 右
@@ -181,25 +195,16 @@
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                btnRight.IsSelected = false;
                //弹起来还原背景颜色
            };
            btnRight.MouseUpEventHandler += UpClick;
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                //按下去改变背景颜色
                btnRight.IsSelected = true;
                KeypadEntity keypadEntity = new KeypadEntity();
                keypadEntity.name = btnRight.Name;
                keypadEntity.keypad = "key_right";
                action?.Invoke(keypadEntity);
                SetButtonIsSelected(btnRight);
            };
            btnRight.MouseDownEventHandler += DownClick;
            btnRight.MouseUpEventHandler += UpClick;
            btnRightClick.MouseUpEventHandler += UpClick;
        }
        /// <summary>
        /// ok
@@ -209,22 +214,14 @@
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                btnOk.IsSelected = false;
                //弹起来还原背景颜色
            };
            btnOk.MouseUpEventHandler += UpClick;
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                btnOk.IsSelected = true;
                KeypadEntity keypadEntity = new KeypadEntity();
                keypadEntity.name = btnOk.Name;
                keypadEntity.keypad = "key_ok";
                action?.Invoke(keypadEntity);
                //按下去改变背景颜色
                SetButtonIsSelected(btnOk);
            };
            btnOk.MouseDownEventHandler += DownClick;
            btnOk.MouseUpEventHandler += UpClick;
        }
    }