Пример #1
0
        void bed_Paint(object sender, PaintEventArgs e)
        {
            BedInfo _bed = ((BedItem)sender).Bed; //(BedInfo)((UserControl)sender).Tag;

            e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
            DrawBackGroup(e, _bed);
            DrawContext(e, _bed);
            //画图标按钮

            if (_bed.IsUsed == true && _selectedBed != null && _bed.Equals(_selectedBed))  //未使用状态, 在中间画标题
            {
                DrawNurse(e, _bed);
                DrawButton(e.Graphics, _rectHeadPage, Resources.病案首页, ButtonState.bsNormal);
                DrawButton(e.Graphics, _rectTemperature, Resources.体温单, ButtonState.bsNormal);
                DrawButton(e.Graphics, _rectAdvice, Resources.医嘱, ButtonState.bsNormal);
                DrawButton(e.Graphics, _rectApply, Resources.特殊治疗, ButtonState.bsNormal);
            }
        }
Пример #2
0
        void bed_MouseMove(object sender, MouseEventArgs e)
        {
            BedInfo     Bed    = ((BedItem)sender).Bed; //(BedInfo)((UserControl)sender).Tag;
            Graphics    g      = ((UserControl)sender).CreateGraphics();
            PointButton _pbNew = PointButton.pbNone;


            if (Bed.IsUsed && _selectedBed != null && Bed.Equals(_selectedBed))
            {
                if (MouseInRect(e.X, e.Y, _rectHeadPage))
                {
                    _pbNew = PointButton.pbHeadPage;
                }
                else if (MouseInRect(e.X, e.Y, _rectTemperature))
                {
                    _pbNew = PointButton.pbTemperature;
                }
                else if (MouseInRect(e.X, e.Y, _rectAdvice))
                {
                    _pbNew = PointButton.pbAdvice;
                }
                else if (MouseInRect(e.X, e.Y, _rectApply))
                {
                    _pbNew = PointButton.pbApply;
                }
            }
            if (Bed.IsUsed)
            {
                _rectBed = new Rectangle(1, 1, 30 + 26, _rectTitle.Height - 2);
            }
            else
            {
                _rectBed = new Rectangle((int)(_rectTitle.Width - 40) / 2,
                                         1, 40, _rectTitle.Height - 2);
            }

            if (MouseInRect(e.X, e.Y, _rectBed))
            {
                _pbNew = PointButton.pbTitle;
            }

            //鼠标指向的按钮没有变化
            if (pbNew != _pbNew)
            {
                if (pbNew != PointButton.pbNone)
                {
                    if (pbNew == PointButton.pbTitle)
                    {
                        ((UserControl)sender).Invalidate(_rectBed);
                    }
                    else if (pbNew == PointButton.pbHeadPage)
                    {
                        ((UserControl)sender).Invalidate(_rectHeadPage);
                    }
                    else if (pbNew == PointButton.pbTemperature)
                    {
                        ((UserControl)sender).Invalidate(_rectTemperature);
                    }
                    else if (pbNew == PointButton.pbAdvice)
                    {
                        ((UserControl)sender).Invalidate(_rectAdvice);
                    }
                    else if (pbNew == PointButton.pbApply)
                    {
                        ((UserControl)sender).Invalidate(_rectApply);
                    }
                }
                pbNew = _pbNew;
                SetButtonStatus(g, pbNew, ButtonState.bsSelected, false, Bed);
            }

            //床号变亮
            //SetButtonStatus(g, PointButton.pbTitle, ButtonState.bsSelected, false, Bed);
        }
Пример #3
0
        /// <summary>
        /// 床头卡鼠标移动事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void bed_MouseMove(object sender, MouseEventArgs e)
        {
            BedInfo     Bed    = ((BedItem)sender).Bed; //(BedInfo)((UserControl)sender).Tag;
            Graphics    g      = ((UserControl)sender).CreateGraphics();
            PointButton _pbNew = PointButton.pbNone;


            if (Bed.IsUsed && _selectedBed != null && Bed.Equals(_selectedBed))
            //if (Bed.IsUsed)
            {
                Point flpBedPoint = flpBed.PointToClient(Control.MousePosition); //鼠标相对于容器左上角的坐标
                if (MouseInRect(e.X, e.Y, _rectHeadPage))
                {
                    _pbNew = PointButton.pbHeadPage;
                    toolTip1.Show("病案首页", this, flpBedPoint.X + _rectHeadPage.Width, flpBedPoint.Y - _rectHeadPage.Height, 2000);
                }
                else if (MouseInRect(e.X, e.Y, _rectTemperature))
                {
                    _pbNew = PointButton.pbTemperature;
                    toolTip1.Show("体温单", this, flpBedPoint.X + _rectTemperature.Width, flpBedPoint.Y - _rectTemperature.Height, 2000);
                }
                else if (MouseInRect(e.X, e.Y, _rectAdvice))
                {
                    _pbNew = PointButton.pbAdvice;
                    toolTip1.Show("医嘱", this, flpBedPoint.X + _rectAdvice.Width, flpBedPoint.Y - _rectAdvice.Height, 2000);
                }
                else if (MouseInRect(e.X, e.Y, _rectApply))
                {
                    _pbNew = PointButton.pbApply;
                    toolTip1.Show("特殊申请", this, flpBedPoint.X + _rectApply.Width, flpBedPoint.Y - _rectApply.Height, 2000);
                }
            }
            if (Bed.IsUsed || !_UnUseBedNo)
            {
                _rectBed = new Rectangle(1, 1, _bedWidth, _rectTitle.Height - 2);
            }
            else
            {
                _rectBed = new Rectangle((int)(_rectTitle.Width - _bedWidth) / 2, 1, _bedWidth, _titleHeight - 2);
            }
            //_rectBed = new Rectangle(1, 1, _bedWidth, _rectTitle.Height - 2);

            if (MouseInRect(e.X, e.Y, _rectBed))
            {
                _pbNew = PointButton.pbTitle;
            }

            //鼠标指向的按钮没有变化
            if (pbNew != _pbNew)
            {
                if (pbNew != PointButton.pbNone)
                {
                    if (pbNew == PointButton.pbTitle)
                    {
                        ((UserControl)sender).Invalidate(_rectBed);
                    }
                    else if (pbNew == PointButton.pbHeadPage)
                    {
                        ((UserControl)sender).Invalidate(_rectHeadPage);
                    }
                    else if (pbNew == PointButton.pbTemperature)
                    {
                        ((UserControl)sender).Invalidate(_rectTemperature);
                    }
                    else if (pbNew == PointButton.pbAdvice)
                    {
                        ((UserControl)sender).Invalidate(_rectAdvice);
                    }
                    else if (pbNew == PointButton.pbApply)
                    {
                        ((UserControl)sender).Invalidate(_rectApply);
                    }
                }
                pbNew = _pbNew;
                SetButtonStatus(g, pbNew, ButtonState.bsSelected, false, Bed);
            }
        }