Ejemplo n.º 1
0
        /// <summary>
        /// Create those controls that are not set u via the designer.
        /// </summary>
        void SetupComponents()
        {
            findReplaceMgr = new FindReplaceNoWPF.FindReplaceMgr();
            //findReplaceMgr.Editors = new object[] { new FindReplaceNoWPF.TextEditorAdapter(txtCode) };
            findReplaceMgr.CurrentEditor = new FindReplaceNoWPF.TextEditorAdapter(txtCode);
            findReplaceMgr.SearchIn      = FindReplaceNoWPF.FindReplaceMgr.SearchScope.CurrentDocument;
            findReplaceMgr.OwnerWindow   = this;

            CreateContextMenu();
            lblCompileInfo.TextAlign         = ContentAlignment.MiddleLeft;
            splitContainer2.Panel2.BackColor = ScrollPanel.BackColor = Color.FromArgb(0x30, 0x30, 0x30);
            rasterControl1 = new RasterControl();
            ScrollPanel.Controls.Add(rasterControl1);
            splitContainer2.Panel2.Controls.Add(ScrollPanel);


            rasterControl1.Rasterizer = rasterControl1.TheRasterModel;

            //splitContainer2.Panel2.Controls.Add(new ZoomCtrl() {Width=200,Visible=true});

            rasterControl1.Visible = true;

            snippetList1              = new SnippetList();
            snippetList1.Visible      = true;
            snippetList1.Dock         = DockStyle.Fill;
            snippetList1.OnInsert    += new EventHandler <TikzEdt.Snippets.InsertEventArgs>(snippetList1_OnInsert);
            snippetList1.OnUseStyles += new EventHandler <TikzEdt.Snippets.UseStylesEventArgs>(snippetList1_OnUseStyles);
            splitContainer1.Panel1.Controls.Add(snippetList1);

            fileViewer = new FileViewer()
            {
                Dock = DockStyle.Fill, Visible = false
            };
            splitContainer1.Panel1.Controls.Add(fileViewer);
            fileViewer.OnFileSelect += new EventHandler <FileViewer.FileSelectEventArgs>(fileViewer_OnFileSelect);

            dynamicPreamble = new DynamicPreamble()
            {
                Dock = DockStyle.Fill, Visible = false, PreamblesFile = Consts.DynPreamblesFileFullPath
            };
            splitContainer1.Panel1.Controls.Add(dynamicPreamble);

            txtCode.SetHighlighting("Tikz");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create those controls that are not set u via the designer.
        /// </summary>
        void SetupComponents()
        {
            findReplaceMgr = new FindReplaceNoWPF.FindReplaceMgr();
            //findReplaceMgr.Editors = new object[] { new FindReplaceNoWPF.TextEditorAdapter(txtCode) };
            findReplaceMgr.CurrentEditor = new FindReplaceNoWPF.TextEditorAdapter(txtCode);
            findReplaceMgr.SearchIn = FindReplaceNoWPF.FindReplaceMgr.SearchScope.CurrentDocument;
            findReplaceMgr.OwnerWindow = this;

            CreateContextMenu();
            lblCompileInfo.TextAlign = ContentAlignment.MiddleLeft;
            splitContainer2.Panel2.BackColor = ScrollPanel.BackColor = Color.FromArgb(0x30, 0x30, 0x30);
            rasterControl1 = new RasterControl();
            ScrollPanel.Controls.Add(rasterControl1);
            splitContainer2.Panel2.Controls.Add(ScrollPanel);


            rasterControl1.Rasterizer = rasterControl1.TheRasterModel;
	
		//splitContainer2.Panel2.Controls.Add(new ZoomCtrl() {Width=200,Visible=true});
           
			rasterControl1.Visible = true;

            snippetList1 = new SnippetList();
            snippetList1.Visible = true;
            snippetList1.Dock = DockStyle.Fill;
            snippetList1.OnInsert += new EventHandler<TikzEdt.Snippets.InsertEventArgs>(snippetList1_OnInsert);
            snippetList1.OnUseStyles += new EventHandler<TikzEdt.Snippets.UseStylesEventArgs>(snippetList1_OnUseStyles);
            splitContainer1.Panel1.Controls.Add(snippetList1);

            fileViewer = new FileViewer() { Dock = DockStyle.Fill, Visible = false };
            splitContainer1.Panel1.Controls.Add(fileViewer);
            fileViewer.OnFileSelect += new EventHandler<FileViewer.FileSelectEventArgs>(fileViewer_OnFileSelect);

            dynamicPreamble = new DynamicPreamble() { Dock = DockStyle.Fill, Visible = false, PreamblesFile = Consts.DynPreamblesFileFullPath };
            splitContainer1.Panel1.Controls.Add(dynamicPreamble);

            txtCode.SetHighlighting("Tikz");

        }
Ejemplo n.º 3
0
 void fileViewer_OnFileSelect(object sender, FileViewer.FileSelectEventArgs e)
 {
     if (e.InExternalViewer)
     {
         try
         {
             System.Diagnostics.Process.Start(e.FileName);
         }
         catch (Exception)
         {
             GlobalUI.UI.ShowMessageBox("Couldn't open file: " + e.FileName + ".", "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
         }
     }
     else
         TheVM.Open(e.FileName, e.InNewInstance);
 }