예제 #1
0
 void NavigationManager_StateChanged(NavigationManager sender)
 {
     NavigBackButtonsEnabled = NavigationManager.CanNavigateBackward;
     NavigForwButtonsEnabled = NavigationManager.CanNavigateForward;
 }
예제 #2
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();

        }
예제 #3
0
 public void ExecNavigateForward()
 {
     NavigationManager.NavigateForward();
 }
예제 #4
0
 internal void NavigationLocationChanged()
 {
     ICSharpCode.TextEditor.Caret c = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.Caret;
     NavigationManager.LocationChanged(c.Line + 1, c.Column + 1, CurrentSourceFileName);
 }
예제 #5
0
 public void ExecNavigateBackward()
 {
     NavigationManager.NavigateBackward();
 }