| | |
| | | btnTilte.TextSize = UI.CSS.CSS_FontSize.HeadlineFontSize;
|
| | | btnTilte.TextColor = UI.CSS.CSS_Color.FirstLevelTitleColor;
|
| | | topFrameLayout.AddChidren(btnTilte); |
| | | topFrameLayout.AddTag("txtTitle", btnTilte); |
| | | topFrameLayout.AddTag("txtTitle", btnTilte);
|
| | | #if DEBUG
|
| | | btnTilte.MouseLongEventHandler += (sender, e) =>
|
| | | {
|
| | |
|
| | | var form = new BottomMenuSelectControl(3);
|
| | | form.AddMenu("切换为中文", () =>
|
| | | {
|
| | | Language.CurrentLanguage = "Chinese";
|
| | | //清除全部控件
|
| | | this.ClearBodyFrame();
|
| | | //执行ShowForm()方法实现重新加载
|
| | | this.LoadShowFormMethod(this.m_parameter);
|
| | | });
|
| | | form.AddMenu("切换为英文", () =>
|
| | | {
|
| | | Language.CurrentLanguage = "English";
|
| | | //清除全部控件
|
| | | this.ClearBodyFrame();
|
| | | //执行ShowForm()方法实现重新加载
|
| | | this.LoadShowFormMethod(this.m_parameter);
|
| | | });
|
| | | form.AddMenu("查看本地文件", () =>
|
| | | {
|
| | | var form2 = new HideOptionDirectoryListForm();
|
| | | form2.AddForm();
|
| | | });
|
| | | };
|
| | | #endif |
| | | } |
| | |
|
| | | #endregion |
| | |
| | | #region ■ 添加列表消息显示控件_______________
|
| | |
|
| | | /// <summary>
|
| | | /// 添加列表消息显示控件,返回的是最后一个控件的底部坐标
|
| | | /// 添加列表消息显示控件,返回生成的控件(没看懂这个函数前,请勿使用,它不会帮计算换行)
|
| | | /// </summary>
|
| | | /// <param name="frameTable">桌布容器控件</param>
|
| | | /// <param name="i_msg">显示的消息(换行请使用【{0}】进行分割)</param>
|
| | |
| | | /// <para>注:除了新建这个函数的开发者以外,都不建议把这个值不设置为true</para>
|
| | | /// <para>说明:以最长的控件的X轴为基准,所有控件的X轴都变成一致</para>
|
| | | /// </param>
|
| | | /// <param name="i_width">文本宽度,真实值,当为-1时,内部自动计算</param>
|
| | | /// <returns></returns>
|
| | | public int AddListMsgControls(FrameLayout frameTable, string i_msg, int i_fontSize, uint i_fontColor, int i_height,
|
| | | int i_yy, TextAlignment alignment = TextAlignment.Center, bool special = false)
|
| | | public List<NormalViewControl> AddListMsgControls(FrameLayout frameTable, string i_msg, int i_fontSize, uint i_fontColor, int i_height,
|
| | | int i_yy, TextAlignment alignment = TextAlignment.Center, bool special = false, int i_width = -1)
|
| | | {
|
| | | var listMsg = i_msg.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | int defultWidth = this.bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2;
|
| | | int defultWidth = 0;
|
| | | if (this.bodyFrameLayout != null)
|
| | | {
|
| | | defultWidth = i_width == -1 ? this.bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2 : i_width;
|
| | | }
|
| | | else
|
| | | {
|
| | | defultWidth = i_width == -1 ? frameTable.Width - HdlControlResourse.XXLeft * 2 : i_width;
|
| | | }
|
| | |
|
| | | //如果只是一行的时候
|
| | | bool isMoreLine = false;
|
| | | if (listMsg.Length == 1)
|
| | | {
|
| | | var btnTemp = new ButtonCtrBase();
|
| | | btnTemp.TextSize = i_fontSize;
|
| | | btnTemp.Text = i_msg;
|
| | | int rowCount = btnTemp.GetRealRowCountByText(defultWidth);
|
| | | //它的高度由行数决定(理论上应该都是1行,这里做特殊处理而已)
|
| | | if (rowCount > 1)
|
| | | {
|
| | | i_height = i_height * rowCount;
|
| | | isMoreLine = true;
|
| | | }
|
| | | }
|
| | |
|
| | | var listContr = new List<NormalViewControl>();
|
| | | int minXX = 10086;//控件集合最小的X轴
|
| | |
| | | btnMsg.TextColor = i_fontColor;
|
| | | btnMsg.TextSize = i_fontSize;
|
| | | btnMsg.Text = strMsg;
|
| | | if (isMoreLine == true)
|
| | | {
|
| | | //可以换行
|
| | | btnMsg.IsMoreLines = isMoreLine;
|
| | | }
|
| | |
|
| | | //特殊处理
|
| | | if (special == true && alignment == TextAlignment.Center)
|
| | | if (special == true)
|
| | | {
|
| | | //设置它的真实宽度(对special变量有用)
|
| | | int realWidth = btnMsg.GetRealWidthByText();
|
| | |
| | | i_yy = btnMsg.Bottom + Application.GetRealHeight(4);
|
| | | }
|
| | | //特殊处理
|
| | | if (special == true && alignment == TextAlignment.Center)
|
| | | if (special == true)
|
| | | {
|
| | | foreach (var contr in listContr)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | return i_yy - Application.GetRealHeight(4);
|
| | | return listContr;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | public void RemoveBackButton() |
| | | { |
| | | //移除返回键 |
| | | var back = (NormalViewControl)topFrameLayout.GetTagByKey("btnBack"); |
| | | var back = (PicViewControl)topFrameLayout.GetTagByKey("btnBack"); |
| | | topFrameLayout.RemoveTag("btnBack"); |
| | | back?.RemoveFromParent();
|
| | |
|