internal TextFlowSelectSession(TextFlowLayer textLayer)
 {
     //this controller control the editaible-textflow-layer
     _textLayer = textLayer;
     //write to textflow-layer with text-line-writer (handle the writing line)
     _lineEditor = new TextFlowEditWalker(textLayer);
 }
Esempio n. 2
0
 internal VisualSelectionRange(
     TextFlowLayer layer,
     EditableVisualPointInfo startPoint,
     EditableVisualPointInfo endPoint)
 {
     _layer               = layer;
     _startPoint          = startPoint;
     _endPoint            = endPoint;
     this.BackgroundColor = Color.FromArgb(150, Color.Yellow);
 }
Esempio n. 3
0
        internal TextLineBox(TextFlowLayer textFlowLayer)
        {
            _textFlowLayer    = textFlowLayer;
            _actualLineHeight = textFlowLayer.DefaultLineHeight; //we start with default line height
#if DEBUG
            this.dbugLineId = dbugLineTotalCount;
            dbugLineTotalCount++;
#endif

            OverlappedTop    = 3; //test only
            OverlappedBottom = 3; //test only
        }
Esempio n. 4
0
        internal TextFlowEditSession(TextFlowLayer textLayer) : base(textLayer)
        {
            //and record editing hx, support undo-redo
            _commandHistoryList = new DocumentCommandCollection(this);
#if DEBUG
            if (dbugEnableTextManRecorder)
            {
                _dbugActivityRecorder           = new debugActivityRecorder();
                _lineEditor.dbugTextManRecorder = _dbugActivityRecorder;
                throw new NotSupportedException();
                _dbugActivityRecorder.Start(null);
            }
#endif
        }
Esempio n. 5
0
        public TextFlowWalkerBase(TextFlowLayer flowlayer)
        {
#if DEBUG
            this.dbug_MyId = dbugTotalId;
            dbugTotalId++;
#endif

            _textFlowLayer = flowlayer;
            //flowlayer.Reflow += flowlayer_Reflow;
            _currentLine = flowlayer.GetTextLine(0);
            if (_currentLine.FirstRun != null)
            {
                _currentTextRun = _currentLine.FirstRun;
            }
        }
Esempio n. 6
0
        public TextFlowRenderBox(int width, int height, bool isMultiLine)
            : base(width, height)
        {
            var defaultRunStyle = new RunStyle();

            defaultRunStyle.FontColor = Color.Black;                                            //set default

            defaultRunStyle.ReqFont = GlobalRootGraphic.CurrentRootGfx.DefaultTextEditFontInfo; //TODO: review here

            _textLayer = new TextFlowLayer(this, defaultRunStyle);                              //presentation
            _textLayer.ContentSizeChanged += (s, e) => OnTextContentSizeChanged();

            //
            _editSession = new TextFlowEditSession(_textLayer);//controller
            _isMultiLine = isMultiLine;


            RenderBackground = RenderSelectionRange = RenderMarkers = true;
            //
            MayHasViewport  = true;
            BackgroundColor = Color.White;// Color.Transparent;
        }
Esempio n. 7
0
        public Rectangle dbugGetRectAreaOf(int beginlineNum, int beginColumnNum, int endLineNum, int endColumnNum)
        {
            TextFlowLayer flowLayer = _textLayer;
            TextLineBox   beginLine = flowLayer.GetTextLineAtPos(beginlineNum);

            if (beginLine == null)
            {
                return(Rectangle.Empty);
            }
            if (beginlineNum == endLineNum)
            {
                VisualPointInfo beginPoint = beginLine.GetTextPointInfoFromCharIndex(beginColumnNum);
                VisualPointInfo endPoint   = beginLine.GetTextPointInfoFromCharIndex(endColumnNum);
                return(new Rectangle(beginPoint.X, beginLine.Top, endPoint.X, beginLine.ActualLineHeight));
            }
            else
            {
                VisualPointInfo beginPoint = beginLine.GetTextPointInfoFromCharIndex(beginColumnNum);
                TextLineBox     endLine    = flowLayer.GetTextLineAtPos(endLineNum);
                VisualPointInfo endPoint   = endLine.GetTextPointInfoFromCharIndex(endColumnNum);
                return(new Rectangle(beginPoint.X, beginLine.Top, endPoint.X, beginLine.ActualLineHeight));
            }
        }
Esempio n. 8
0
 //TODO: review this class again
 public TextFlowEditWalker(TextFlowLayer textLayer) : base(textLayer)
 {
 }
Esempio n. 9
0
 internal void RemoveOwnerFlowLayer() => _textFlowLayer = null;