Beispiel #1
0
 public RichTextBoxCtrl(RichTextBoxForm rtbf)
 {
     richTextBoxForm    = rtbf;
     richTextBox1       = this;
     AllowDrop          = true;
     EnableAutoDragDrop = false;//DragDrop수정
     AcceptsTab         = true;
     HideSelection      = false;
     ScrollBars         = RichTextBoxScrollBars.Vertical;
     InitialRichTextBoxCtrl();
 }
        /// <summary>
        /// Displays RichTextBox form and fetches rich text
        /// </summary>
        /// <param name="form">Windows Form that displays rich textbox</param>
        public void ShowRichEditor(RichTextBoxForm form)
        {
            form.BackColor       = this.FillColor;
            form.FontColor       = this.PenColor;
            form.RichTextBox.Rtf = this.rtf;
            form.ShowDialog();

            if (form.Confirmed)
            {
                this.rtf = form.RichTextBox.Rtf;
            }
        }
Beispiel #3
0
        /// <summary>
        /// Edits RTF value
        /// </summary>
        /// <param name="context">Context</param>
        /// <param name="provider">Provider</param>
        /// <param name="value">RTF value of the property</param>
        /// <returns>Changed value of the property</returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService editorService = provider.GetService(
                typeof(IWindowsFormsEditorService)) as
                                                       IWindowsFormsEditorService;

            if (editorService != null)
            {
                RichTextBoxForm rtbForm = new RichTextBoxForm(false);
                rtbForm.RichTextBox.Rtf = value.ToString();
                rtbForm.editorService   = editorService;
                editorService.DropDownControl(rtbForm);

                value = rtbForm.RichTextBox.Rtf;
                rtbForm.Close();
            }
            return(value);
        }
Beispiel #4
0
        public MyTabPage(RichTextBoxForm mf, int mode)
        {
            Mode             = mode;
            mainform         = mf;
            _normalEditor    = new System.Windows.Forms.RichTextBoxCtrl(mf);
            _developerEditor = new MyRichTextBox(mf);
            //Mode (0) : Normal
            //Mode (1) : Developer Editor
            if (Mode == 0)
            {
                this._textRuler.Dock = DockStyle.Top;
                this._textRuler.Select();
                this._textRuler.BothLeftIndentsChanged    += new System.Windows.Forms.TextRuler.MultiIndentChangedEventHandler(this.tRuler_BothLeftIndentsChanged);
                this._textRuler.LeftHangingIndentChanging += new System.Windows.Forms.TextRuler.IndentChangedEventHandler(this.tRuler_LeftHangingIndentChanging);
                this._textRuler.LeftIndentChanging        += new System.Windows.Forms.TextRuler.IndentChangedEventHandler(this.tRuler_LeftIndentChanging);
                this._textRuler.RightIndentChanging       += new System.Windows.Forms.TextRuler.IndentChangedEventHandler(this.tRuler_RightIndentChanging);
                this._textRuler.RightMarginChanging       += new System.Windows.Forms.TextRuler.MarginChangedEventHandler(this.tRuler_RightMarginChanging);
                this._textRuler.TabAdded         += new System.Windows.Forms.TextRuler.TabChangedEventHandler(this.tRuler_TabAdded);
                this._textRuler.TabChanged       += new System.Windows.Forms.TextRuler.TabChangedEventHandler(this.tRuler_TabChanged);
                this._textRuler.TabRemoved       += new System.Windows.Forms.TextRuler.TabChangedEventHandler(this.tRuler_TabRemoved);
                this._textRuler.BaseColor         = Color.FromArgb(191, 205, 219);//new Color(RGB());// "191, 205, 219";
                this._textRuler.BorderColor       = Color.FromArgb(191, 205, 219);
                this._textRuler.BackColor         = Color.White;
                this._textRuler.TabsEnabled       = true;
                this._textRuler.RightIndent       = 0;
                this._textRuler.RightMargin       = -1;
                this._textRuler.LeftHangingIndent = 0;
                this._textRuler.LeftIndent        = 0;
                this._textRuler.LeftMargin        = 0;



                this._normalEditor.Dock      = DockStyle.Fill;
                this._normalEditor.TopMargin = 20;
                this._normalEditor.Text      = "";
                _normalEditor.Font           = new System.Drawing.Font("굴림", 11, FontStyle.Regular);
                this._normalEditor.Select();

                _normalEditor.TextChanged      += new EventHandler(this.NormalEditor_TextChanged);
                _normalEditor.CursorChanged    += new EventHandler(this.CursorChange);
                _normalEditor.SelectionChanged += new EventHandler(this.richTextBox1_SelectionChanged);

                _normalEditor.LinkClicked += new LinkClickedEventHandler(this.richTextBox1_LinkClicked);
                this.Controls.Add(_textRuler);
                this.Controls.Add(_normalEditor);
            }
            else
            {
                this._developerEditor.Dock = DockStyle.Fill;
                this._developerEditor.richTextBox1.Text = "";
                _developerEditor.richTextBox1.Font      = new System.Drawing.Font("굴림", 11, FontStyle.Regular);
                this._developerEditor.richTextBox1.Select();
                this._developerEditor.richTextBox1.ImeMode      = ImeMode.Off;
                _developerEditor.richTextBox1.TextChanged      += new EventHandler(this.DeveloperEditor_TextChanged);
                _developerEditor.CursorChanged                 += new EventHandler(this.CursorChange);
                _developerEditor.richTextBox1.SelectionChanged += new EventHandler(this.richTextBox1_SelectionChanged);
                _developerEditor.richTextBox1.KeyPress         += new KeyPressEventHandler(this.DeveloperEditor_KeyEvent);
                _developerEditor.richTextBox1.LinkClicked      += new LinkClickedEventHandler(this.richTextBox1_LinkClicked);

                this.Controls.Add(_developerEditor);
            }
        }
Beispiel #5
0
 public FTPSetting(RichTextBoxForm rtbf)
 {
     richTextBoxForm = rtbf;
     InitializeComponent();
 }
Beispiel #6
0
 public MyRichTextBox(RichTextBoxForm rtbf)
 {
     richTextBoxForm = rtbf;
     InitializeComponent();
 }