From a1b0ab7044100daaa7e0f1da2d2ca45e38098963 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 29 三月 2021 09:13:25 +0800
Subject: [PATCH] 2021-3-29-2
---
HDL_ON/UI/UI0-Public/TopViewDiv.cs | 243 +++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 215 insertions(+), 28 deletions(-)
diff --git a/HDL_ON/UI/UI0-Public/TopViewDiv.cs b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
index 1e13358..080a209 100644
--- a/HDL_ON/UI/UI0-Public/TopViewDiv.cs
+++ b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
@@ -1,4 +1,5 @@
锘縰sing System;
+using System.Collections.Generic;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
@@ -20,7 +21,6 @@
/// </summary>
FrameLayout contentView;
-
/// <summary>
/// 鍚庨��鎸夐挳
/// </summary>
@@ -32,6 +32,11 @@
string title;
/// <summary>
+ /// 鏄惁闇�瑕佸叧闂〉闈�
+ /// </summary>
+ bool needClose = true;
+
+ /// <summary>
/// 鍚庨��鏃惰Е鍙戝浜嬩欢
/// </summary>
Action backAction;
@@ -40,6 +45,19 @@
{
baseView = frame;
title = str;
+ }
+
+ /// <summary>
+ /// TopViewDiv
+ /// </summary>
+ /// <param name="frame">鐖舵帶浠�</param>
+ /// <param name="title">鏍囬</param>
+ /// <param name="needClose">鏄惁闇�瑕佸叧闂〉闈�</param>
+ public TopViewDiv(FrameLayout frame, string title, bool needClose)
+ {
+ baseView = frame;
+ this.title = title;
+ this.needClose = needClose;
}
/// <summary>
@@ -70,28 +88,34 @@
};
baseView.AddChidren(contentView);
- btnBack = new Button()
+ Button btnBackIcon = new Button()
{
X = Application.GetRealWidth(10),
Y = Application.GetRealHeight(29),
Width = Application.GetRealWidth(40),
- Height = Application.GetRealHeight(28),
+ Height = Application.GetRealWidth(28),
UnSelectedImagePath = "Public/BackIcon.png",
};
- baseView.AddChidren(btnBack);
+ contentView.AddChidren(btnBackIcon);
+
+ btnBack = new Button()
+ {
+ Width = Application.GetRealWidth(100),
+ };
+ contentView.AddChidren(btnBack);
Button btnTilte = new Button()
{
Gravity = Gravity.CenterHorizontal,
Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(150),
+ Width = Application.GetRealWidth(270),
Height = Application.GetRealHeight(25),
TextAlignment = TextAlignment.Center,
TextSize = CSS_FontSize.HeadlineFontSize,
TextColor = CSS_Color.FirstLevelTitleColor,
Text = title
};
- baseView.AddChidren(btnTilte);
+ contentView.AddChidren(btnTilte);
LoadEventList();
@@ -99,22 +123,17 @@
/// <summary>
/// 鎷ユ湁涓�涓洖璋冧簨浠�
/// </summary>
- /// <param name="action"></param>
- public void LoadTopView(Action action)
+ /// <param name="backAct"></param>
+ public void LoadTopView(Action backAct)
{
- backAction = action;
+ backAction = backAct;
LoadTopView();
}
- /// <summary>
- /// 鍚慺ramelayout娣诲姞椤堕儴鍖哄煙,鎷ユ湁閰嶇疆鍥炬爣鎸夐挳
- /// </summary>
- /// <param name="frame"></param>
- /// <param name="tilte"></param>
- public void LoadTopView(Function function, Action action)
+ public void LoadTopView_RoomTop(Action backAction ,Action editAction)
{
- backAction = action;
+ this.backAction = backAction;
LoadTopView();
@@ -126,21 +145,88 @@
Height = Application.GetMinRealAverage(28),
UnSelectedImagePath = "Public/FuncInfoSetIcon.png",
};
- contentView.AddChidren(btnSetting);
- btnSetting.MouseUpEventHandler += (sender, e) =>
+ //濡傛灉鏄垚鍛橀殣钘忕紪杈戝姛鑳�
+ if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare)
{
- LoadEvent_SkipFunctionSetting(function);
+ contentView.AddChidren(btnSetting);
+ }
+ btnSetting.MouseUpEventHandler = (sender, e) =>
+ {
+ editAction();
};
}
+ /// <summary>
+ /// 鍚慺ramelayout娣诲姞椤堕儴鍖哄煙,鎷ユ湁閰嶇疆鍥炬爣鎸夐挳
+ /// </summary>
+ /// <param name="frame"></param>
+ /// <param name="tilte"></param>
+ public void LoadTopView_FunctionTop(Function function, Action action)
+ {
+ backAction = action;
+
+ LoadTopView();
+
+ var btnSetting = new Button()
+ {
+ X = Application.GetRealWidth(337),
+ Y = Application.GetRealHeight(28),
+ Width = Application.GetMinRealAverage(32),
+ Height = Application.GetMinRealAverage(32),
+ UnSelectedImagePath = "Public/FuncInfoSetIcon.png",
+ };
+ //濡傛灉鏄垚鍛橀殣钘忕紪杈戝姛鑳�
+ if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare)
+ {
+ contentView.AddChidren(btnSetting);
+ }
+
+ btnSetting.MouseUpEventHandler = (sender, e) =>
+ {
+ var infoView = new FunctionBaseInfoSetPage(function, action);
+ MainPage.BasePageView.AddChidren(infoView);
+ infoView.LoadPage();
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ };
+ }
+
+ /// <summary>
+ /// 鎴块棿鏍囬鍖哄煙
+ /// </summary>
+ /// <param name="room"></param>
+ /// <param name="skipAction"></param>
+ public void LoadTopView_SettingIcon(Action skipAction)
+ {
+ LoadTopView();
+
+ var btnSetting = new Button()
+ {
+ X = Application.GetRealWidth(337),
+ Y = Application.GetRealHeight(29),
+ Width = Application.GetMinRealAverage(28),
+ Height = Application.GetMinRealAverage(28),
+ UnSelectedImagePath = "Public/FuncInfoSetIcon.png",
+ };
+
+ //濡傛灉鏄垚鍛橀殣钘忕紪杈戝姛鑳�
+ if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare)
+ {
+ contentView.AddChidren(btnSetting);
+ }
+
+ btnSetting.MouseUpEventHandler += (sender, e) =>
+ {
+ skipAction();
+ };
+ }
/// <summary>
/// 鍚慺ramelayout娣诲姞椤堕儴鍖哄煙,鎷ユ湁娣诲姞鍥炬爣鐨勬寜閽�
/// </summary>
/// <param name="frame"></param>
/// <param name="tilte"></param>
- public void LoadTopView(string type, Action<string, string> callBack)
+ public void LoadTopView_AddIcon(string type, Action<string, string> callBack)
{
LoadTopView();
@@ -156,22 +242,123 @@
btnAddIcon.MouseUpEventHandler += (sender, e) =>
{
- LoadEvent_AddEvent(type, callBack);
-
+ if (type == "floors")
+ {
+ Action<string> callBackAction = (floorName) =>
+ {
+ callBack("add", floorName);
+ };
+ string newFloorName = "1F";
+ for (int i = 0; i < SpatialInfo.CurrentSpatial.FloorList.Count + 1;)
+ {
+ newFloorName = ++i + "F";
+ if (null == SpatialInfo.CurrentSpatial.FloorList.Find((obj) => obj.roomName == newFloorName))
+ {
+ break;
+ }
+ }
+ var fs = new List<string>();
+ foreach (var f in SpatialInfo.CurrentSpatial.FloorList)
+ {
+ fs.Add(f.roomName);
+ }
+ new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors, newFloorName, callBackAction, StringId.FloorNameCannotBeEmpty,
+ StringId.AddFloorFailed_FloorAlreadyExist, fs);
+ }
+ else
+ {
+ callBack("", "");
+ }
};
}
/// <summary>
- /// 鍚慺ramelayout娣诲姞椤堕儴鍖哄煙,鎷ユ湁娣诲姞鍥炬爣鐨勬寜閽�,杩斿洖鏈夊洖璋冧簨浠�
+ /// 妤煎眰绠$悊椤堕儴鏍�
/// </summary>
- /// <param name="type"></param>
- /// <param name="callBack"></param>
- /// <param name="action"></param>
- public void LoadTopView(string type, Action<string, string> callBack,Action action)
+ public void LoadTopView_FloorTopView(Action<string> callBack,Action action)
{
- LoadTopView(type, callBack);
+ LoadTopView();
backAction = action;
+
+ var btnAddIcon = new Button()
+ {
+ X = Application.GetRealWidth(337),
+ Y = Application.GetRealHeight(29),
+ Width = Application.GetMinRealAverage(28),
+ Height = Application.GetMinRealAverage(28),
+ UnSelectedImagePath = "Public/AddIcon.png",
+ };
+ contentView.AddChidren(btnAddIcon);
+
+ btnAddIcon.MouseUpEventHandler += (sender, e) =>
+ {
+ Action<string> callBackAction = (floorName) =>
+ {
+ callBack(floorName);
+ };
+ string newFloorName = "1F";
+ for (int i = 0; i < SpatialInfo.CurrentSpatial.FloorList.Count + 1;)
+ {
+ newFloorName = ++i + "F";
+ if (null == SpatialInfo.CurrentSpatial.FloorList.Find((obj) => obj.roomName == newFloorName))
+ {
+ break;
+ }
+ }
+ var fs = new List<string>();
+ foreach (var f in SpatialInfo.CurrentSpatial.FloorList)
+ {
+ fs.Add(f.roomName);
+ }
+ new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors, newFloorName, callBackAction, StringId.FloorNameCannotBeEmpty,
+ StringId.AddFloorFailed_FloorAlreadyExist, fs);
+ };
+ }
+ /// <summary>
+ /// 鎴块棿绠$悊椤堕儴鏍�
+ /// </summary>
+ public void LoadTopView_RoomTopView(Action callBack)
+ {
+ LoadTopView();
+
+ var btnAddIcon = new Button()
+ {
+ X = Application.GetRealWidth(337),
+ Y = Application.GetRealHeight(29),
+ Width = Application.GetMinRealAverage(28),
+ Height = Application.GetMinRealAverage(28),
+ UnSelectedImagePath = "Public/AddIcon.png",
+ };
+ contentView.AddChidren(btnAddIcon);
+
+ btnAddIcon.MouseUpEventHandler += (sender, e) =>
+ {
+ callBack?.Invoke();
+ };
+ }
+ /// <summary>
+ /// 鎴愬憳椤堕儴鏍�
+ /// </summary>
+ public void LoadTopView_MemberTopView(Action callBack, Action action)
+ {
+ LoadTopView();
+ backAction = action;
+
+ var btnAddIcon = new Button()
+ {
+ X = Application.GetRealWidth(337),
+ Y = Application.GetRealHeight(29),
+ Width = Application.GetMinRealAverage(28),
+ Height = Application.GetMinRealAverage(28),
+ UnSelectedImagePath = "Public/AddIcon.png",
+ };
+ contentView.AddChidren(btnAddIcon);
+
+ btnAddIcon.MouseUpEventHandler += (sender, e) =>
+ {
+ callBack?.Invoke();
+ };
}
}
}
--
Gitblit v1.8.0