Ejemplo n.º 1
0
        /// <summary>
        /// Computes the layout of all visible text spans and stores them the
        /// member variable 'visibleLines'. This includes a final partial item on the end.
        /// </summary>
        /// <param name="g"></param>
        protected void ComputeLayout(Graphics g)
        {
            var m      = model ?? new EmptyEditorModel();
            var oldPos = m.CurrentPosition;

            GetStyleStack().PushStyle(StyleClass);
            this.layout = TextViewLayout.VisibleLines(m, ClientSize, g, Font, GetStyleStack());
            GetStyleStack().PopStyle();
            m.MoveToLine(oldPos, 0);
        }
Ejemplo n.º 2
0
 public TextViewPainter(TextViewLayout outer, Graphics g, Color fgColor, Color bgColor, Font defaultFont, StyleStack styleStack)
 {
     this.outer          = outer;
     this.graphics       = g;
     this.defaultFgColor = fgColor;
     this.defaultBgColor = bgColor;
     this.defaultFont    = defaultFont;
     this.styleStack     = styleStack;
     this.useGdiPlus     = false;
 }
Ejemplo n.º 3
0
 public TextViewPainter(TextViewLayout outer, Graphics g, Color fgColor, Color bgColor, Font defaultFont, StyleStack styleStack)
 {
     this.outer = outer;
     this.graphics = g;
     this.defaultFgColor = fgColor;
     this.defaultBgColor = bgColor;
     this.defaultFont = defaultFont;
     this.styleStack = styleStack;
     this.useGdiPlus = false;
 }
Ejemplo n.º 4
0
        private LayoutSpan spanHover;       // The span over which the mouse is hovering.

        public TextView()
        {
            InitializeComponent();

            base.DoubleBuffered        = true;
            this.Selection             = new TextSelection(this);
            this.model                 = new EmptyEditorModel();
            this.stringFormat          = StringFormat.GenericTypographic;
            this.layout                = new TextViewLayout(model, this.Font);
            this.vScroll.ValueChanged += vScroll_ValueChanged;
        }
Ejemplo n.º 5
0
        public TextView()
        {
            InitializeComponent();

            base.DoubleBuffered = true;
            this.Selection = new TextSelection(this);
            this.model = new EmptyEditorModel();
            this.stringFormat = StringFormat.GenericTypographic;
            this.layout = new TextViewLayout(model, this.Font);
            this.vScroll.ValueChanged += vScroll_ValueChanged;
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Computes the layout of all visible text spans and stores them the 
 /// member variable 'visibleLines'. This includes a final partial item on the end.
 /// </summary>
 /// <param name="g"></param>
 protected void ComputeLayout(Graphics g)
 {
     var m = model ?? new EmptyEditorModel();
     var oldPos = m.CurrentPosition;
     GetStyleStack().PushStyle(StyleClass);
     this.layout = TextViewLayout.VisibleLines(m, ClientSize, g, Font, GetStyleStack());
     GetStyleStack().PopStyle();
     m.MoveToLine(oldPos, 0);
 }