| | |
| | | /// <summary>
|
| | | /// 默认的那个菜单
|
| | | /// </summary>
|
| | | private FrameLayoutControl frameDefult = null;
|
| | | private FrameLayoutStatuControl frameDefult = null;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | public SceneFunctionSwitchControl()
|
| | | {
|
| | | this.Height = Application.GetRealHeight(90);
|
| | | this.Y = Application.GetRealHeight(40);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化控件(事件要至于它之前)
|
| | | /// </summary>
|
| | | /// <param name="listTitleText">菜单文字列表</param>
|
| | | public void InitControl(List<string> listTitleText)
|
| | | /// <param name="rightSpace">右边空白宽度</param>
|
| | | public void InitControl(List<string> listTitleText, int rightSpace = 0)
|
| | | {
|
| | | if (listTitleText.Count == 0) { return; }
|
| | |
|
| | | var btnTemp = new NormalViewControl(10, 10, false);
|
| | | btnTemp.TextSize = 16;
|
| | |
|
| | |
| | | {
|
| | | btnTemp.Text = listTitleText[i];
|
| | | //开始初始化
|
| | | XX = this.InitTitleTextControl(i, listTitleText[i], btnTemp.GetTextWidth(), XX);
|
| | | XX = this.InitTitleTextControl(i, listTitleText[i], btnTemp.GetRealWidthByText(), XX);
|
| | | }
|
| | | //调整控件宽度
|
| | | this.Width = XX + Application.GetRealWidth(rightSpace);
|
| | | //回调方法
|
| | | this.frameDefult.ButtonClickEvent?.Invoke(null, null);
|
| | | }
|
| | |
| | | private int InitTitleTextControl(int i_index, string titleText, int realWidth, int XX)
|
| | | {
|
| | | //场景框(点击范围有点小,需要扩大它的点击范围)
|
| | | var frameBack = new FrameLayoutControl();
|
| | | var frameBack = new FrameLayoutStatuControl();
|
| | | frameBack.UseClickStatu = false;
|
| | | frameBack.Height = Application.GetRealHeight(90);
|
| | | frameBack.Width = realWidth;
|
| | |
| | | //名称
|
| | | var btnName = new NormalViewControl(frameBack.Width, Application.GetRealHeight(63), false);
|
| | | btnName.Text = titleText;
|
| | | btnName.TextAlignment = TextAlignment.Center;
|
| | | if (m_nowSelectIndex == i_index)
|
| | | {
|
| | | this.frameDefult = frameBack;
|
| | |
| | |
|
| | | //底线
|
| | | var btnLine = new NormalViewControl(40, 10, true);
|
| | | btnLine.Y = btnName.Bottom + Application.GetRealHeight(14);
|
| | | btnLine.Y = btnName.Bottom + Application.GetRealHeight(6);
|
| | | btnLine.X = btnName.X + btnName.Width / 2 - Application.GetRealWidth(40) / 2;
|
| | | btnLine.Radius = (uint)Application.GetRealHeight(10) / 2;
|
| | | btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
|