Example #1
0
        protected void DoEmrViewMouseUp(object sender, MouseEventArgs e)
        {
            string vInfo = "";

            HCCustomItem vActiveItem = FEmrView.GetTopLevelItem();

            if (vActiveItem != null)
            {
                if (FEmrView.ActiveSection.ActiveData.ActiveDomain.BeginNo >= 0)
                {
                    DeGroup vDeGroup = FEmrView.ActiveSection.ActiveData.Items[
                        FEmrView.ActiveSection.ActiveData.ActiveDomain.BeginNo] as DeGroup;

                    vInfo = vDeGroup[DeProp.Name];
                }

                if (vActiveItem is DeItem)
                {
                    DeItem vDeItem = vActiveItem as DeItem;
                    if (vDeItem.StyleEx != StyleExtra.cseNone)
                    {
                        vInfo += "-" + vDeItem.GetHint();
                    }
                    else
                    if (vDeItem.Active &&
                        (vDeItem[DeProp.Index] != "") &&
                        (!vDeItem.IsSelectComplate) &&
                        (!vDeItem.IsSelectPart) &&
                        (Environment.TickCount - FMouseDownTick < 500)
                        )
                    {
                        vInfo = vInfo + "元素(" + vDeItem[DeProp.Index] + ")";

                        if (FEmrView.ActiveSection.ActiveData.ReadOnly)
                        {
                            tssDeInfo.Text = "";
                            return;
                        }

                        POINT            vPt             = FEmrView.GetActiveDrawItemViewCoord(); // 得到相对EmrView的坐标
                        HCCustomDrawItem vActiveDrawItem = FEmrView.GetTopLevelDrawItem();
                        RECT             vDrawItemRect   = vActiveDrawItem.Rect;
                        vDrawItemRect = HC.View.HC.Bounds(vPt.X, vPt.Y, vDrawItemRect.Width, vDrawItemRect.Height);

                        if (HC.View.HC.PtInRect(vDrawItemRect, new POINT(e.X, e.Y)))
                        {
                            vPt.Y = vPt.Y + FEmrView.ZoomIn(vActiveDrawItem.Height);
                            vPt.Offset(FEmrView.Left, FEmrView.Top);
                            HC.Win32.User.ClientToScreen(FEmrView.Handle, ref vPt);

                            PopupForm().PopupDeItem(vDeItem, vPt);
                        }
                    }
                }
                else
                if (vActiveItem is DeEdit)
                {
                }
                else
                if (vActiveItem is DeCombobox)
                {
                }
                else
                if (vActiveItem is DeDateTimePicker)
                {
                }
            }

            tssDeInfo.Text = vInfo;
        }