wxr
2023-11-06 d720466cffce3bea2ee92e419f64a92da6ab7e18
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
using System;
using System.Collections.Generic;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
 
namespace HDL_ON.UI
{
    /// <summary>
    /// 场景模板类型选择界面
    /// 功能
    /// 自动化
    /// </summary>
    public class SceneTargetTypeChoosePage : FrameLayout
    {
        FrameLayout bodyView;
        Scene scene;
        /// <summary>
        /// 更新功能row
        /// </summary>
        Action refreshFunctionRowAction;
 
        public SceneTargetTypeChoosePage(Scene function, Action action)
        {
            bodyView = this;
            scene = function;
            refreshFunctionRowAction = () =>
            {
                this.RemoveFromParent();
                action();
            };
        }
 
        public void LoadPage()
        {
            bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
            bodyView.AddChidren(new Button()
            {
                Height = Application.GetRealHeight(20),
                BackgroundColor = CSS_Color.BackgroundColor
            });
            var topView = new TopViewDiv(bodyView,Language.StringByID(StringId.AddExecutionAction);
            topView.maginY = 10;
            topView.LoadTopView();
 
 
            var contentView = new VerticalScrolViewLayout()
            {
                Y = Application.GetRealHeight(74),
                Height = Application.GetRealHeight(530),
                ScrollEnabled = false,
            };
            bodyView.AddChidren(contentView);
 
            var funtionView = new FrameLayout()
            {
                Height = Application.GetRealHeight(50),
            };
            contentView.AddChidren(funtionView);
 
 
            var btnFunctionIcon = new Button()
            {
                Gravity = Gravity.CenterVertical,
                X = Application.GetRealWidth(16),
                Width = Application.GetMinRealAverage(22),
                Height = Application.GetMinRealAverage(22),
                UnSelectedImagePath = "Navigation/ClassificationIcon.png",
            };
            funtionView.AddChidren(btnFunctionIcon);
 
            var btnFunctionRight = new Button()
            {
                X = Application.GetRealWidth(339),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/Right.png",
            };
            funtionView.AddChidren(btnFunctionRight);
 
            var btnFunctionTitle = new Button()
            {
                X = Application.GetRealWidth(50),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.Functions,
            };
            funtionView.AddChidren(btnFunctionTitle);
 
            btnFunctionTitle.MouseUpEventHandler = (sender, e) => {
 
                refreshFunctionRowAction += () => {
                    this.RemoveFromParent();
                };
                var sefp = new SceneFunctionListChoosePage(scene, refreshFunctionRowAction);
                MainPage.BasePageView.AddChidren(sefp);
                sefp.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
 
            contentView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor });
 
            var automationView = new FrameLayout()
            {
                Height = Application.GetRealHeight(50),
            };
            contentView.AddChidren(automationView);
 
 
            var btnAutomationRight = new Button()
            {
                X = Application.GetRealWidth(339),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/Right.png",
            };
            automationView.AddChidren(btnAutomationRight);
            var btnAutomationIcon = new Button()
            {
                Gravity = Gravity.CenterVertical,
                X = Application.GetRealWidth(16),
                Width = Application.GetMinRealAverage(22),
                Height = Application.GetMinRealAverage(22),
                UnSelectedImagePath = "Navigation/IntellectualizationIcon.png",
            };
            automationView.AddChidren(btnAutomationIcon);
 
            var btnAutomationTitle = new Button()
            {
                X = Application.GetRealWidth(50),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.Automation,
            };
            automationView.AddChidren(btnAutomationTitle);
 
            btnAutomationTitle.MouseUpEventHandler = (sender, e) => {
 
                refreshFunctionRowAction += () => {
                    this.RemoveFromParent();
                };
 
                var sefp = new SceneAutomationListChoosePage(scene, refreshFunctionRowAction);
                MainPage.BasePageView.AddChidren(sefp);
                sefp.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
 
 
            contentView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor });
        }
    }
}