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); }
internal VisualSelectionRange( TextFlowLayer layer, EditableVisualPointInfo startPoint, EditableVisualPointInfo endPoint) { _layer = layer; _startPoint = startPoint; _endPoint = endPoint; this.BackgroundColor = Color.FromArgb(150, Color.Yellow); }
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 }
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 }
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; } }
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; }
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)); } }
//TODO: review this class again public TextFlowEditWalker(TextFlowLayer textLayer) : base(textLayer) { }
internal void RemoveOwnerFlowLayer() => _textFlowLayer = null;