예제 #1
0
 protected override void UpdateEx(float interval)
 {
     base.UpdateEx(interval);
     if (CurPanel != null)
     {
         CurPanel.Update();
     }
 }
예제 #2
0
 public override void UpdateEx()
 {
     base.UpdateEx();
     if (CurPanel != null)
     {
         CurPanel.Update();
     }
 }
예제 #3
0
 /// <summary>
 /// 面板跳转;
 /// </summary>
 /// <param name="type"></param>
 public void TransToPanel(PanelType type)
 {
     if (CurPanel != null)
     {
         CurPanel.OnExit();
     }
     else
     {
         CurPanel = CreatePanel(type);
         if (CurPanel == null)
         {
             LogHelper.PrintError(string.Format("[UIMgr]trans to panel {0} error.", type.ToString()));
             return;
         }
     }
     CurPanel.OnEnter();
 }
예제 #4
0
        private void ButtonFunc()
        {
            GUILayout.BeginHorizontal();
            switch (curPanel)
            {
            case CurPanel.Debug:
                if (canReceiveMsg)
                {
                    if (GUILayout.Button("接收", GUILayout.Width(windowSize.x / 8), GUILayout.Height(windowSize.y / 12)))
                    {
                        canReceiveMsg = false;
                    }
                }
                else
                {
                    if (GUILayout.Button("拒收", GUILayout.Width(windowSize.x / 8), GUILayout.Height(windowSize.y / 12)))
                    {
                        canReceiveMsg = true;
                    }
                }
                if (GUILayout.Button("清空", GUILayout.Width(windowSize.x / 8), GUILayout.Height(windowSize.y / 12)))
                {
                    logs.Clear();
                }
                logFilter[0] = GUI.Toggle(new Rect(20 + (windowSize.x / 8) * 0, windowSize.y / 10 + 20, windowSize.x / 8, windowSize.y / 12), logFilter[0], "Debug");
                logFilter[1] = GUI.Toggle(new Rect(20 + (windowSize.x / 8) * 1, windowSize.y / 10 + 20, windowSize.x / 8, windowSize.y / 12), logFilter[1], "Assert");
                logFilter[2] = GUI.Toggle(new Rect(20 + (windowSize.x / 8) * 2, windowSize.y / 10 + 20, windowSize.x / 8, windowSize.y / 12), logFilter[2], "Warning");
                logFilter[3] = GUI.Toggle(new Rect(20 + (windowSize.x / 8) * 3, windowSize.y / 10 + 20, windowSize.x / 8, windowSize.y / 12), logFilter[3], "Error");
                logFilter[4] = GUI.Toggle(new Rect(20 + (windowSize.x / 8) * 4, windowSize.y / 10 + 20, windowSize.x / 8, windowSize.y / 12), logFilter[4], "Exception");
                if (GUILayout.Button("命令", GUILayout.Width(windowSize.x / 8), GUILayout.Height(windowSize.y / 12)))
                {
                    curPanel = CurPanel.Command;
                }
                if (GUILayout.Button("设置", GUILayout.Width(windowSize.x / 8), GUILayout.Height(windowSize.y / 12)))
                {
                    curPanel = CurPanel.Set;
                }
                break;

            case CurPanel.Command:
                if (GUILayout.Button("控制台", GUILayout.Width(windowSize.x / 8), GUILayout.Height(windowSize.y / 12)))
                {
                    curPanel = CurPanel.Debug;
                }
                if (GUILayout.Button("设置", GUILayout.Width(windowSize.x / 8), GUILayout.Height(windowSize.y / 12)))
                {
                    curPanel = CurPanel.Set;
                }
                break;

            case CurPanel.Set:
                if (GUILayout.Button("控制台", GUILayout.Width(windowSize.x / 8), GUILayout.Height(windowSize.y / 12)))
                {
                    curPanel = CurPanel.Debug;
                }
                if (GUILayout.Button("命令", GUILayout.Width(windowSize.x / 8), GUILayout.Height(windowSize.y / 12)))
                {
                    curPanel = CurPanel.Command;
                }
                break;
            }
            GUILayout.EndHorizontal();
        }
예제 #5
0
        //显示面板切换
        public void PanelSwitch(CurPanel curPanel)
        {
            ChangeNONewSerialNO = 0;                    //变量清零
            TempGrpNewSerialNO  = 0;                    //变量清零

            switch (curPanel)
            {
            case CurPanel.EpanelContentMain:                                    //主内容面板
                panelContentMain.Visible   = true;
                panelInfoSync.Visible      = false;
                panelSysSetting.Visible    = false;
                panelTempGroup.Visible     = false;
                panelUserChangeNO.Visible  = false;
                panelKnowledgeBase.Visible = false;
                panelDeviceBase.Visible    = false;
                panelCheckUser.Visible     = false;

                panelInfo.BackColor = Color.FromArgb(63, 71, 82);
                break;

            case CurPanel.EpanelInfoSync:                                       //信息同步面板
                panelContentMain.Visible   = false;
                panelInfoSync.Visible      = true;
                panelSysSetting.Visible    = false;
                panelTempGroup.Visible     = false;
                panelUserChangeNO.Visible  = false;
                panelKnowledgeBase.Visible = false;
                panelDeviceBase.Visible    = false;
                panelCheckUser.Visible     = false;

                richTextInfoSyncStatus.Text = "";

                panelInfo.BackColor = Color.FromArgb(34, 34, 34);
                break;

            case CurPanel.EpanelSysSetting:                             //系统设置面板
                PanelSysSettingInit();                                  //系统设置面板初始化, 主要将所有输入框控件的enabled置为false
                panelContentMain.Visible   = false;
                panelInfoSync.Visible      = false;
                panelSysSetting.Visible    = true;
                panelTempGroup.Visible     = false;
                panelUserChangeNO.Visible  = false;
                panelKnowledgeBase.Visible = false;
                panelDeviceBase.Visible    = false;
                panelCheckUser.Visible     = false;

                panelInfo.BackColor = Color.FromArgb(34, 34, 34);
                break;

            case CurPanel.EpanelTempGroup:                                      //临时编组面板
                panelContentMain.Visible   = false;
                panelInfoSync.Visible      = false;
                panelSysSetting.Visible    = false;
                panelTempGroup.Visible     = true;
                panelUserChangeNO.Visible  = false;
                panelKnowledgeBase.Visible = false;
                panelDeviceBase.Visible    = false;
                panelCheckUser.Visible     = false;

                richTextTempGroupStatus.Text = "";
                richTextTempOldGrpNO.Text    = "";
                richTextTempOldDevNO.Text    = "";
                richTextTempNewGrpNO.Text    = "";
                richTextTempNewDevNO.Text    = "";

                panelInfo.BackColor = Color.FromArgb(34, 34, 34);
                break;

            case CurPanel.EpanelUserChangeNO:                                   //用户改号面板
                panelContentMain.Visible   = false;
                panelInfoSync.Visible      = false;
                panelSysSetting.Visible    = false;
                panelTempGroup.Visible     = false;
                panelUserChangeNO.Visible  = true;
                panelKnowledgeBase.Visible = false;
                panelDeviceBase.Visible    = false;
                panelCheckUser.Visible     = false;

                richTextUserChangeNOStatus.Text = "";
                richTextOldGrpNO.Text           = "";
                richTextOldDevNO.Text           = "";
                richTextNewGrpNO.Text           = "";
                richTextNewDevNO.Text           = "";

                panelInfo.BackColor = Color.FromArgb(34, 34, 34);
                break;

            case CurPanel.EpanelKnowledgeBase:                                  //知识库面板
                panelContentMain.Visible   = false;
                panelInfoSync.Visible      = false;
                panelSysSetting.Visible    = false;
                panelTempGroup.Visible     = false;
                panelUserChangeNO.Visible  = false;
                panelKnowledgeBase.Visible = true;
                panelDeviceBase.Visible    = false;
                panelCheckUser.Visible     = false;

                panelInfo.BackColor = Color.FromArgb(34, 34, 34);
                break;

            case CurPanel.EpanelDeviceBase:                                     //设备库面板
                panelContentMain.Visible   = false;
                panelInfoSync.Visible      = false;
                panelSysSetting.Visible    = false;
                panelTempGroup.Visible     = false;
                panelUserChangeNO.Visible  = false;
                panelKnowledgeBase.Visible = false;
                panelDeviceBase.Visible    = true;
                panelCheckUser.Visible     = false;
                break;

            case CurPanel.EpanelCheckUser:                                      //用户列表面板
                panelContentMain.Visible   = false;
                panelInfoSync.Visible      = false;
                panelSysSetting.Visible    = false;
                panelTempGroup.Visible     = false;
                panelUserChangeNO.Visible  = false;
                panelKnowledgeBase.Visible = false;
                panelDeviceBase.Visible    = false;
                panelCheckUser.Visible     = true;
                break;

            default:
                break;
            }
        }