Beispiel #1
0
        /// <summary>
        /// Creates a new editor window
        /// </summary>
        /// <param name="p">Parent window</param>
        /// <param name="openFile">File to open, null if template should be used, empty if blank should be used</param>
        public FormEditor(FormMain p, string openFile = "")
        {
            IsClosed = false;
            InitializeComponent();

            // Docking
            //dockPanel.Controls.Add(editor);
            var ed = new DockContent {
                CloseButton = false, CloseButtonVisible = false
            };

            ed.Controls.Add(editor);
            editor.Dock = DockStyle.Fill;
            ed.Show(dockPanel);

            _parent = p;
            LoadEditorSettings();

            if (openFile == null)
            {
                New(true);
            }
            else
            {
                if (!String.IsNullOrEmpty(openFile))
                {
                    OpenFile(openFile);
                }
            }

            UpdateGui();

            // Sorting the toolstrips
            toolStripMain.Location   = new Point(0, menuStripMain.Height);
            toolStripSendTo.Location = new Point(toolStripMain.Width + 3, menuStripMain.Height);

            // Adjusting the dock
            dockPanel.DockBottomPortion = 0.4;
            dockPanel.DockLeftPortion   = 0.3;
            dockPanel.DockTopPortion    = 0.4;
            dockPanel.DockRightPortion  = 0.3;

            // Adding the charmap
            _charmapWindow = new FormCharmapWindow(this, _fontCollection);
            _charmapWindow.Show(dockPanel, DockState.DockBottomAutoHide);

            // Adding the help
            _helpWindow = new FormHelpWindow(CommandsFile, _fontCollection);
            _helpWindow.Show(dockPanel, DockState.DockBottomAutoHide);
            _helpWindow.ReferenceLoaded += (o, args) => SearchReference(true);
        }
Beispiel #2
0
        /// <summary>
        /// Creates a new editor window
        /// </summary>
        /// <param name="p">Parent window</param>
        /// <param name="openFile">File to open, null if template should be used, empty if blank should be used</param>
        public FormEditor(FormMain p, string openFile = "")
        {
            IsClosed = false;
            InitializeComponent();

            // Docking
            //dockPanel.Controls.Add(editor);
            var ed = new DockContent {CloseButton = false, CloseButtonVisible = false};
            ed.Controls.Add(editor);
            editor.Dock = DockStyle.Fill;
            ed.Show(dockPanel);

            _parent = p;
            LoadEditorSettings();

            if (openFile == null)
                New(true);
            else
            {
                if (!String.IsNullOrEmpty(openFile))
                    OpenFile(openFile);
            }

            UpdateGui();

            // Sorting the toolstrips
            toolStripMain.Location = new Point(0, menuStripMain.Height);
            toolStripSendTo.Location = new Point(toolStripMain.Width + 3, menuStripMain.Height);

            // Adjusting the dock
            dockPanel.DockBottomPortion = 0.4;
            dockPanel.DockLeftPortion = 0.3;
            dockPanel.DockTopPortion = 0.4;
            dockPanel.DockRightPortion = 0.3;

            // Adding the charmap
            _charmapWindow = new FormCharmapWindow(this, _fontCollection);
            _charmapWindow.Show(dockPanel, DockState.DockBottomAutoHide);

            // Adding the help
            _helpWindow = new FormHelpWindow(CommandsFile, _fontCollection);
            _helpWindow.Show(dockPanel, DockState.DockBottomAutoHide);
            _helpWindow.ReferenceLoaded += (o, args) => SearchReference(true);
        }