Esempio n. 1
0
        void InitializeComponents()
        {
            htmlEditor          = new HtmlEditor();
            tsbExternal         = new ToolStripButton();
            tsbEdit             = new ToolStripButton();
            toolStripSeparator1 = new ToolStripSeparator();

            //
            tsbExternal.Text         = Lang._("External");
            tsbExternal.Image        = Properties.Resources.external;
            tsbExternal.Alignment    = ToolStripItemAlignment.Right;
            tsbExternal.Overflow     = ToolStripItemOverflow.Never;
            tsbExternal.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbExternal.Click       += tsbExternal_Click;

            //
            tsbEdit.Text         = Lang._("Edit");
            tsbEdit.Image        = Properties.Resources.edit;
            tsbEdit.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;//.Image;
            tsbEdit.Click       += tsbEdit_Click;

            //
            htmlEditor.Dock         = DockStyle.Fill;
            htmlEditor.ReadOnly     = this.ReadOnly || !EditMode;
            htmlEditor.TextChanged += htmlEditor_TextChanged;

            //
            var toolStrip = htmlEditor.ToolStrip;

            toolStrip.RenderMode = ToolStripRenderMode.System;
            toolStrip.MiniMode   = !ExternalMode;
            toolStrip.Items.Insert(0, toolStripSeparator1);
            toolStrip.Items.Insert(0, tsbExternal);
            toolStrip.Items.Insert(0, tsbEdit);
            toolStrip.PriorityItems.AddRange(new ToolStripItem[] { tsbExternal, tsbEdit, toolStripSeparator1 });

            //
            ExternalDialogSize = Options.Current.GetValue(ExternalRemarkDialogSize, new Size(600, 360));
            BackColor          = SystemColors.Window;
            ForeColor          = SystemColors.WindowText;
            Controls.Add(htmlEditor);
        }
Esempio n. 2
0
 public HtmlEditToolStrip(HtmlEditor editor)
     : this()
 {
     Editor  = editor;
     htmlBox = editor.EditBox;
 }