コード例 #1
0
        void btnPreview_Click(object sender, EventArgs e)
        {
            ToolStripButton button = (ToolStripButton)sender;

            FireEditorTabItem tabItem = (FireEditorTabItem)button.Owner.Parent;

            if (button.Checked == true)
            {
                ((ToolStripButton)button.Owner.Items[0]).Checked = false;
            }

            if (!tabItem.CodeEditor.Saved)
            {
                MessageBox.Show("The file need to be saved before show a preview!");
                ((ToolStripButton)button.Owner.Items[0]).Checked = true;
                ((ToolStripButton)button.Owner.Items[1]).Checked = false;
                return;
            }

            tabItem.Controls["preview"].Visible = true;
            tabItem.Controls["preview"].BringToFront();

            tabItem.Controls["codeeditor"].Visible = false;



            ((WebBrowser)tabItem.Controls["preview"]).Navigate(tabItem.CodeEditor.FileName);
        }
コード例 #2
0
ファイル: GemixPlugin.cs プロジェクト: uvbs/FullSource
        string BuildPRG()
        {
            _Application.MainForm.OutputWindow.Show(_Application.MainForm.DockContainer,
                                                    Fireball.Docking.DockState.DockBottom);

            _Application.MainForm.OutputWindow.Clear();

            GemixCompiler compiler = new GemixCompiler();

            compiler.OutputReceived += new EventHandler(compiler_OutputReceived);

            FireEditorTabItem editor = _Application.MainForm.CurrentEditorTabItem;

            _Application.MainForm.Save();

            string prgFile = editor.CodeEditor.FileName;

            string gmxCompiler = _ConfigDocument.SelectSingleNode("gemix/compiler").InnerText;

            compiler.Start(gmxCompiler, prgFile);

            string exeFile = Path.GetFileNameWithoutExtension(prgFile) + ".exe";

            return(File.Exists(exeFile) ? exeFile : null);
        }
コード例 #3
0
ファイル: PHPPlugin.cs プロジェクト: weimingtom/pap2
 void CheckForToolbarState(FireEditorTabItem tabItem)
 {
     if (tabItem.CodeEditor.Document.Parser.Language.Name == "PHP")
     {
         phpToolBar.Enabled = true;
     }
     else
     {
         phpToolBar.Enabled = false;
     }
 }
コード例 #4
0
ファイル: FormMain.cs プロジェクト: weimingtom/pap2
        void NewMenuItems_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item = sender as ToolStripMenuItem;

            FireEditorTabItem tabItem = AddDocument();

            tabItem.CodeEditor.Document.Text = "";

            tabItem.SetSyntaxLanguage((Language)item.Tag);

            tabItem.Activate();
        }
コード例 #5
0
ファイル: FormMain.cs プロジェクト: weimingtom/pap2
        public void OpenFile(string filename)
        {
            FireEditorTabItem tabItem = this.AddDocument();

            tabItem.Open(filename);

            AddRecent(filename);

            SetAllFileNameLabel();

            tabItem.Activate();
        }
コード例 #6
0
        void FireEditorTabItem_LanguageChanged(object sender, LanguageChangedEventArgs e)
        {
            if (e.Language != null && e.Language.Name == "HTML")
            {
                FireEditorTabItem tabItem = (FireEditorTabItem)sender;

                ToolStrip myToolStrip = new ToolStrip();

                myToolStrip.Name = "switchBar";

                myToolStrip.Dock = DockStyle.Bottom;

                tabItem.Controls.Add(myToolStrip);

                tabItem.BringToFront();


                ToolStripButton btnCode = new ToolStripButton();

                btnCode.Checked = true;

                btnCode.Text = "Html Code";

                btnCode.CheckOnClick = true;

                myToolStrip.Items.Add(btnCode);

                btnCode.Click += new EventHandler(btnCode_Click);


                ToolStripButton btnPreview = new ToolStripButton();

                btnPreview.Text = "Html Preview";

                btnPreview.CheckOnClick = true;

                myToolStrip.Items.Add(btnPreview);

                btnPreview.Click += new EventHandler(btnPreview_Click);


                WebBrowser browser = new WebBrowser();

                browser.Name = "preview";

                browser.Dock = DockStyle.Fill;

                browser.Visible = false;


                tabItem.Controls.Add(browser);
            }
        }
コード例 #7
0
        void btnCode_Click(object sender, EventArgs e)
        {
            ToolStripButton button = (ToolStripButton)sender;

            FireEditorTabItem tabItem = (FireEditorTabItem)button.Owner.Parent;

            if (button.Checked == true)
            {
                ((ToolStripButton)button.Owner.Items[1]).Checked = false;
            }

            tabItem.Controls["preview"].Visible = false;

            tabItem.Controls["codeeditor"].Visible = true;
            tabItem.Controls["codeeditor"].BringToFront();
        }
コード例 #8
0
ファイル: PHPPlugin.cs プロジェクト: weimingtom/pap2
        void FireEditorTabItem_LanguageChanged(object sender, FireEdit.Docking.LanguageChangedEventArgs e)
        {
            FireEditorTabItem tabItem = (FireEditorTabItem)sender;


            if (e.Language.Name == "PHP")
            {
                tabItem.CodeEditor.KeyPress    += new System.Windows.Forms.KeyPressEventHandler(CodeEditor_KeyPress);
                tabItem.CodeEditor.KeyDown     += new System.Windows.Forms.KeyEventHandler(CodeEditor_KeyDown);
                tabItem.CodeEditor.CaretChange += new EventHandler(CodeEditor_CaretChange);
                tabItem.CodeEditor.InfoTipSelectedIndexChanged += new EventHandler(CodeEditor_InfoTipSelectedIndexChanged);
            }

            if (sender is FireEditorTabItem)
            {
                this.CheckForToolbarState((FireEditorTabItem)sender);
            }
        }
コード例 #9
0
ファイル: FormMain.cs プロジェクト: weimingtom/pap2
        void _DockContainer_ActiveDocumentChanged(object sender, EventArgs e)
        {
            this.CheckInsMode();

            FireEditDockableWindow tabItem = (FireEditDockableWindow)_DockContainer.ActiveDocument;

            this.CheckForItemState();

            if (tabItem is FireEditorTabItem)
            {
                FireEditorTabItem item = (FireEditorTabItem)tabItem;

                btnSave.Enabled = !item.CodeEditor.Saved;
            }
            else
            {
                DisableMainToolBarButtons();
            }
        }
コード例 #10
0
ファイル: GemixPlugin.cs プロジェクト: uvbs/FullSource
        void DockContainer_ActiveDocumentChanged(object sender, EventArgs e)
        {
            if (_Application.MainForm.DockContainer.ActiveDocument is FireEditorTabItem)
            {
                FireEditorTabItem tab = (FireEditorTabItem)_Application.MainForm.DockContainer.ActiveDocument;

                if (tab.CodeEditor.Document.Parser.Language.Name == "Gemix")
                {
                    _BuildMenuItem.Enabled = true;
                }
                else
                {
                    _BuildMenuItem.Enabled = false;
                }
            }
            else
            {
                _BuildMenuItem.Enabled = false;
            }
        }
コード例 #11
0
ファイル: FormMain.cs プロジェクト: weimingtom/pap2
        void tabItem_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (sender is FireEditorTabItem)
            {
                FireEditorTabItem item = (FireEditorTabItem)sender;

                if (item.CodeEditor.Saved == false)
                {
                    DialogResult rt = MessageBox.Show("File unsaved do you want to save it before close?", Application.ProductName, MessageBoxButtons.YesNoCancel);

                    if (rt == DialogResult.Yes)
                    {
                        this.Save();
                    }
                    else if (rt == DialogResult.Cancel)
                    {
                        e.Cancel = true;
                    }
                }
            }
        }
コード例 #12
0
ファイル: FormMain.cs プロジェクト: weimingtom/pap2
        public FireEditorTabItem AddDocument()
        {
            FireEditorTabItem tabItem = new FireEditorTabItem();

            tabItem.Show(_DockContainer, DockState.Document);

            tabItem.Activate();

            tabItem.FileSaved += new EventHandler(tabItem_FileSaved);

            tabItem.FormClosing += new FormClosingEventHandler(tabItem_FormClosing);

            if (NewCodeEditor != null)
            {
                NewCodeEditor(this, new NewCodeEditorEventArgs(ref tabItem));
            }


            tabItem.CodeEditor.TextChanged += new EventHandler(editorControl_TextChanged);

            return(tabItem);
        }
コード例 #13
0
 internal NewCodeEditorEventArgs(ref FireEditorTabItem tabItem)
 {
     _FireEditorTabItem = tabItem;
 }