Esempio n. 1
0
        public TextRenderer(ProgressiveScroll progressiveScroll, ITextView textView, IOutliningManager outliningManager)
        {
            _progressiveScroll = progressiveScroll;
            TextVisual         = new DrawingVisual();

            _textView         = textView;
            _outliningManager = outliningManager;
            _bitmapWidth      = Options.ScrollBarWidth;
            _bitmapHeight     = 0;
            _bitmapStride     = (_bitmapWidth * _pixelFormat.BitsPerPixel + 7) / 8;
            _bitmapPixels     = null;

            _width  = _bitmapWidth;
            _height = _bitmapHeight;
            _stride = _bitmapStride;
            _pixels = null;

            _lineRatio = 1.0;
        }
Esempio n. 2
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            base.OnApply(e);

            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                // Update all ProgressiveScroll objects

                Options.ScrollBarWidth      = _scrollBarWidth;
                Options.RenderTextEnabled   = _renderTextEnabled;
                Options.CursorOpacity       = _cursorOpacity;
                Options.CursorBorderEnabled = _cursorBorderEnabled;
                Options.SplitterEnabled     = _splitterEnabled;
                Options.ErrorsEnabled       = _errorsEnabled;
                Options.AltHighlight        = _altHighlight;

                ProgressiveScroll.SettingsChanged();
            }
        }
Esempio n. 3
0
		public TextRenderer(ProgressiveScroll progressiveScroll, ITextView textView, IOutliningManager outliningManager)
		{
			_progressiveScroll = progressiveScroll;
			TextVisual = new DrawingVisual();

			_textView = textView;
			_outliningManager = outliningManager;
			_bitmapWidth = Options.ScrollBarWidth;
			_bitmapHeight = 0;
			_bitmapStride = (_bitmapWidth * _pixelFormat.BitsPerPixel + 7) / 8;
			_bitmapPixels = null;

			_width = _bitmapWidth;
			_height = _bitmapHeight;
			_stride = _bitmapStride;
			_pixels = null;

			_lineRatio = 1.0;
		}
Esempio n. 4
0
        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            if (textViewHost.TextView.Roles.ContainsAny(RejectedRoles))
            {
                return(null);
            }

            DTE dte = (DTE)ServiceProvider.GetService(typeof(DTE));

            // Hide the real scroll bar
            IWpfTextViewMargin realScrollBar =
                containerMargin.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar) as IWpfTextViewMargin;

            if (realScrollBar != null)
            {
                realScrollBar.VisualElement.MinWidth = 0.0;
                realScrollBar.VisualElement.Width    = 0.0;
            }

            IWpfTextView textView = textViewHost.TextView;

            SimpleScrollBar scrollBar = new SimpleScrollBar(
                textView,
                containerMargin,
                _scrollMapFactory);

            ProgressiveScroll progressiveScroll = new ProgressiveScroll(
                containerMargin,
                textView,
                _outliningManagerService.GetOutliningManager(textView),
                _tagAggregatorFactoryService.CreateTagAggregator <ChangeTag>(textView),
                _tagAggregatorFactoryService.CreateTagAggregator <IVsVisibleTextMarkerTag>(textView),
                _tagAggregatorFactoryService.CreateTagAggregator <IErrorTag>(textView),
                dte.Debugger,
                scrollBar,
                new ColorSet(FormatMapService.GetEditorFormatMap(textView)));

            return(progressiveScroll);
        }
Esempio n. 5
0
 private void OnFormatMappingChanged(object sender, FormatItemsEventArgs e)
 {
     ProgressiveScroll.SettingsChanged();
 }
		public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
		{
			if (textViewHost.TextView.Roles.ContainsAny(RejectedRoles))
			{
				return null;
			}

			DTE dte = (DTE) ServiceProvider.GetService(typeof (DTE));

			// Hide the real scroll bar
			IWpfTextViewMargin realScrollBar =
				containerMargin.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar) as IWpfTextViewMargin;
			if (realScrollBar != null)
			{
				realScrollBar.VisualElement.MinWidth = 0.0;
				realScrollBar.VisualElement.Width = 0.0;
			}

			IWpfTextView textView = textViewHost.TextView;

			SimpleScrollBar scrollBar = new SimpleScrollBar(
				textView,
				containerMargin,
				_scrollMapFactory);

			ProgressiveScroll progressiveScroll = new ProgressiveScroll(
				containerMargin,
				textView,
				_outliningManagerService.GetOutliningManager(textView),
				_tagAggregatorFactoryService.CreateTagAggregator<ChangeTag>(textView),
				_tagAggregatorFactoryService.CreateTagAggregator<IVsVisibleTextMarkerTag>(textView),
				_tagAggregatorFactoryService.CreateTagAggregator<IErrorTag>(textView),
				dte.Debugger,
				scrollBar,
				new ColorSet(FormatMapService.GetEditorFormatMap(textView)));

			return progressiveScroll;
		}