示例#1
0
文件: TextView.cs 项目: nemerle/reko
        /// <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);
        }
示例#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;
 }
示例#3
0
文件: TextView.cs 项目: nemerle/reko
        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;
        }