Пример #1
0
        public override void MouseMove(MouseEventArgs e)
        {
            if (FHotDomain.BeginNo >= 0)
            {
                Style.UpdateInfoRePaint();
            }

            FHotDomain.Clear();
            FDrawHotDomainRegion = false;

            base.MouseMove(e);

            if (!this.MouseMoveRestrain)
            {
                this.GetDomainFrom(this.MouseMoveItemNo, this.MouseMoveItemOffset, FHotDomain);

                HCRichData vTopData = this.GetTopLevelDataAt(e.X, e.Y) as HCRichData;
                if ((vTopData == this) || (!vTopData.FDrawHotDomainRegion))
                {
                    if (FHotDomain.BeginNo >= 0)
                    {
                        FDrawHotDomainRegion = true;
                        Style.UpdateInfoRePaint();
                    }
                }
            }
        }
Пример #2
0
        public bool InsertTable(int aRowCount, int aColCount)
        {
            HCFunction vEvent = delegate()
            {
                HCRichData vTopData = FData.GetTopLevelData() as HCRichData;
                return(vTopData.InsertTable(aRowCount, aColCount));
            };

            return(DataChangeByAction(vEvent));
        }
Пример #3
0
        protected void Paste()
        {
            IDataObject vIData = Clipboard.GetDataObject();

            if (vIData.GetDataPresent(HC.HC_EXT))
            {
                MemoryStream vStream = (MemoryStream)vIData.GetData(HC.HC_EXT);
                try
                {
                    vStream.Position = 0;
                    if (!DoPasteFormatStream(vStream))
                    {
                        return;
                    }

                    InsertLiteStream(vStream);
                }
                finally
                {
                    vStream.Close();
                    vStream.Dispose();
                }
            }
            else
            if (vIData.GetDataPresent(DataFormats.Text))
            {
                FData.InsertText(Clipboard.GetText());
            }
            else
            if (vIData.GetDataPresent(DataFormats.Bitmap))
            {
                Image vImage = (Image)vIData.GetData(typeof(Bitmap));

                HCRichData  vTopData   = FData.GetTopLevelData() as HCRichData;
                HCImageItem vImageItem = new HCImageItem(vTopData);

                vImageItem.Image = new Bitmap(vImage);

                vImageItem.Width  = vImageItem.Image.Width;
                vImageItem.Height = vImageItem.Image.Height;


                vImageItem.RestrainSize(vTopData.Width, vImageItem.Height);

                FData.InsertItem(vImageItem);
            }
        }
Пример #4
0
        protected void Paste()
        {
            IDataObject vIData = Clipboard.GetDataObject();

            if (vIData.GetDataPresent(HC.HC_EXT))
            {
                MemoryStream vStream = (MemoryStream)vIData.GetData(HC.HC_EXT);
                try
                {
                    string vFileFormat  = "";
                    ushort vFileVersion = 0;
                    byte   vLan         = 0;

                    vStream.Position = 0;
                    HC._LoadFileFormatAndVersion(vStream, ref vFileFormat, ref vFileVersion, ref vLan);  // 文件格式和版本
                    HCStyle vStyle = new HCStyle();
                    try
                    {
                        vStyle.LoadFromStream(vStream, vFileVersion);
                        this.BeginUpdate();
                        try
                        {
                            FData.InsertStream(vStream, vStyle, vFileVersion);
                        }
                        finally
                        {
                            this.EndUpdate();
                        }
                    }
                    finally
                    {
                        vStyle.Dispose();
                    }
                }
                finally
                {
                    vStream.Close();
                    vStream.Dispose();
                }
            }
            else
            if (vIData.GetDataPresent(DataFormats.Text))
            {
                FData.InsertText(Clipboard.GetText());
            }
            else
            if (vIData.GetDataPresent(DataFormats.Bitmap))
            {
                Image vImage = (Image)vIData.GetData(typeof(Bitmap));

                HCRichData  vTopData   = FData.GetTopLevelData() as HCRichData;
                HCImageItem vImageItem = new HCImageItem(vTopData);

                vImageItem.Image = new Bitmap(vImage);

                vImageItem.Width  = vImageItem.Image.Width;
                vImageItem.Height = vImageItem.Image.Height;


                vImageItem.RestrainSize(vTopData.Width, vImageItem.Height);

                FData.InsertItem(vImageItem);
            }
        }