黄学彪
2021-01-28 1fcf2302f79f9cbea5ef17c3688311ed65cfabb4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using System;
using Shared;
namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
{
    public class TimeHorizonView : FrameLayout
    {
        /// <summary>
        /// 主控件
        /// </summary>
        public FrameLayout frameLayout = new FrameLayout
        {
            Y = Application.GetRealHeight(460),
            Height = Application.GetRealHeight(187),
            Width = Application.GetRealWidth(343),
            X = Application.GetRealWidth(16),
            BackgroundColor = CSS.CSS_Color.view,
            Radius=(uint)Application.GetRealHeight(12),
        };
        /// <summary>
        /// 标题Btn
        /// </summary>
        public Button btnTitle = new Button
        {
            TextID = StringId.timeHorizon,
            TextSize = TextSize.text16,
            TextColor = CSS.CSS_Color.textColor,
            IsBold = true,
            Width = Application.GetRealWidth(343-(52 + 4 + 10)*2),
            Height = Application.GetRealHeight(22),
            Y = Application.GetRealHeight(15),
            X = Application.GetRealWidth(52 + 4 + 10)
        };
        /// <summary>
        /// 取消Btn
        /// </summary>
        public Button btnCancel = new Button
        {
            TextID = StringId.cancelSelected,
            TextSize = TextSize.text14,
            TextColor = CSS.CSS_Color.textCancelColor,
            Width = Application.GetRealWidth(52),
            Height = Application.GetRealHeight(32),
            Y = Application.GetRealHeight(10),
            X = Application.GetRealWidth(4)
        };
        /// <summary>
        /// 确定Btn
        /// </summary>
        public Button btnConfirm = new Button
        {
            TextID = StringId.confirmSelected,
            TextSize = TextSize.text14,
            TextColor = CSS.CSS_Color.textConfirmColor,
            Width = Application.GetRealWidth(52),
            Height = Application.GetRealHeight(32),
            X = Application.GetRealWidth(343 - 4 - 52),
            Y = Application.GetRealHeight(10),
        };
        /// <summary>
        ///  红色提示文本
        /// </summary>
        public Button btnTip = new Button
        {
            TextID = StringId.timeTipText,
            TextSize = TextSize.text12,
            TextColor = CSS.CSS_Color.textRedColor,
            Width = Application.GetRealWidth(340-20),
            Height = Application.GetRealHeight(17),
            X = Application.GetRealWidth(20),
            Y = Application.GetRealHeight(58),
            TextAlignment=TextAlignment.CenterLeft,
        };
 
        /// <summary>
        /// View的方法
        /// </summary>
        /// <returns></returns>
        public void FLayoutView(FrameLayout fLayout)
        {
            frameLayout.AddChidren(btnTitle);
            frameLayout.AddChidren(btnTip);
            frameLayout.AddChidren(btnCancel);
            frameLayout.AddChidren(btnConfirm);
            fLayout.AddChidren(frameLayout);
            ////界面点击事件
            //fLayout.MouseUpEventHandler += (sender, e1) =>
            //{
            //    //移除fLayout界面
            //    fLayout.RemoveFromParent();
            //};
            //取消点击事件
            btnCancel.MouseUpEventHandler += (sender, e2) =>
            {
                //移除fLayout界面
                fLayout.RemoveFromParent();
            };
        }
    }
}