Ejemplo n.º 1
0
        /// <summary>
        /// 获得输入焦点
        /// </summary>
        public override void Focus()
        {
            DomElement firstElement = this.FirstContentElement;

            if (firstElement != null)
            {
                DomDocumentContentElement dce = this.DocumentContentElement;
                dce.SetSelection(firstElement.ViewIndex, 0);
            }
        }
Ejemplo n.º 2
0
        internal void ClearContent()
        {
            this.Elements.Clear();
            DomDocumentContentElement ce = this.Body;

            ce.AppendChildElement(this.OwnerDocument.CreateParagraphEOF());
            ce.UpdateContentElements(true);
            ce.SetSelection(0, 0);

            ce = this.Header;
            ce.FixElements();
            DocumentContentStyle style = new DocumentContentStyle();

            ce.UpdateContentElements(true);
            ce.SetSelection(0, 0);

            ce = this.Footer;
            ce.FixElements();
            ce.UpdateContentElements(true);
            ce.SetSelection(0, 0);
        }
Ejemplo n.º 3
0
        private bool DragBounds(DragPointStyle hit)
        {
            MouseCapturer cap = new MouseCapturer(this.OwnerDocument.EditorControl);

            cap.Tag             = hit;
            cap.ReversibleShape = ReversibleShapeStyle.Custom;
            cap.Draw           += new CaptureMouseMoveEventHandler(cap_Draw);
            DomDocumentContentElement ce = this.DocumentContentElement;

            if (cap.CaptureMouseMove())
            {
                if (LastDragBounds.Width > 0 && LastDragBounds.Height > 0)
                {
                    if (LastDragBounds.Width != this.Width ||
                        LastDragBounds.Height != this.Height)
                    {
                        System.Drawing.SizeF OldSize = new System.Drawing.SizeF(
                            this.Width,
                            this.Height);
                        this.InvalidateView();
                        this.EditorSize = new SizeF(LastDragBounds.Width, LastDragBounds.Height);
                        this.InvalidateView();
                        ce.SetSelection(this.ViewIndex, 1);
                        if (this.OwnerDocument.BeginLogUndo())
                        {
                            this.OwnerDocument.UndoList.AddProperty(
                                XTextUndoStyles.EditorSize,
                                OldSize,
                                new System.Drawing.SizeF(this.Width, this.Height),
                                this);
                            this.OwnerDocument.EndLogUndo();
                        }
                        this.ContentElement.RefreshPrivateContent(
                            this.ContentElement.PrivateContent.IndexOf(this));
                        //ce.RefreshPrivateContent(ce.Content.IndexOf(this));
                        this.OwnerDocument.Modified = true;
                        return(true);
                    }
                }
            }
            return(false);
        }