示例#1
0
 public SymbolsViwer(ListView listView, ImageList imageList, bool showInThread, VisualPascalABCPlugins.InvokeDegegate beginInvoke,
     PascalABCCompiler.SourceFilesProviderDelegate sourceFilesProvider, VisualEnvironmentCompiler.ExecuteSourceLocationActionDelegate ExecuteSourceLocationAction)
 {
     this.listView = listView;
     this.imageList = imageList;
     this.showInThread = showInThread;
     this.beginInvoke = beginInvoke;
     this.sourceFilesProvider = sourceFilesProvider;
     this.ExecuteSourceLocationAction = ExecuteSourceLocationAction;
     listView.MouseDoubleClick += new MouseEventHandler(listView_MouseDoubleClick);
 }
示例#2
0
        private void AboutBox_Shown(object sender, EventArgs e)
        {
            lVersion.Text = string.Format("{0}, сборка {1} ({2})", PascalABCCompiler.Compiler.ShortVersion, RevisionClass.Revision, PascalABCCompiler.Compiler.VersionDateTime.ToShortDateString());
            dgvModules.Items.Clear();

            string apppatch = Path.GetDirectoryName(Application.ExecutablePath);

            VisualEnvironmentCompiler vec = (Owner as Form1).VisualEnvironmentCompiler;

            PascalABCCompiler.ICompiler comp = vec.StandartCompiler;
            if (comp != null)
            {
                Assembly a = Assembly.GetAssembly(comp.GetType());
                dgvModules.Items.Add(MakeItem("Core", "PascalABCCompiler.Core", a.GetName().Version.ToString(), "Copyright © 2005-2016 by Ivan Bondarev, Stanislav Mihalkovich"));
                foreach (PascalABCCompiler.Parsers.IParser parser in comp.ParsersController.Parsers)
                {
                    dgvModules.Items.Add(MakeItem("Parser", parser.Name, parser.Version, parser.Copyright));
                }
                foreach (PascalABCCompiler.SemanticTreeConverters.ISemanticTreeConverter conv in comp.SemanticTreeConvertersController.SemanticTreeConverters)
                {
                    dgvModules.Items.Add(MakeItem("Converter", conv.Name, conv.Version, conv.Copyright));
                }
                foreach (VisualPascalABCPlugins.IVisualPascalABCPlugin plugin in vec.PluginsController.Plugins)
                {
                    dgvModules.Items.Add(MakeItem("Plugin", plugin.Name, plugin.Version, plugin.Copyright));
                }
            }

            dgvModules.Items.Add(MakeItem(Assembly.LoadFile(Path.Combine(apppatch, "ICSharpCode.TextEditor.dll"))));
            dgvModules.Items.Add(MakeItem(Assembly.LoadFile(Path.Combine(apppatch, "Debugger.Core.dll"))));
            dgvModules.Items.Add(MakeItem(Assembly.LoadFile(Path.Combine(apppatch, "WeifenLuo.WinFormsUI.Docking.dll"))));
            ActiveControl = button1;

            /*lbComponents.Items.Clear();
             * PascalABCCompiler.Compiler comp = (Owner as Form1).VisualEnvironmentCompiler.Compiler;
             * if (comp != null)
             * {
             *  lbComponents.Items.Add(BuildComponentString(comp));
             *  foreach (PascalABCCompiler.ParserTools.BaseParser parser in comp.ParsersController.Parsers)
             *      lbComponents.Items.Add("Language: "+BuildComponentString(parser));
             *  foreach (VisualPascalABCPlugins.IVisualPascalABCPlugin plugin in (Owner as Form1).VisualEnvironmentCompiler.PluginsController.Plugins)
             *      lbComponents.Items.Add("Plugin: "+BuildComponentString(plugin));
             *  foreach (PascalABCCompiler.SemanticTreeConverters.ISemanticTreeConverter conv in (Owner as Form1).VisualEnvironmentCompiler.Compiler.SemanticTreeConvertersController.SemanticTreeConverters)
             *      lbComponents.Items.Add("Converter: " + BuildComponentString(conv));
             *
             * }*/
        }
示例#3
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            //PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName = "Russi         

            CahngedSelectedTab();


            VisualEnvironmentCompiler = new VisualEnvironmentCompiler(
                this.BeginInvoke, tabControl1, SetCompilingButtonsEnabled, SetStateText,
                AddTextToCompilerMessages, miPlugins, toolStrip1,
                ExecuteSourceLocationAction, ExecuteVisualEnvironmentCompilerAction,ErrorsManager);

            VisualEnvironmentCompiler.ChangeVisualEnvironmentState += new ChangeVisualEnvironmentStateDelegate(VisualEnvironmentCompiler_ChangeVisualEnvironmentState);

            VisualEnvironmentCompiler.RunStartingThread();

            LoadComplete = true;
        }
示例#4
0
        public Form1()
        {
            if (Tools.IsUnix())
            {
                ProjectsUseable = false;
                DesignerUseable = false;
                //DebuggerVisible = false;
            }
        	PascalABCCompiler.StringResourcesLanguage.LoadDefaultConfig();
            //if (PascalABCCompiler.StringResourcesLanguage.AccessibleLanguages.Count > 0)
            //    PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName = PascalABCCompiler.StringResourcesLanguage.AccessibleLanguages[0];
           
            InitializeComponent();
           
            VisualPABCSingleton.MainForm = this;
            WorkbenchStorage.MainProgramThread = System.Threading.Thread.CurrentThread;
            //images init
            this.miNewProject.Image = new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.NewProjectIcon.png"));
            this.mADDFILEToolStripMenuItem.Image = miNew.Image;
            this.mADDEXISTFILEToolStripMenuItem.Image = miOpen.Image;
            this.mADDFORMToolStripMenuItem.Image = new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Form.png"));
            toolStripPanel.Size = new Size(toolStripPanel.Size.Width, toolStrip1.Height);
            var gr = Graphics.FromHwnd(Handle);
            if (gr.DpiX >= 96*2)
            {
                toolStrip1.ImageScalingSize = new Size(32, 32);
                menuStrip1.ImageScalingSize = new Size(32, 32);
                toolStripPanel.Size = new Size(toolStripPanel.Size.Width, 38);
            }
            serviceContainer = new WorkbenchServiceContainer();

            if (DebuggerVisible)
            {
            	InitForm();
                this.StepOutButton.Visible = false;
                PlayPauseButtonsVisibleInPanel = PlayPauseButtonsVisibleInPanel;
                SetDebugButtonsEnabled(false);
            }
            
            AddOwnedForm(CompilerForm1 = new CompilerForm());
            AddOwnedForm(AboutBox1 = new AboutBox());
            AddOwnedForm(FindForm = new FindReplaceForm(FindReplaceForm.FormType.Find));
            AddOwnedForm(ReplaceForm = new FindReplaceForm(FindReplaceForm.FormType.Replace));
            AddOwnedForm(GotoLineForm = new GotoLineForm());
           
            LastOpenFiles = new List<string>();
            LastOpenProjects = new List<string>();

            WorkbenchServiceFactory.BuildService.CompilerOptions.Debug = true;
            WorkbenchServiceFactory.BuildService.CompilerOptions.OutputFileType = PascalABCCompiler.CompilerOptions.OutputType.ConsoleApplicaton;

            LocalizeControls();

            tsatConsoleApplication.Tag = PascalABCCompiler.CompilerOptions.OutputType.ConsoleApplicaton;
            tsatWindowsApplication.Tag = PascalABCCompiler.CompilerOptions.OutputType.WindowsApplication;
            tsatDll.Tag = PascalABCCompiler.CompilerOptions.OutputType.ClassLibrary;

            SelectAppType(WorkbenchServiceFactory.BuildService.CompilerOptions.OutputFileType);

            //this.Width = 800;
            //this.Height = 600;
            UserOptions = new UserOptions();

            visualStates = new VisualStates();

            SetFiltersAndHighlighting();
            
            FormLeft = this.Left; FormTop = this.Top; FormWidth = this.Width; FormHeight = this.Height;
			MainDockPanel.DockRightPortion = 0.22;
            MainDockPanel.DockLeftPortion = 0.22;
                
            //UserOptions.OutputDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName)+"\\Output";
            UserOptions.OutputDirectory = Constants.DefaultOutputDirectory;

            PlayPauseButtonsVisibleInPanel = false;

            WorkbenchStorage.StandartDirectories = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
            WorkbenchStorage.StandartDirectories.Add(Constants.SystemDirectoryIdent, System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName));

            RestoreDesktop();

            LoadOptions();

            HelpExamplesDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpExamplesDirectory, WorkbenchStorage.StandartDirectories);
            HelpTutorialExamplesDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpTutorialExamplesDirectory, WorkbenchStorage.StandartDirectories);

            UpdateUserOptions();
            ErrorsListWindow.Resized();
            FindSymbolsResultWindow.Resized();

            UpdateOutputWindowVisibleButtons();

            if (WorkbenchStorage.WorkingDirectory == null || true)
            {
                WorkbenchStorage.WorkingDirectoryInOptionsFile = Constants.DefaultWorkingDirectory;
                WorkbenchStorage.WorkingDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.DefaultWorkingDirectory, WorkbenchStorage.StandartDirectories);
            }
            if (Path.GetDirectoryName(Application.ExecutablePath).ToLower() != Environment.CurrentDirectory.ToLower())
                WorkbenchStorage.WorkingDirectory = Environment.CurrentDirectory;
            WorkbenchStorage.StandartDirectories.Add(Constants.WorkingDirectoryIdent, WorkbenchStorage.WorkingDirectory);
            openFileDialog1.InitialDirectory = WorkbenchStorage.WorkingDirectory;

            if (WorkbenchStorage.LibSourceDirectory == null)
                WorkbenchStorage.LibSourceDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.DefaultLibSourceDirectory, WorkbenchStorage.StandartDirectories);
            WorkbenchStorage.StandartDirectories.Add(Constants.LibSourceDirectoryIdent, WorkbenchStorage.LibSourceDirectory);
            AddSearchDebugPath(WorkbenchStorage.LibSourceDirectory);

            if (UserOptions.UseOutputDirectory)
                WorkbenchStorage.StandartDirectories.Add(Constants.OutputDirectoryIdent, UserOptions.OutputDirectory);
            else
                WorkbenchStorage.StandartDirectories.Add(Constants.OutputDirectoryIdent, null);

            RunManager RunnerManager = (WorkbenchServiceFactory.RunService as WorkbenchRunService).RunnerManager;
            VisualEnvironmentCompiler = new VisualEnvironmentCompiler(
                this.BeginInvoke, SetCompilingButtonsEnabled, SetDedugButtonsEnabled, SetStateText,
                AddTextToCompilerMessagesSync, miPlugins, toolStrip1,
                ExecuteSourceLocationAction, ExecuteVisualEnvironmentCompilerAction, ErrorsManager, RunnerManager,
                WorkbenchServiceFactory.DebuggerManager, UserOptions, WorkbenchStorage.StandartDirectories, OpenDocuments, this);
            if (OnEnvorimentEvent != null)
                OnEnvorimentEvent(EnvorimentEvent.VisualEnvironmentCompilerCreated);

            NavigationManager = new NavigationManager(ExecuteSourceLocationAction);
            NavigationManager.StateChanged += new NavigationManager.NavigationManagerStateChanged(NavigationManager_StateChanged);

            AddNewProgramToTab(MainDockPanel, InstNameNewProgramm(MainDockPanel));

            AddOptionsContent();
            Application.AddMessageFilter(this);

            if (DesignerUseable)
            {
                //miProperties.Visible = true;
                //miToolBox.Visible = true;
                //miNewAdv.Visible = true;
                miUndo.Visible = true;
            }
			this.mRPROJECTToolStripMenuItem.Visible = false;
            if (ProjectsUseable)
            {
            	miNewProject.Visible = true;
            	miRecentProjects.Visible = true;
            	//miCloseProject.Visible = true;
            	miOpenProject.Visible = true;
            }
            if (!UseImmediate)
            {
            	tsImmediateWindow.Visible = false;
            }
            this.mNEWASPToolStripMenuItem.Visible = DebugModus;
            if (!Tools.IsUnix())
                AddDesignerSidebars();

        }
 public NavigationManager(VisualEnvironmentCompiler.ExecuteSourceLocationActionDelegate ExecuteSourceLocationAction)
 {
     this.ExecuteSourceLocationAction = ExecuteSourceLocationAction;
 }