public override void LoadPanelContents()
        {
            SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.BehaviorTextEditorPanel.xfrm"));

            SharpDevelopTextEditorProperties properties = SharpDevelopTextEditorProperties.Instance;

            ((CheckBox)ControlDictionary["autoinsertCurlyBraceCheckBox"]).Checked = properties.AutoInsertCurlyBracket;
            ((CheckBox)ControlDictionary["hideMouseCursorCheckBox"]).Checked      = properties.HideMouseCursor;
            ((CheckBox)ControlDictionary["caretBehindEOLCheckBox"]).Checked       = properties.AllowCaretBeyondEOL;
            ((CheckBox)ControlDictionary["auotInsertTemplatesCheckBox"]).Checked  = properties.AutoInsertTemplates;
            ((CheckBox)ControlDictionary["cutCopyWholeLine"]).Checked             = properties.CutCopyWholeLine;

            ((CheckBox)ControlDictionary["convertTabsToSpacesCheckBox"]).Checked = properties.ConvertTabsToSpaces;

            ControlDictionary["tabSizeTextBox"].Text    = properties.TabIndent.ToString();
            ControlDictionary["indentSizeTextBox"].Text = properties.IndentationSize.ToString();

            ((ComboBox)ControlDictionary["indentStyleComboBox"]).Items.Add(StringParser.Parse("${res:Dialog.Options.IDEOptions.TextEditor.Behaviour.IndentStyle.None}"));
            ((ComboBox)ControlDictionary["indentStyleComboBox"]).Items.Add(StringParser.Parse("${res:Dialog.Options.IDEOptions.TextEditor.Behaviour.IndentStyle.Automatic}"));
            ((ComboBox)ControlDictionary["indentStyleComboBox"]).Items.Add(StringParser.Parse("${res:Dialog.Options.IDEOptions.TextEditor.Behaviour.IndentStyle.Smart}"));

            ((ComboBox)ControlDictionary["indentStyleComboBox"]).SelectedIndex = (int)properties.IndentStyle;

            ((ComboBox)ControlDictionary["mouseWhellDirectionComboBox"]).Items.Add(StringParser.Parse("${res:Dialog.Options.IDEOptions.TextEditor.Behaviour.NormalMouseDirectionRadioButton}"));
            ((ComboBox)ControlDictionary["mouseWhellDirectionComboBox"]).Items.Add(StringParser.Parse("${res:Dialog.Options.IDEOptions.TextEditor.Behaviour.ReverseMouseDirectionRadioButton}"));
            ((ComboBox)ControlDictionary["mouseWhellDirectionComboBox"]).SelectedIndex = properties.MouseWheelScrollDown ? 0 : 1;
        }
Example #2
0
        public override bool StorePanelContents()
        {
            SharpDevelopTextEditorProperties properties = SharpDevelopTextEditorProperties.Instance;

            properties.ShowInvalidLines    = ((CheckBox)ControlDictionary["showInvalidLinesCheckBox"]).Checked;
            properties.ShowLineNumbers     = ((CheckBox)ControlDictionary["showLineNumberCheckBox"]).Checked;
            properties.ShowMatchingBracket = ((CheckBox)ControlDictionary["showBracketHighlighterCheckBox"]).Checked;
            properties.UnderlineErrors     = ((CheckBox)ControlDictionary["showErrorsCheckBox"]).Checked;
            properties.ShowHorizontalRuler = ((CheckBox)ControlDictionary["showHRulerCheckBox"]).Checked;
            properties.ShowEOLMarker       = ((CheckBox)ControlDictionary["showEOLMarkersCheckBox"]).Checked;
            properties.ShowVerticalRuler   = ((CheckBox)ControlDictionary["showVRulerCheckBox"]).Checked;
            properties.ShowTabs            = ((CheckBox)ControlDictionary["showTabCharsCheckBox"]).Checked;
            properties.ShowSpaces          = ((CheckBox)ControlDictionary["showSpaceCharsCheckBox"]).Checked;
            properties.CaretLine           = ((CheckBox)ControlDictionary["showCaretLineCheckBox"]).Checked;

            try {
                properties.VerticalRulerRow = Int32.Parse(ControlDictionary["vRulerRowTextBox"].Text);
            } catch (Exception) {
            }

            properties.LineViewerStyle      = (LineViewerStyle)((ComboBox)ControlDictionary["lineMarkerStyleComboBox"]).SelectedIndex;
            properties.BracketMatchingStyle = (BracketMatchingStyle)((ComboBox)ControlDictionary["bracketMatchingStyleComboBox"]).SelectedIndex;

            IViewContent activeViewContent = WorkbenchSingleton.Workbench.ActiveViewContent;

            if (activeViewContent is ITextEditorControlProvider)
            {
                TextEditorControl textarea = ((ITextEditorControlProvider)activeViewContent).TextEditorControl;
                textarea.OptionsChanged();
            }

            return(true);
        }
Example #3
0
        public override void LoadPanelContents()
        {
            SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.MarkersTextEditorPanel.xfrm"));

            SharpDevelopTextEditorProperties properties = SharpDevelopTextEditorProperties.Instance;

            ((CheckBox)ControlDictionary["showLineNumberCheckBox"]).Checked         = properties.ShowLineNumbers;
            ((CheckBox)ControlDictionary["showInvalidLinesCheckBox"]).Checked       = properties.ShowInvalidLines;
            ((CheckBox)ControlDictionary["showBracketHighlighterCheckBox"]).Checked = properties.ShowMatchingBracket;
            ((CheckBox)ControlDictionary["showErrorsCheckBox"]).Checked             = properties.UnderlineErrors;
            ((CheckBox)ControlDictionary["showHRulerCheckBox"]).Checked             = properties.ShowHorizontalRuler;
            ((CheckBox)ControlDictionary["showEOLMarkersCheckBox"]).Checked         = properties.ShowEOLMarker;
            ((CheckBox)ControlDictionary["showVRulerCheckBox"]).Checked             = properties.ShowVerticalRuler;
            ((CheckBox)ControlDictionary["showTabCharsCheckBox"]).Checked           = properties.ShowTabs;
            ((CheckBox)ControlDictionary["showSpaceCharsCheckBox"]).Checked         = properties.ShowSpaces;
            ((CheckBox)ControlDictionary["showCaretLineCheckBox"]).Checked          = properties.CaretLine;

            ControlDictionary["vRulerRowTextBox"].Text = properties.VerticalRulerRow.ToString();


            ((ComboBox)ControlDictionary["lineMarkerStyleComboBox"]).Items.Add(ResourceService.GetString("Dialog.Options.IDEOptions.TextEditor.Markers.LineViewerStyle.None"));
            ((ComboBox)ControlDictionary["lineMarkerStyleComboBox"]).Items.Add(ResourceService.GetString("Dialog.Options.IDEOptions.TextEditor.Markers.LineViewerStyle.FullRow"));
            ((ComboBox)ControlDictionary["lineMarkerStyleComboBox"]).SelectedIndex = (int)properties.LineViewerStyle;



            ((ComboBox)ControlDictionary["bracketMatchingStyleComboBox"]).Items.Add(ResourceService.GetString("Dialog.Options.IDEOptions.TextEditor.Markers.BracketMatchingStyle.BeforeCaret"));
            ((ComboBox)ControlDictionary["bracketMatchingStyleComboBox"]).Items.Add(ResourceService.GetString("Dialog.Options.IDEOptions.TextEditor.Markers.BracketMatchingStyle.AfterCaret"));
            ((ComboBox)ControlDictionary["bracketMatchingStyleComboBox"]).SelectedIndex = (int)properties.BracketMatchingStyle;
        }
Example #4
0
        public override bool StorePanelContents()
        {
            SharpDevelopTextEditorProperties properties = SharpDevelopTextEditorProperties.Instance;

            if (((CheckBox)ControlDictionary["enableAAFontRenderingCheckBox"]).Enabled)
            {
                properties.TextRenderingHint = ((CheckBox)ControlDictionary["enableAAFontRenderingCheckBox"]).Checked
                                        ? TextRenderingHint.ClearTypeGridFit : TextRenderingHint.SystemDefault;
            }
            else
            {
                properties.TextRenderingHint = TextRenderingHint.SystemDefault;
            }
            properties.MouseWheelTextZoom = ((CheckBox)ControlDictionary["mouseWheelZoomCheckBox"]).Checked;
            //((Properties)CustomizationObject).Set("EnableCodeCompletion", ((CheckBox)ControlDictionary["enableCodeCompletionCheckBox"]).Checked);
            properties.EnableFolding = ((CheckBox)ControlDictionary["enableFoldingCheckBox"]).Checked;
            Font currentFont = CurrentFont;

            if (currentFont != null)
            {
                properties.Font = currentFont;
            }
            properties.EncodingCodePage           = CharacterEncodings.GetCodePageByIndex(((ComboBox)ControlDictionary["textEncodingComboBox"]).SelectedIndex);
            properties.ShowQuickClassBrowserPanel = ((CheckBox)ControlDictionary["showQuickClassBrowserCheckBox"]).Checked;

            IViewContent activeViewContent = WorkbenchSingleton.Workbench.ActiveViewContent;

            if (activeViewContent is ITextEditorControlProvider)
            {
                TextEditorControl textarea = ((ITextEditorControlProvider)activeViewContent).TextEditorControl;
                textarea.OptionsChanged();
            }
            return(true);
        }
        public override bool StorePanelContents()
        {
            SharpDevelopTextEditorProperties properties = SharpDevelopTextEditorProperties.Instance;

            properties.ConvertTabsToSpaces  = ((CheckBox)ControlDictionary["convertTabsToSpacesCheckBox"]).Checked;
            properties.MouseWheelScrollDown = ((ComboBox)ControlDictionary["mouseWhellDirectionComboBox"]).SelectedIndex == 0;

            properties.AutoInsertCurlyBracket = ((CheckBox)ControlDictionary["autoinsertCurlyBraceCheckBox"]).Checked;
            properties.HideMouseCursor        = ((CheckBox)ControlDictionary["hideMouseCursorCheckBox"]).Checked;
            properties.AllowCaretBeyondEOL    = ((CheckBox)ControlDictionary["caretBehindEOLCheckBox"]).Checked;
            properties.AutoInsertTemplates    = ((CheckBox)ControlDictionary["auotInsertTemplatesCheckBox"]).Checked;
            properties.CutCopyWholeLine       = ((CheckBox)ControlDictionary["cutCopyWholeLine"]).Checked;

            properties.IndentStyle = (IndentStyle)((ComboBox)ControlDictionary["indentStyleComboBox"]).SelectedIndex;

            try {
                int tabSize = Int32.Parse(ControlDictionary["tabSizeTextBox"].Text);

                // FIX: don't allow to set tab size to zero as this will cause divide by zero exceptions in the text control.
                // Zero isn't a setting that makes sense, anyway.
                if (tabSize > 0)
                {
                    properties.TabIndent = tabSize;
                }
            } catch (Exception) {
            }

            try {
                properties.IndentationSize = Int32.Parse(ControlDictionary["indentSizeTextBox"].Text);
            } catch (Exception) {
            }

            IViewContent activeViewContent = WorkbenchSingleton.Workbench.ActiveViewContent;

            if (activeViewContent is ITextEditorControlProvider)
            {
                TextEditorControl textarea = ((ITextEditorControlProvider)activeViewContent).TextEditorControl;
                textarea.OptionsChanged();
            }

            return(true);
        }
Example #6
0
        public override void LoadPanelContents()
        {
            SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.GeneralTextEditorPanel.xfrm"));

            fontListComboBox = ((ComboBox)ControlDictionary["fontListComboBox"]);
            fontSizeComboBox = ((ComboBox)ControlDictionary["fontSizeComboBox"]);

            SharpDevelopTextEditorProperties properties = SharpDevelopTextEditorProperties.Instance;

            ((CheckBox)ControlDictionary["enableFoldingCheckBox"]).Checked         = properties.EnableFolding;
            ((CheckBox)ControlDictionary["showQuickClassBrowserCheckBox"]).Checked = properties.ShowQuickClassBrowserPanel;

            if (IsClearTypeEnabled)
            {
                // Somehow, SingleBitPerPixelGridFit still renders as Cleartype if cleartype is enabled
                // and we're using the TextRenderer for rendering.
                // So we cannot support not using antialiasing if system-wide font smoothening is enabled.
                ((CheckBox)ControlDictionary["enableAAFontRenderingCheckBox"]).Checked = true;
                ((CheckBox)ControlDictionary["enableAAFontRenderingCheckBox"]).Enabled = false;
            }
            else
            {
                ((CheckBox)ControlDictionary["enableAAFontRenderingCheckBox"]).Checked =
                    (properties.TextRenderingHint == TextRenderingHint.AntiAliasGridFit || properties.TextRenderingHint == TextRenderingHint.ClearTypeGridFit);
            }

            ((CheckBox)ControlDictionary["mouseWheelZoomCheckBox"]).Checked = properties.MouseWheelTextZoom;

            foreach (String name in CharacterEncodings.Names)
            {
                ((ComboBox)ControlDictionary["textEncodingComboBox"]).Items.Add(name);
            }
            int encodingIndex = 0;

            try {
                encodingIndex = CharacterEncodings.GetEncodingIndex(properties.EncodingCodePage);
            } catch {
                encodingIndex = CharacterEncodings.GetEncodingIndex(Encoding.UTF8.CodePage);
            }
            ((ComboBox)ControlDictionary["textEncodingComboBox"]).SelectedIndex = encodingIndex;

            for (int i = 6; i <= 24; ++i)
            {
                fontSizeComboBox.Items.Add(i);
            }

            fontSizeComboBox.TextChanged += new EventHandler(UpdateFontPreviewLabel);
            fontSizeComboBox.Enabled      = false;

            fontListComboBox.Enabled               = false;
            fontListComboBox.TextChanged          += new EventHandler(UpdateFontPreviewLabel);
            fontListComboBox.SelectedIndexChanged += new EventHandler(UpdateFontPreviewLabel);

            Font currentFont = FontSelectionPanel.ParseFont(properties.FontContainer.DefaultFont.ToString());

            helper = new FontSelectionPanelHelper(fontSizeComboBox, fontListComboBox, currentFont);

            fontListComboBox.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(helper.MeasureComboBoxItem);
            fontListComboBox.DrawItem    += new System.Windows.Forms.DrawItemEventHandler(helper.ComboBoxDrawItem);

            UpdateFontPreviewLabel(null, null);
            helper.StartThread();
        }