Example #1
0
        public virtual void DoEnter()
        {
            UIControlbase uictrl = CurKTUIControl;

            if (CurKTUIControl == this)
            {
                return;
            }

            if (_baseKTUIControl != null &&
                CurKTUIControl != null &&
                _baseKTUIControl != CurKTUIControl)
            {
                CurKTUIControl.DoExit();
            }

            if (CurKTUIControl != null)
            {
                CurKTUIControl.Enabled = false;
                if (CurKTUIControl._prehideonenter)
                {
                    CurKTUIControl.Visible = false;
                }
            }

            if (KTUIControlList != null)
            {
                KTUIControlList.Add(this);

                this.Enabled = true;
                this.Visible = true;
                this.Show();
                this.BringToFront();
                this.Focus();

                if (OnKTUIControlChanged != null)
                {
                    OnKTUIControlChanged(uictrl);
                }
            }
        }
Example #2
0
        private void OnPageViewChanged(UIControlbase PreUICtrl)
        {
            if (UIControlbase.CurKTUIControl != null)
            {
                UIControlbase c = UIControlbase.CurKTUIControl;
                panel_Warn.Visible = c == pvWarn; panel_Warn.BringToFront();
                panel_Err.Visible = c == pvError; panel_Err.BringToFront();

                panel_Para.Visible =
                    c == pvPara_Cylinder ||
                    c == pvPara ||
                    c == pvPara_Sensor ||
                    c == pvPara_Setup;
                panel_Para.BringToFront();

                //if (PreUICtrl == pvMAC && c != pvMAC &&
                //    pvMAC.ControlMode == ControlModeType.CylinderManual)
                //MessageBox.Show("当前为手动模式,请注意!");
                //MessageBox.Show("当前为手动模式,请注意!", "",
                //      MessageBoxButtons.YesNo,
                //      MessageBoxIcon.Exclamation,
                //      MessageBoxDefaultButton.Button1);         
            }
        }