Exemplo n.º 1
0
        protected TextView(ITextNode node, IStyle style)
        {
            Node  = node;
            Style = style;

            TextStyles = Style.StyleSystem.StylesFor <TextStyleDefinition>();
        }
Exemplo n.º 2
0
 public void SetUp()
 {
     // This test uses a 11x16 font.
     styleSystem         = LayoutTestStyle.CreateStyleSystem();
     textStyleDefinition = styleSystem.StylesFor <TextStyleDefinition>();
     textStyle           = LayoutTestStyle.CreateTextStyle(styleSystem);
 }
Exemplo n.º 3
0
        public Highlight(ITextPosition offset, ITextPosition endOffset, IStyle style)
        {
            this.style   = style;
            widgetStyles = style.StyleSystem.StylesFor <TextStyleDefinition>();

            Offset    = offset;
            EndOffset = endOffset;
        }
Exemplo n.º 4
0
        protected TextWidgetBase(IUIStyle style, IDocumentEditor <TView, TDocument> editor) : base(style)
        {
            textStyles = StyleSystem.StylesFor <TextStyleDefinition>();

            ChildrenChanged += HandleOnChildrenChanged;

            DocumentEditor = editor;
            Content        = DocumentEditor.CreateDocumentView(AnchoredRect.CreateTopAnchored());

            WrapText = WrapText.Auto;
        }
Exemplo n.º 5
0
        public Caret(IUIStyle style, TView textInformation) : base(style)
        {
            if (textInformation == null)
            {
                throw new ArgumentNullException(nameof(textInformation));
            }

            styleDefinition = StyleSystem.StylesFor <TextStyleDefinition>();

            TextInformation = textInformation;
            TextInformation.Document.DocumentModified += UpdatePositions;
            startPosition = null;
            endPosition   = TextInformation.Document.CreatePosition(0, Bias.Backward);

            selectionHighlight = new Highlight <TDocument>(startPosition, endPosition, Style);
            textInformation.Highlighter.AddHighlight(selectionHighlight);

            blinkAnimation = new StepValue(0, 1)
            {
                Duration = 1, Loop = AnimationLoop.Loop
            };

            Style.ValueChanged += OnStyleChanged;
        }
Exemplo n.º 6
0
 public LineNumberWidget(IUIStyle style) : base(style)
 {
     textStyle           = StyleSystem.StylesFor <TextStyleDefinition>();
     cachedTextPositions = new List <Tuple <int, string> >();
 }