public ProjectExplorerForm() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); var sc = ScreenScale.Calc(); if (sc >= 1.99) { this.tvProjectExplorer.ImageList = this.imageList2; } this.tvProjectExplorer.LabelEdit = true; this.tvProjectExplorer.BeforeLabelEdit += tvProjectExplorer_BeforeLabelEdit; this.Icon = new System.Drawing.Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.PadIcons.ProjectBrowser.ico")); pRJBUILDToolStripMenuItem.Image = VisualPABCSingleton.MainForm.BuildImage; pRJBUILDALLToolStripMenuItem.Image = VisualPABCSingleton.MainForm.RebuildImage; pRJRUNToolStripMenuItem.Image = VisualPABCSingleton.MainForm.RunImage; pRJNEWFILEToolStripMenuItem.Image = VisualPABCSingleton.MainForm.NewFileImage; pRJOPENToolStripMenuItem.Image = VisualPABCSingleton.MainForm.OpenFileImage; pRJFORMToolStripMenuItem.Image = VisualPABCSingleton.MainForm.NewFormImage; Form1StringResources.SetTextForAllControls(this.AddReferenceMenuStrip); Form1StringResources.SetTextForAllControls(this.ProjectMenuStrip); Form1StringResources.SetTextForAllControls(this.ReferenceMenuStrip); Form1StringResources.SetTextForAllControls(this.SouceFileMenuStrip); this.tvProjectExplorer.AfterLabelEdit += new NodeLabelEditEventHandler(LabelEditFinished); }
public static void NewFile(ProjectExplorerForm ProjectExplorerWindow) { NewFileForm frm = new NewFileForm(); Form1StringResources.SetTextForAllControls(frm); frm.FileName = ProjectFactory.Instance.GetUnitFileName(); frm.SetUnitFilter(); if (frm.ShowDialog() == DialogResult.OK) { PascalABCCompiler.IFileInfo fi = ProjectFactory.Instance.AddSourceFile(frm.FileName); ProjectExplorerWindow.AddSourceFile(fi, false); string full_file_name = Path.Combine(Path.GetDirectoryName(ProjectFactory.Instance.CurrentProject.Path), frm.FileName); StreamWriter sw = File.CreateText(full_file_name); if (frm.GetFileFilter() == FileType.Unit) { sw.WriteLine("unit " + Path.GetFileNameWithoutExtension(frm.FileName) + ";"); sw.WriteLine(); sw.WriteLine("interface"); sw.WriteLine(); sw.WriteLine("implementation"); sw.WriteLine(); sw.Write("end."); } else { sw.WriteLine("namespace " + ProjectFactory.Instance.CurrentProject.Name + ";"); sw.WriteLine(); sw.Write("end."); ProjectFactory.Instance.AddNamespaceFileReference(full_file_name); } sw.Close(); WorkbenchServiceFactory.FileService.OpenFile(full_file_name, null); } }
private void AddFindSymbolsResultWindow() { if (FindSymbolsResultWindow == null) { FindSymbolsResultWindow = new FindSymbolsResultWindowForm(this); Form1StringResources.SetTextForAllControls(FindSymbolsResultWindow); } AddWindowToDockPanel(FindSymbolsResultWindow, MainDockPanel, OutputWindow.Dock, DockState.DockBottom, OutputWindow.IsFloat, BottomPane, int.MaxValue); }
private void AddCompilerConsoleWindow() { if (CompilerConsoleWindow == null) { CompilerConsoleWindow = new CompilerConsoleWindowForm(this); Form1StringResources.SetTextForAllControls(CompilerConsoleWindow); } AddWindowToDockPanel(CompilerConsoleWindow, MainDockPanel, OutputWindow.Dock, DockState.DockBottom, OutputWindow.IsFloat, BottomPane, int.MaxValue); }
void AddDebugVariablesListWindow() { if (DebugVariablesListWindow == null) { DebugVariablesListWindow = new DebugVariablesListWindowForm(this); Form1StringResources.SetTextForAllControls(DebugVariablesListWindow); } AddWindowToDockPanel(DebugVariablesListWindow, MainDockPanel, OutputWindow.Dock, DockState.DockBottom, OutputWindow.IsFloat, BottomPane, int.MaxValue); }
private void AddImmediateWindow() { if (ImmediateWindow == null) { ImmediateWindow = new ImmediateWindow(this); Form1StringResources.SetTextForAllControls(ImmediateWindow); } AddWindowToDockPanel(ImmediateWindow, MainDockPanel, OutputWindow.Dock, DockState.DockBottom, OutputWindow.IsFloat, BottomPane, int.MaxValue); }
private void AddErrorsListWindow() { if (ErrorsListWindow == null) { ErrorsListWindow = new ErrorsListWindowForm(this); Form1StringResources.SetTextForAllControls(ErrorsListWindow); } AddWindowToDockPanel(ErrorsListWindow, MainDockPanel, OutputWindow.Dock, DockState.DockBottom, OutputWindow.IsFloat, BottomPane, int.MaxValue); }
void AddDisassemblyWindow() { if (DisassemblyWindow == null) { DisassemblyWindow = new DisassemblyWindow(this); Form1StringResources.SetTextForAllControls(DisassemblyWindow); } AddWindowToDockPanel(DisassemblyWindow, MainDockPanel, OutputWindow.Dock, DockState.DockBottom, OutputWindow.IsFloat, BottomPane, int.MaxValue); }
private void AddOutputWindow() { if (OutputWindow == null) { OutputWindow = new OutputWindowForm(this); Form1StringResources.SetTextForAllControls(OutputWindow); } BottomPane = null; AddWindowToDockPanel(OutputWindow, MainDockPanel, OutputWindow.Dock, DockState.DockBottom, OutputWindow.IsFloat, BottomPane, -1); BottomPane = OutputWindow.Pane; }
void AddProjectExplorerWindow() { if (ProjectExplorerWindow == null) { ProjectExplorerWindow = new ProjectExplorerForm(); Form1StringResources.SetTextForAllControls(ProjectExplorerWindow); } ProjectPane = null; AddWindowToDockPanel(ProjectExplorerWindow, MainDockPanel, ProjectExplorerWindow.Dock, DockState.DockLeft, OutputWindow.IsFloat, ProjectPane, -1); ProjectPane = ProjectExplorerWindow.Pane; }
public static void ProjectProperties() { ProjectProperties pf = new ProjectProperties(); Form1StringResources.SetTextForAllControls(pf); pf.LoadOptions(ProjectFactory.Instance.CurrentProject); //pf.SetProperties(); if (pf.ShowDialog() == DialogResult.OK) { pf.SetOptions(ProjectFactory.Instance.CurrentProject); ProjectFactory.Instance.Dirty = true; } }
public static void InvokeAddCondition() { if (bcf == null) { bcf = new BreakpointConditionForm(); Form1StringResources.SetTextForAllControls(bcf); } BreakpointInfo bi = null; Breakpoint br = breakpoints[cur_bookmark]; if (breakpoints_conditions.TryGetValue(br, out bi)) { bcf.IsConditionEnabled = bi.enabled; bcf.Condition = bi.condition; if (bi.kind == hit_kind.is_true) { bcf.IfTrue = true; } else { bcf.IfChanged = true; } } else { bcf.IsConditionEnabled = true; bcf.Condition = ""; bcf.IfTrue = true; } if (bcf.ShowDialog() == DialogResult.OK) { if (bi == null) { bi = new BreakpointInfo(); breakpoints_conditions.Add(br, bi); } bi.enabled = bcf.IsConditionEnabled; bi.condition = bcf.Condition; if (bcf.IfTrue) { bi.kind = hit_kind.is_true; } else { bi.kind = hit_kind.changed; } cur_bookmark.IsOnCondition = bi.enabled && !string.IsNullOrEmpty(bi.condition.Trim(' ', '\t')); } }
public void NewProject() { NewProjectForm npf = new NewProjectForm(); Form1StringResources.SetTextForAllControls(npf); if (npf.ShowDialog() == DialogResult.OK) { if (ProjectFactory.Instance.ProjectLoaded) { if (!CloseProject()) { return; } } PascalABCCompiler.IProjectInfo proj = ProjectFactory.Instance.CreateProject(npf.ProjectName, npf.ProjectFileName, npf.ProjectType); ProjectExplorerWindow.LoadProject(npf.ProjectName, ProjectFactory.Instance.CurrentProject); ProjectExplorerWindow.Show(); //ShowContent(ProjectExplorerWindow,true); CloseFilesAndSaveState(); ClearAndSaveWatch(); SelectContent(ProjectExplorerWindow, false); WorkbenchServiceFactory.FileService.OpenFile(proj.MainFile, null); ActiveCodeFileDocument = CurrentCodeFileDocument; AddLastProject(npf.ProjectFileName); if (CodeCompletion.CodeCompletionController.comp != null) { CodeCompletion.CodeCompletionController.comp.CompilerOptions.CurrentProject = proj; } this.mRPROJECTToolStripMenuItem.Visible = true; this.miCloseProject.Visible = true; if (proj.ProjectType == PascalABCCompiler.ProjectType.WindowsApp) { //string s = ProjectFactory.Instance.GetFullUnitFileName(); //OpenFile(null,s); //CurrentCodeFileDocument.AddDesigner(null); ProjectTask.NewForm(ProjectExplorerWindow, false);//roman// GenerateMainProgramForDesigner(proj.MainFile); //OpenFile(s,null); //SaveFileAs(CurrentCodeFileDocument,s); //CurrentCodeFileDocument.DesignerAndCodeTabs.SelectedTab = CurrentCodeFileDocument.DesignerPage; //ProjectTask.AddFile(ProjectExplorerWindow,Path.GetFileName(s)); SaveAll(false); } } }
public void AddPropertiesWindow() { if (PropertiesWindow == null) { PropertiesWindow = new PropertiesForm(); Form1StringResources.SetTextForAllControls(PropertiesWindow); Panel properties = FormsDesignerViewContent.PropertyPad.PropertyPadPanel; properties.Dock = DockStyle.Fill; properties.Parent = PropertiesWindow; AddWindowToDockPanel(PropertiesWindow, MainDockPanel, DockStyle.Fill, DockState.DockRight, OutputWindow.IsFloat, ProjectPane, int.MaxValue); //PropertiesWindow.Show(); } else { PropertiesWindowVisible = true; } }
public void AddNewEntry(string entry) { //this.watchList.ClearSelection(); if (frm == null) { frm = new AddWatchForm(); Form1StringResources.SetTextForAllControls(frm); } frm.EditValue = entry; int i = 0; if (frm.ShowDialog() == DialogResult.OK) { if (string.IsNullOrEmpty(entry)) { if (this.watchList.Rows[0].Cells[0].Value == null) { i = 0; } else { this.watchList.Rows.Insert(0, 1); i = 0; //i = this.WdataGridView1.Rows.Count-1; } if (this.watchList.Rows.Count == 1) { this.watchList.Rows.Insert(0, 1); } } else { i = this.watchList.SelectedRows[0].Index; } if (frm.EditValue != "") { this.watchList.Rows[i].Cells[0].Value = frm.EditValue; } else { this.watchList.Rows[i].Cells[0].Value = null; } RefreshRow(i); } }
public ErrorsListWindowForm(Form1 MainForm) : base(MainForm) { InitializeComponent(); Form1StringResources.SetTextForAllControls(this.contextMenuStrip1); var sc = ScreenScale.Calc(); if (sc != 1.0) { columnHeader6.Width = Convert.ToInt32(columnHeader6.Width * sc); columnHeader7.Width = Convert.ToInt32(columnHeader7.Width * sc); columnHeader8.Width = Convert.ToInt32(columnHeader8.Width * sc); columnHeader9.Width = Convert.ToInt32(columnHeader9.Width * sc); columnHeader10.Width = Convert.ToInt32(columnHeader10.Width * 0.9 * sc); columnHeader11.Width = Convert.ToInt32(columnHeader11.Width * sc); } if (sc >= 1.99) { this.lvErrorsList.SmallImageList = this.ilvlErrorList32; } }
public static void NewForm(ProjectExplorerForm ProjectExplorerWindow, bool prompt) //roman// { NewFileForm frm = new NewFileForm(); frm.SetWinFormsFilter(); Form1StringResources.SetTextForAllControls(frm); frm.FileName = ProjectFactory.Instance.GetUnitFileName(); if (prompt && frm.ShowDialog() != DialogResult.OK) //roman// { return; } PascalABCCompiler.IFileInfo fi = ProjectFactory.Instance.AddSourceFile(frm.FileName); string full_file_name = Path.Combine(Path.GetDirectoryName(ProjectFactory.Instance.CurrentProject.Path), frm.FileName); StreamWriter sw = File.CreateText(full_file_name); sw.Close(); WorkbenchServiceFactory.FileService.OpenFile(full_file_name, null); VisualPABCSingleton.MainForm.CurrentCodeFileDocument.AddDesigner(null); ProjectExplorerWindow.AddSourceFile(fi, true); VisualPABCSingleton.MainForm.SaveFileAs(VisualPABCSingleton.MainForm.CurrentCodeFileDocument, full_file_name); }
public List <SymbolsViewerSymbol> Rename(string expr, string name, string fileName, int line, int column, ref string new_val) { if (rf == null) { rf = new RenameForm(); Form1StringResources.SetTextForAllControls(rf); } rf.EditValue = name.Trim(' '); DialogResult dr = rf.ShowDialog(); if (dr == DialogResult.OK) { new_val = rf.EditValue; List <SymbolsViewerSymbol> refers = FindReferences(expr, fileName, line, column, true); if (refers == null) { return(null); } return(refers); } return(null); }
private void AddDesignerSidebars() { if (ToolBoxWindow == null) { ToolBoxWindow = new ToolBoxForm(); SharpDevelopSideBar sideBar = FormsDesignerViewContent.FormsDesignerToolBox; sideBar.Dock = DockStyle.Fill; sideBar.Parent = ToolBoxWindow; AddWindowToDockPanel(ToolBoxWindow, MainDockPanel, OutputWindow.Dock, DockState.DockLeft, OutputWindow.IsFloat, null, -1); ToolBoxWindow.Visible = false; ToolBoxWindow.Hide(); } if (PropertiesWindow == null) { PropertiesWindow = new PropertiesForm(); Form1StringResources.SetTextForAllControls(PropertiesWindow); Panel properties = FormsDesignerViewContent.PropertyPad.PropertyPadPanel; properties.Dock = DockStyle.Fill; properties.Parent = PropertiesWindow; AddWindowToDockPanel(PropertiesWindow, MainDockPanel, DockStyle.Fill, DockState.DockRight, OutputWindow.IsFloat, ProjectPane, int.MaxValue); PropertiesWindow.Visible = false; PropertiesWindow.Hide(); } }
public OutputWindowForm(Form1 MainForm) : base(MainForm) { InitializeComponent(); Form1StringResources.SetTextForAllControls(this.contextMenuStrip1); }
public DebugWatchListWindowForm(Form1 MainForm) : base(MainForm) { InitializeComponent(); // this.WColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); // this.WColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); // this.WColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); // this.WColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); // this.WColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); watchWindow = this; Form1StringResources.SetTextForAllControls(this.cntxtWatch); this.WColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.WColumn1 = new AdvancedDataGridView.TreeGridColumn(); this.WColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.WColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.WColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.WColumn6Empty = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.watchList.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.watchList.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders; this.watchList.BackgroundColor = System.Drawing.Color.White; this.watchList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.watchList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.WColumn1, this.WColumn3, this.WColumn2, this.WColumn6Empty }); this.watchList.Dock = System.Windows.Forms.DockStyle.Fill; this.watchList.GridColor = System.Drawing.SystemColors.Control; this.watchList.Location = new System.Drawing.Point(1, 1); this.watchList.MultiSelect = true; this.watchList.Font = new Font("Tahoma", 8); this.watchList.BorderStyle = BorderStyle.None; this.watchList.ReadOnly = false; this.watchList.RowHeadersVisible = false; this.watchList.RowTemplate.Height = 24; this.watchList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.watchList.Size = new System.Drawing.Size(782, 121); this.watchList.TabIndex = 0; //this.watchList.CellValueChanged += RefreshWatchDel;//delegate(object sender, DataGridViewCellEventArgs e) { RefreshWatch(); }; this.watchList.CellEndEdit += delegate(object sender, DataGridViewCellEventArgs e) { RefreshRow(e.RowIndex); }; this.watchList.CellClick += CellClickDel; this.watchList.CellDoubleClick += CellDblClickDel; this.watchList.KeyDown += KeyDownDel; this.watchList.UserDeletingRow += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.watchList_UserDeletingRow); this.watchList._imageList = CodeCompletionProvider.ImagesProvider.ImageList; this.watchList.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.watchList.ShowLines = true; this.watchList.Nodes.Add(new AdvancedDataGridView.TreeGridNode()); //this.dataGridView1.ClientSizeChanged += new System.EventHandler(this.dataGridView1_ClientSizeChanged); //this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); //this.dataGridView1.SizeChanged += new System.EventHandler(this.dataGridView1_SizeChanged); //this.dataGridView1.Paint += new System.Windows.Forms.PaintEventHandler(this.dataGridView1_Paint); //this.dataGridView1.Resize += new System.EventHandler(this.dataGridView1_Resize); this.WColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; this.WColumn4.FillWeight = 20F; this.WColumn4.Frozen = true; this.WColumn4.HeaderText = "ER_NUM"; this.WColumn4.Name = "WColumn4"; this.WColumn4.ReadOnly = true; this.WColumn4.Resizable = System.Windows.Forms.DataGridViewTriState.False; this.WColumn4.Width = 25; // // Column1 // this.WColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; this.WColumn1.FillWeight = 20F; this.WColumn1.Frozen = false; this.WColumn1.HeaderText = "WT_EXPR"; this.WColumn1.Name = "WColumn1"; this.WColumn1.ReadOnly = false; this.WColumn1.Width = 250; // // Column2 // this.WColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; this.WColumn2.FillWeight = 221.0297F; this.WColumn2.Frozen = false; this.WColumn2.HeaderText = "WT_TYPE"; this.WColumn2.Name = "WColumn2"; this.WColumn2.ReadOnly = true; this.WColumn2.Width = 200; // // Column3 // this.WColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; this.WColumn3.FillWeight = 101.5228F; this.WColumn3.Frozen = false; this.WColumn3.HeaderText = "WT_VALUE"; this.WColumn3.Name = "WColumn3"; this.WColumn3.ReadOnly = true; // // Column6Empty // this.WColumn6Empty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.WColumn6Empty.FillWeight = 101.5228F; this.WColumn6Empty.Frozen = false; this.WColumn6Empty.HeaderText = ""; this.WColumn6Empty.Name = "Empty"; this.WColumn6Empty.Resizable = System.Windows.Forms.DataGridViewTriState.False; this.WColumn6Empty.ReadOnly = true; // // Column5 // this.WColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; this.WColumn5.HeaderText = "ER_PATH"; this.WColumn5.Name = "WColumn5"; this.WColumn5.ReadOnly = true; this.WColumn5.Width = 200; this.watchList.AllowUserToAddRows = true; this.watchList.AllowUserToDeleteRows = true; this.watchList.AllowUserToResizeColumns = true; this.watchList.AllowUserToResizeRows = false; }