Beispiel #1
0
        public CompilerMessageView()
        {
            instance = this;

            AddCategory(TaskService.BuildMessageViewCategory);

            textEditor.IsReadOnly = true;

            textEditor.ContextMenu = MenuService.CreateContextMenu(this, "/SharpDevelop/Pads/CompilerMessageView/ContextMenu");

            properties = (Properties)PropertyService.Get(OutputWindowOptionsPanel.OutputWindowsProperty, new Properties());

            var font = FontSelectionPanel.ParseFont(properties.Get("DefaultFont", Core.WinForms.WinFormsResourceService.DefaultMonospacedFont.ToString()).ToString());

            textEditor.FontFamily       = new FontFamily(font.FontFamily.Name);
            textEditor.FontSize         = Math.Round(font.Size * 96.0 / 72.0);
            properties.PropertyChanged += new PropertyChangedEventHandler(PropertyChanged);

            MessageViewLinkElementGenerator.RegisterGenerators(textEditor.TextArea.TextView);
            textEditor.TextArea.TextView.ElementGenerators.OfType <LinkElementGenerator>().ForEach(x => x.RequireControlModifierForClick = false);

            toolStrip = ToolBarService.CreateToolBar(panel, this, "/SharpDevelop/Pads/CompilerMessageView/Toolbar");
            toolStrip.SetValue(DockPanel.DockProperty, Dock.Top);

            panel.Children.Add(toolStrip);
            panel.Children.Add(textEditor);

            SetWordWrap();
            DisplayActiveCategory();
            ProjectService.SolutionLoaded += SolutionLoaded;

            textEditor.TextArea.DefaultInputHandler.NestedInputHandlers.Add(new SearchInputHandler(textEditor.TextArea));
        }
Beispiel #2
0
 /// <summary>
 /// Changes wordwrap settings if that property has changed.
 /// </summary>
 void PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.Key == "WordWrap")
     {
         SetWordWrap();
         ToolbarService.UpdateToolbar(toolStrip);
     }
     if (e.Key == "DefaultFont")
     {
         textEditorControl.Font = FontSelectionPanel.ParseFont(properties.Get("DefaultFont", WinFormsResourceService.DefaultMonospacedFont.ToString()).ToString());
     }
 }
Beispiel #3
0
        /// <summary>
        /// Changes wordwrap settings if that property has changed.
        /// </summary>
        void PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.Key == "WordWrap")
            {
                SetWordWrap();
                ToolBarService.UpdateStatus(toolStrip.Items);
            }
            if (e.Key == "DefaultFont")
            {
                var font = FontSelectionPanel.ParseFont(properties.Get("DefaultFont", Core.WinForms.WinFormsResourceService.DefaultMonospacedFont.ToString()).ToString());

                textEditor.FontFamily = new FontFamily(font.FontFamily.Name);
                textEditor.FontSize   = Math.Round(font.Size * 96.0 / 72.0);
            }
        }
Beispiel #4
0
        public CompilerMessageView()
        {
            instance = this;

            AddCategory(TaskService.BuildMessageViewCategory);

            myPanel.SuspendLayout();
            textEditorControl.Dock         = DockStyle.Fill;
            textEditorControl.BorderStyle  = BorderStyle.FixedSingle;
            textEditorControl.BackColor    = SystemColors.Window;
            textEditorControl.LinkClicked += delegate(object sender, LinkClickedEventArgs e) {
                FileService.OpenFile("browser://" + e.LinkText);
            };

            // auto-scrolling on RichTextBox only works when HideSelection=false.
            // See comments to http://weblogs.asp.net/jdanforth/archive/2004/01/23/62026.aspx
            textEditorControl.HideSelection = false;

            textEditorControl.ReadOnly = true;

            textEditorControl.ContextMenuStrip = MenuService.CreateContextMenu(this, "/SharpDevelop/Pads/CompilerMessageView/ContextMenu");

            properties = (Properties)PropertyService.Get(OutputWindowOptionsPanel.OutputWindowsProperty, new Properties());

            textEditorControl.Font      = FontSelectionPanel.ParseFont(properties.Get("DefaultFont", WinFormsResourceService.DefaultMonospacedFont.ToString()).ToString());
            properties.PropertyChanged += new PropertyChangedEventHandler(PropertyChanged);

            //textEditorControl.ActiveTextAreaControl.TextArea.DoubleClick += TextEditorControlDoubleClick;
            textEditorControl.DoubleClick += TextEditorControlDoubleClick;

            toolStrip           = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/CompilerMessageView/Toolbar");
            toolStrip.Stretch   = true;
            toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;

            myPanel.Controls.AddRange(new Control[] { textEditorControl, toolStrip });

            SetWordWrap();
            myPanel.ResumeLayout(false);
            DisplayActiveCategory();
            ProjectService.SolutionLoaded += SolutionLoaded;
        }