* Add first comments
* Finish commenting for Compile and CompileUnit
* Write TODO sections
* Add a few clarifications
* splitted some functions from compile
* Written some methods from Compile to functions
* Update variable names
* Refactor - stage 1
Refactor GetUsesSection and IsPossibleNameSpace
* Refactor - stage 2
Rename a few functions and variables
* Correct an inaccuracy
* Added comments, look through CompileUnit
* Rename a few functions and add new comments
* Split CompileUnit to Subfunctions
Add IsUnitCompiled, IsUnitInPCU, InitializeNewUnit, GetSourceCode, GenSyntaxTree, GenUnitDocumentation, CheckDLLDirectiveOnlyForLibraries, MatchErrorsToBadNodes, CheckIfUnitModule, SetUseDLLForSystemUnits,
CompileInterfaceDependencies, CompileCurrentUnitInterface, GetImplementationUsesSection, CompileImplementationDependencies, CompileCurrentUnitImplementation
* Added some TODOs
* Return uses_unit_in original name
Renaming of syntax tree nodes leads to internal compiler errors
* Extract GenerateILCode method
* Add checking if recompilation needed method
Needs to be discussed and revised
* Add functions for catch blocks in Compile
* Extract building semantic tree method
Creating main function to be moved to another class
* Rename UnitsSortedList
* Edit CompileUnitsFromDelayedList method
* Change a few variable names, make CreateRCFile function and add comments
* Make code more "user-friendly"
* Add TODOs 31.11.23
* Create PrebuildSemanticTreeActionsMethod
* Refactor semantic checks section in initialize new unit method
* Refactor Adding standard units to uses method
* Return file_name and compiler_directives original names to avoid internal compilation errors
* Refactor GetReferences Method
* Initial refactoring of IncludeNamespaces function
* Create three more methods and wrap important code in regions
* Add TODO's
* Resolve merge conflicts
* Add returned value to ConstructSyntaxTree method
* Fix UnitsSortedList NotFoundError in PCUWriter
* Workaround commit
* Update PABCSystem after tests' changes
* Rename syntax trees in some methods
* Delete CurrentSyntaxUnit variable
* Revert unnecessary project files changes
* Squashed commit of the following:
commit f4d7599f1a39252feac97bd5391f46dfdc25f6f4
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:43:29 2023 +0300
added links to identarranger
commit 3bd5d33e2b2969884e61a3279ff9c353013b57fe
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:43:03 2023 +0300
Change extension for verybasic to yavb
commit 61294c6e7d405e1c68516cc81d3a109e8a1ee295
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Tue Nov 21 09:33:57 2023 +0300
Change Program Example
commit 86971488341ed6bf13c39e13a513d7ac0c51c285
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Tue Nov 21 09:28:59 2023 +0300
Add IndentArranger to Compile
commit 2ce50bbbf9db22c4243b247b870f6935ce206d26
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Fri Nov 17 10:00:31 2023 +0300
Add Semicolon After Each Statement
commit 796309d340e8d8ba730ff9418fa376f34fb7fd36
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Wed Nov 15 18:49:11 2023 +0300
Add Alpha Version of Python-style If-statement
commit 5eb88f946fe8254b4f5c5a56ed0a567b3be51227
Merge: ab4ce5b0 0162b637
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 15 16:54:26 2023 +0300
Merge branch 'IndentArranger' into VeryBasicLanguage
commit ab4ce5b0e32d42004726e3dc45cc0d8a65e53f56
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 15 16:53:51 2023 +0300
Fixes from seminar
commit af74012289d0d08517c13499a2a66cb543fc06d2
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Sun Nov 12 18:57:29 2023 +0300
finally working!
fully implemented compatibility
commit 58a39c313324b468d1eec207ba3f5f6eddf74ef2
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Sun Nov 12 11:58:16 2023 +0300
more compatibility with pabc
Now verybasic statements translate to pascal compiler
added .bat script for autobuilding verybasic
commit 0162b6376b8fe970704f26213bf9f0f670dfb12e
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Sun Nov 12 10:06:14 2023 +0300
Update test.txt
commit 1b759ab1cd7ee2ffeb14afff0418ddf0f30b0399
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Sun Nov 12 10:05:36 2023 +0300
Add Indent and Unindent Keywords to Generated File
commit cabda7f3985651cff2a8740f1a5bdea8fe7ac892
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Fri Nov 10 21:25:52 2023 +0300
Add Generation of Output File
commit 306f033d0176ab559e3622b8505427dbe2e0e203
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Thu Nov 9 20:42:18 2023 +0300
Update IndentArranger.sln
commit 60c0ceced1aa3a7d2e33de0facb1126e295f43b5
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Thu Nov 9 20:41:22 2023 +0300
Add IndentArranger
commit 1f4556c4573dae154fcc167b41ff6ab9e8122136
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Mon Nov 6 22:48:36 2023 +0300
Made my own VeryBasicParser project
Copied some code from SaushkinParser
Tried to compile it and implement into Pascal
Doesn't work due to grammatik issue
* Squashed commit of the following:
commit 4e73d9ac3ffef68312f06a74dc83afffcf3ccbee
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 15:08:10 2023 +0300
Fixed GPPG (i think so at least)
commit e5cfc220828b37fb2f35e565683019716ec3f0ce
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:44:27 2023 +0300
Update Compiler.cs
commit 4698e2e75a5f3b4f523a8bc7733a50e8abb4fca1
Merge: 22aaf2b2 f4d7599f
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:43:54 2023 +0300
Merge branch 'IndentArrangerTemp' into VeryBasicLanguage
commit f4d7599f1a39252feac97bd5391f46dfdc25f6f4
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:43:29 2023 +0300
added links to identarranger
commit 3bd5d33e2b2969884e61a3279ff9c353013b57fe
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:43:03 2023 +0300
Change extension for verybasic to yavb
commit 22aaf2b2508278a9ffce525ffed52419bf72c23f
Merge: c326174f 61294c6e
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:26:36 2023 +0300
Merge branch 'IndentArrangerTemp' into VeryBasicLanguage
commit 61294c6e7d405e1c68516cc81d3a109e8a1ee295
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Tue Nov 21 09:33:57 2023 +0300
Change Program Example
commit 86971488341ed6bf13c39e13a513d7ac0c51c285
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Tue Nov 21 09:28:59 2023 +0300
Add IndentArranger to Compile
commit c326174ff5ecccf9c4f76d58aea4653f047af049
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Sun Nov 19 15:03:19 2023 +0300
Added UniversalParserHelper and GPPG
ShiftReduceParser moved to another project
UniversalParserHelper project added, most of it copied from SaushkinParser
commit 2ce50bbbf9db22c4243b247b870f6935ce206d26
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Fri Nov 17 10:00:31 2023 +0300
Add Semicolon After Each Statement
commit 796309d340e8d8ba730ff9418fa376f34fb7fd36
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Wed Nov 15 18:49:11 2023 +0300
Add Alpha Version of Python-style If-statement
commit 5eb88f946fe8254b4f5c5a56ed0a567b3be51227
Merge: ab4ce5b0 0162b637
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 15 16:54:26 2023 +0300
Merge branch 'IndentArranger' into VeryBasicLanguage
commit ab4ce5b0e32d42004726e3dc45cc0d8a65e53f56
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 15 16:53:51 2023 +0300
Fixes from seminar
commit af74012289d0d08517c13499a2a66cb543fc06d2
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Sun Nov 12 18:57:29 2023 +0300
finally working!
fully implemented compatibility
commit 58a39c313324b468d1eec207ba3f5f6eddf74ef2
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Sun Nov 12 11:58:16 2023 +0300
more compatibility with pabc
Now verybasic statements translate to pascal compiler
added .bat script for autobuilding verybasic
commit 0162b6376b8fe970704f26213bf9f0f670dfb12e
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Sun Nov 12 10:06:14 2023 +0300
Update test.txt
commit 1b759ab1cd7ee2ffeb14afff0418ddf0f30b0399
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Sun Nov 12 10:05:36 2023 +0300
Add Indent and Unindent Keywords to Generated File
commit cabda7f3985651cff2a8740f1a5bdea8fe7ac892
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Fri Nov 10 21:25:52 2023 +0300
Add Generation of Output File
commit 306f033d0176ab559e3622b8505427dbe2e0e203
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Thu Nov 9 20:42:18 2023 +0300
Update IndentArranger.sln
commit 60c0ceced1aa3a7d2e33de0facb1126e295f43b5
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Thu Nov 9 20:41:22 2023 +0300
Add IndentArranger
commit 1f4556c4573dae154fcc167b41ff6ab9e8122136
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Mon Nov 6 22:48:36 2023 +0300
Made my own VeryBasicParser project
Copied some code from SaushkinParser
Tried to compile it and implement into Pascal
Doesn't work due to grammatik issue
* Changed GPPG project NET Framework version, added .dll to gitignore
* Adding UniversalParserHelper to project, trying to include VeryBasic
* Managed dependencies and got VeryBasicLanguage to work
* Change extension of a test program
* Rebuild changes
What should be added to .gitignore?
* Fix bug related to err0524_res_unit.pas
* Rebuild Parser
* Change Indent and Unindent tokens
* Add Symbol Table to ParserABC.y
* Change Indent Space Number to 2
* Add While Loop
* Add Some Operations to Parser
* Make Initialization Node at the Beginning of a program
* Create Grammar.txt
* Test program added
* Add ELIF and SyntaxHighlight
* Fix TableSymbol
* Add Division
* Add Method Call
* Add For Loop
* Rename SPython Parser Folder
* Add documented comments for CompileUnit method
* Added Errors to SPython
Added Errors.cs
Removed link to PABCSaushkinParser
Minor fixes
* Create default constructor for SourceContext
* Move null check of currentUnit to upper level in CompileUnit
* Move CreateMainFunction method from Compiler to TreeConverter class
* Add gppg and parserhelper to visualpascalabcnet dependencies
* Updated installer files to include GPPG and UniversalParserHelper
* Rename GPPG to ShiftReduceParser
* Fix ShiftReduceParser project dependencies
* Fix ShiftReduceParserDependencies second iteration
* Workaround commit
* Update PABCSystem after tests' changes
* Refactor ConvertDirectives method
* Get rid of legacy standard modules code
* Return varBeginOffset and beginOffset calculation to Compiler class
Размещение метода в SyntaxTreeToSemanticTreeConverter не целесообразно. В комментарии видимо имелось в виду что-то другое.
* Workaround commit
* Update PABCSystem after tests' changes
* Revert SPython changes
Оставляем только изменения связанные с рефакторингом.
* Update .gitignore
Co-authored-by: Sun Serega <sunserega2@gmail.com>
* Resolve a few Sun Serega treds
* Delete comments in ParsersController.cs
* Replace specific path with path variable in Studio.bat
* Add comment in Studio.bat file and return FileName in CompilerError.cs
* Fix TreeSubsidiary.cs encoding and sectCore.nsh indents
* Return old version of TestRunner.exe
* Rename some variables and polish a few methods
* Uncomment accidentally commented code
* Replace spaces with tabs
* Changed dll name from GPPG
* Revert "Changed dll name from GPPG"
This reverts commit c485cc8cb787809b7e9dfa8a361e75f17ed39893.
* Update .gitignore
* Delete Libraries/ShiftReduceParser.dll
* Delete bin\ShiftReduceParser.dll
* Replace tabs with spaces
* Update encoding in Studio.bat
* Fix bug with PABCrtl excluded files
* Refactor StandardModule class
* Add null checks to make debuging easier
* Delete unnecessary null checks in SymTable.cs
---------
Co-authored-by: Владислав Крылов <krylov@sfedu.ru>
Co-authored-by: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Co-authored-by: Sun Serega <sunserega2@gmail.com>
679 lines
23 KiB
C#
679 lines
23 KiB
C#
// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
|
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using VisualPascalABCPlugins;
|
|
using WeifenLuo.WinFormsUI.Docking;
|
|
|
|
namespace VisualPascalABC
|
|
{
|
|
public partial class Form1: VisualPascalABCPlugins.IWidgetStatusContoller
|
|
{
|
|
IWidgetStatusContoller VisualPascalABCPlugins.IWorkbench.WidgetController
|
|
{
|
|
get
|
|
{
|
|
return this;
|
|
}
|
|
}
|
|
|
|
internal List<DockContent> BottomDockContent = new List<DockContent>();
|
|
List<DockContent> VisibleBottomContent = new List<DockContent>();
|
|
|
|
public bool CompilingButtonsEnabled
|
|
{
|
|
get { return miRun.Enabled; }
|
|
set { SetCompilingButtonsEnabled(value); }
|
|
}
|
|
|
|
bool SaveButtonsEnabled
|
|
{
|
|
set
|
|
{
|
|
cmSave.Enabled = tbSave.Enabled = miSave.Enabled = value;
|
|
}
|
|
get
|
|
{
|
|
return miSave.Enabled;
|
|
}
|
|
}
|
|
|
|
internal bool SaveAllButtonsEnabled
|
|
{
|
|
set
|
|
{
|
|
tbSaveAll.Enabled = miSaveAll.Enabled = value;
|
|
}
|
|
get
|
|
{
|
|
return miSaveAll.Enabled;
|
|
}
|
|
}
|
|
|
|
bool CloseButtonsEnabled
|
|
{
|
|
set
|
|
{
|
|
cmCloseAllButThis.Enabled = miCloseAllButThis.Enabled = miClose.Enabled = cmClose.Enabled = value;
|
|
}
|
|
get
|
|
{
|
|
return miClose.Enabled;
|
|
}
|
|
}
|
|
|
|
bool UndoButtonsEnabled
|
|
{
|
|
get { return miUndo.Enabled; }
|
|
set { miUndo.Enabled = tsUndo.Enabled = value; }
|
|
}
|
|
|
|
bool RedoButtonsEnabled
|
|
{
|
|
get { return miRedo.Enabled; }
|
|
set { miRedo.Enabled = tsRedo.Enabled = value; }
|
|
}
|
|
|
|
bool CutButtonsEnabled
|
|
{
|
|
get { return miCut.Enabled; }
|
|
set { cmCut.Enabled = miCut.Enabled = tsCut.Enabled = value; }
|
|
}
|
|
|
|
bool CopyButtonsEnabled
|
|
{
|
|
get { return miCopy.Enabled; }
|
|
set { cmCopy.Enabled = miCopy.Enabled = tsCopy.Enabled = value; }
|
|
}
|
|
|
|
bool NavigBackButtonsEnabled
|
|
{
|
|
get { return miNavigBack.Enabled; }
|
|
set { miNavigBack.Enabled = tsNavigBack.Enabled = value; }
|
|
}
|
|
|
|
bool NavigForwButtonsEnabled
|
|
{
|
|
get { return miNavigForw.Enabled; }
|
|
set { miNavigForw.Enabled = tsNavigForw.Enabled = value; }
|
|
}
|
|
|
|
public void SetDedugButtonsEnabled(bool Enabled)
|
|
{
|
|
StepIntoButton.Enabled = StepOverButton.Enabled = StartDebugButton.Enabled =
|
|
mDEBUGSTARTToolStripMenuItem.Enabled = mSTEPOVERToolStripMenuItem.Enabled = mSTEPINToolStripMenuItem.Enabled = mRUNTOCURToolStripMenuItem.Enabled = Enabled;
|
|
|
|
//toolStrip1.Refresh();
|
|
}
|
|
|
|
|
|
|
|
bool BottomDockContentVisible
|
|
{
|
|
get
|
|
{
|
|
foreach (DockContent dc in BottomDockContent)
|
|
if (!dc.IsHidden)
|
|
return true;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
internal bool BottomTabsVisibleChekerEnabled
|
|
{
|
|
get
|
|
{
|
|
return miOutputWindow.Enabled;
|
|
}
|
|
set
|
|
{
|
|
miOutputWindow.Enabled = tsOutputWindow.Enabled = value;
|
|
}
|
|
}
|
|
|
|
internal bool BrowserTabSelected;
|
|
|
|
internal bool BottomTabsVisible
|
|
{
|
|
get
|
|
{
|
|
return BottomDockContentVisible;
|
|
}
|
|
set
|
|
{
|
|
if (value == BottomTabsVisible)
|
|
return;
|
|
if (value)
|
|
{
|
|
if (VisibleBottomContent.Count > 0)
|
|
{
|
|
foreach (DockContent dc in VisibleBottomContent)
|
|
{
|
|
dc.Show();
|
|
}
|
|
|
|
VisibleBottomContent.Clear();
|
|
}
|
|
else
|
|
if (BottomDockContent.Count > 0)
|
|
BottomDockContent[0].Show();
|
|
}
|
|
else
|
|
{
|
|
VisibleBottomContent.Clear();
|
|
DockContent dca = BottomDockContent[0].Pane.ActiveContent as DockContent;
|
|
foreach (DockContent dc in BottomDockContent)
|
|
if (!dc.IsHidden && !BottomPane.IsAutoHide)
|
|
{
|
|
if (dc != dca)
|
|
VisibleBottomContent.Add(dc);
|
|
dc.Hide();
|
|
}
|
|
VisibleBottomContent.Add(dca);
|
|
}
|
|
|
|
UpdateOutputWindowVisibleButtons();
|
|
if (!value && LoadComplete)
|
|
SetFocusToEditor();
|
|
}
|
|
}
|
|
|
|
private bool ToolBoxVisible_ = false;
|
|
|
|
public bool ToolBoxVisible
|
|
{
|
|
get
|
|
{
|
|
return ToolBoxVisible_;
|
|
}
|
|
set
|
|
{
|
|
if (value && ToolBoxVisible_ && !ToolBoxWindow.IsActivated)
|
|
{
|
|
ToolBoxWindow.Show();
|
|
ToolBoxWindow.Activate();
|
|
return;
|
|
}
|
|
if (ToolBoxVisible_ == value) return;
|
|
ToolBoxVisible_ = value;
|
|
if (value)
|
|
{
|
|
if (ToolBoxWindow == null)
|
|
{
|
|
AddToolBox();
|
|
}
|
|
else
|
|
{
|
|
ToolBoxWindow.Show();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ToolBoxWindow.Hide();
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool ProjectExplorerWindowVisible
|
|
{
|
|
get
|
|
{
|
|
return ProjectExplorerWindow != null && ProjectExplorerWindow.Visible;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
if (ProjectExplorerWindow == null)
|
|
{
|
|
AddProjectExplorerWindow();
|
|
}
|
|
else
|
|
{
|
|
//ShowContent(PropertiesWindow, false);
|
|
ProjectExplorerWindow.Show();
|
|
//PropertiesWindow.IsHidden = false; //Show(MainDockPanel, DockState.Hidden);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (ProjectExplorerWindow != null)
|
|
{
|
|
//PropertiesWindow.IsHidden = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
public bool DisassemblyWindowVisible
|
|
{
|
|
get
|
|
{
|
|
return DisassemblyWindow != null && DisassemblyWindow.Visible;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
if (DisassemblyWindow == null)
|
|
{
|
|
AddDisassemblyWindow();
|
|
}
|
|
else
|
|
{
|
|
//ShowContent(PropertiesWindow, false);
|
|
DisassemblyWindow.Show();
|
|
DisassemblyWindow.ShowDisassembly();
|
|
//PropertiesWindow.IsHidden = false; //Show(MainDockPanel, DockState.Hidden);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
public bool PropertiesWindowVisible
|
|
{
|
|
get
|
|
{
|
|
return PropertiesWindow != null && PropertiesWindow.Visible;
|
|
}
|
|
set
|
|
{
|
|
if (value)
|
|
{
|
|
if (PropertiesWindow == null)
|
|
{
|
|
AddPropertiesWindow();
|
|
}
|
|
else
|
|
{
|
|
//ShowContent(PropertiesWindow, false);
|
|
PropertiesWindow.Show();
|
|
//PropertiesWindow.IsHidden = false; //Show(MainDockPanel, DockState.Hidden);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (PropertiesWindow != null)
|
|
{
|
|
//PropertiesWindow.IsHidden = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
internal bool FindAllReferncesEnabled
|
|
{
|
|
get
|
|
{
|
|
return cmFindAllReferences.Enabled;
|
|
}
|
|
set
|
|
{
|
|
cmFindAllReferences.Enabled = tsFindAllReferences.Enabled = value;
|
|
}
|
|
}
|
|
|
|
public void SetCompilingButtonsEnabled(bool Enabled)
|
|
{
|
|
if (Enabled)
|
|
{
|
|
miNewProject.Enabled = true;
|
|
}
|
|
//StepIntoButton.Enabled = StepOverButton.Enabled =
|
|
// mDEBUGSTARTToolStripMenuItem.Enabled = mSTEPOVERToolStripMenuItem.Enabled=
|
|
// StartDebugButton.Enabled =
|
|
StartNoDebugButton.Enabled = miRunNoDebug.Enabled =
|
|
miBuild.Enabled = miRebuild.Enabled = miRun.Enabled = ReCompileButton.Enabled =
|
|
CompileButton.Enabled = cmRun.Enabled = StartButton.Enabled = Enabled;
|
|
|
|
toolStrip1.Refresh();
|
|
}
|
|
|
|
public void UpdateUndoRedoEnabled() //roman// public
|
|
{
|
|
CodeFileDocumentControl d = CurrentCodeFileDocument; //roman//
|
|
if (d.DesignerAndCodeTabs != null)
|
|
{
|
|
if (d.DesignerPage != null && d.Designer != null && d.DesignerAndCodeTabs.SelectedTab == d.DesignerPage)
|
|
{
|
|
UndoButtonsEnabled = d.Designer.EnableUndo;
|
|
RedoButtonsEnabled = d.Designer.EnableRedo;
|
|
}
|
|
else
|
|
{
|
|
UndoButtonsEnabled = d.CanUndo;
|
|
RedoButtonsEnabled = d.CanRedo;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
UndoButtonsEnabled = d.CanUndo;
|
|
RedoButtonsEnabled = d.CanRedo;
|
|
}
|
|
}
|
|
|
|
void UpdateCutCopyButtonsEnabled()
|
|
{
|
|
CutButtonsEnabled = CopyButtonsEnabled = CurrentSyntaxEditor.TextSelected;
|
|
}
|
|
|
|
internal void UpdateOutputWindowVisibleButtons()
|
|
{
|
|
tsOutputWindow.Checked = miOutputWindow.Checked = BottomTabsVisible;
|
|
}
|
|
|
|
public void UpdateSaveButtonsEnabled()
|
|
{
|
|
SaveButtonsEnabled = CurrentCodeFileDocument != null && CurrentCodeFileDocument.DocumentChanged;
|
|
SaveAllButtonsEnabled = !AllSaved();
|
|
}
|
|
|
|
public void SetDebugPausedEnabled()
|
|
{
|
|
this.mDEBUGSTOPToolStripMenuItem.Enabled = true;
|
|
this.StopDebugButton.Enabled = true;
|
|
SaveDebugContext();
|
|
}
|
|
|
|
public void SetDebugPausedDisabled()
|
|
{
|
|
this.mDEBUGSTOPToolStripMenuItem.Enabled = false;
|
|
this.StopDebugButton.Enabled = false;
|
|
SaveDebugContext();
|
|
}
|
|
|
|
public void SetDebugStopEnabled()
|
|
{
|
|
SetCompilingButtonsEnabled(false);
|
|
this.mDEBUGSTOPToolStripMenuItem.Enabled = true;
|
|
this.mDEBUGENDToolStripMenuItem.Enabled = true;
|
|
this.mSTEPToolStripMenuItem.Enabled = true;
|
|
this.StopDebugButton.Enabled = true;
|
|
this.StepOutButton.Enabled = true;
|
|
this.stopButton.Enabled = true;
|
|
this.miStop.Enabled = true;
|
|
ChangeDebugButtons(true);
|
|
SaveDebugContext();
|
|
}
|
|
|
|
public void ChangeStartDebugNameOnContinue()
|
|
{
|
|
this.StartDebugButton.ToolTipText = Form1StringResources.Get("M_DEBUGCONT");
|
|
this.mDEBUGSTARTToolStripMenuItem.Text = Form1StringResources.Get("M_DEBUGCONT");
|
|
}
|
|
|
|
public void ChangeContinueDebugNameOnStart()
|
|
{
|
|
this.StartDebugButton.ToolTipText = Form1StringResources.Get("M_DEBUGSTART");
|
|
this.mDEBUGSTARTToolStripMenuItem.Text = Form1StringResources.Get("M_DEBUGSTART");
|
|
}
|
|
|
|
public void SetStartDebugDisabled()
|
|
{
|
|
this.mDEBUGSTARTToolStripMenuItem.Enabled = false;
|
|
this.StartDebugButton.Enabled = false;
|
|
this.mSTEPINToolStripMenuItem.Enabled = false;
|
|
this.StepIntoButton.Enabled = false;
|
|
this.mSTEPOVERToolStripMenuItem.Enabled = false;
|
|
this.StepOverButton.Enabled = false;
|
|
this.mRUNTOCURToolStripMenuItem.Enabled = false;
|
|
this.mSTEPToolStripMenuItem.Enabled = false;
|
|
this.miRun.Enabled = false;
|
|
this.StartButton.Enabled = false;
|
|
SetDebugPausedEnabled();
|
|
ChangeDebugButtons(true);
|
|
SaveDebugContext();
|
|
}
|
|
|
|
public void SetStartDebugEnabled()
|
|
{
|
|
this.mDEBUGSTARTToolStripMenuItem.Enabled = true;
|
|
this.StartDebugButton.Enabled = true;
|
|
this.mSTEPINToolStripMenuItem.Enabled = true;
|
|
this.StepIntoButton.Enabled = true;
|
|
this.mSTEPOVERToolStripMenuItem.Enabled = true;
|
|
this.StepOverButton.Enabled = true;
|
|
this.mRUNTOCURToolStripMenuItem.Enabled = true;
|
|
this.mSTEPToolStripMenuItem.Enabled = true;
|
|
this.miRun.Enabled = true;
|
|
this.StartButton.Enabled = true;
|
|
ChangeDebugButtons(false);
|
|
SaveDebugContext();
|
|
}
|
|
|
|
public void SetDebugStopDisabled()
|
|
{
|
|
this.mDEBUGSTOPToolStripMenuItem.Enabled = false;
|
|
this.mSTEPToolStripMenuItem.Enabled = false;
|
|
this.StopDebugButton.Enabled = false;
|
|
this.StepOutButton.Enabled = false;
|
|
if (!(clicked_stop_debug_in_menu && WorkbenchServiceFactory.RunService.IsRun() && debuggedPage != ActiveCodeFileDocument))
|
|
{
|
|
SetCompilingButtonsEnabled(true);
|
|
this.stopButton.Enabled = false;
|
|
this.miStop.Enabled = false;
|
|
}
|
|
clicked_stop_debug_in_menu = false;
|
|
this.mDEBUGENDToolStripMenuItem.Enabled = false;
|
|
//Data fileInfo = debuggedPage.ag as CodeFileDocumentControl;
|
|
//debuggedPage.Text = Path.GetFileName(fileInfo.file_name);
|
|
//debuggedPage.ToolTipText = fileInfo.file_name;
|
|
SetTabPageText(debuggedPage);
|
|
ChangeDebugButtons(false);
|
|
SaveDebugContext();
|
|
//this.mDEBUGSTARTToolStripMenuItem.Text = PascalABCCompiler.StringResources.Get("M_DEBUGSTART");
|
|
}
|
|
|
|
private bool play_pause_buttons_visible = true;
|
|
|
|
public bool PlayPauseButtonsVisibleInPanel
|
|
{
|
|
get
|
|
{
|
|
return play_pause_buttons_visible;
|
|
}
|
|
set
|
|
{
|
|
play_pause_buttons_visible = value;
|
|
/*StopDebugButton.Visible = */
|
|
StartDebugButton.Visible = value;
|
|
}
|
|
}
|
|
|
|
public void SetAddExprMenuVisible(bool flag)
|
|
{
|
|
}
|
|
|
|
public void SetDisassemblyMenuVisible(bool flag)
|
|
{
|
|
tsDisassembly.Visible = flag;
|
|
}
|
|
|
|
public void SetPlayButtonsVisible(bool start)
|
|
{
|
|
if (play_pause_buttons_visible)
|
|
{
|
|
if (start)
|
|
{
|
|
this.StartDebugButton.Visible = false;
|
|
this.StopDebugButton.Visible = false;
|
|
}
|
|
else
|
|
{
|
|
this.StartDebugButton.Visible = true;
|
|
this.StopDebugButton.Visible = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetDebugButtonsEnabled(bool val)
|
|
{
|
|
if (val)
|
|
{
|
|
this.mDEBUGSTOPToolStripMenuItem.Enabled = false;
|
|
this.mDEBUGSTARTToolStripMenuItem.Enabled = false;
|
|
this.StartDebugButton.Enabled = true;
|
|
this.StopDebugButton.Enabled = true;
|
|
this.StepOutButton.Enabled = false;
|
|
this.StepOverButton.Enabled = true;
|
|
this.StepIntoButton.Enabled = true;
|
|
this.mDEBUGSTARTToolStripMenuItem.Enabled = true;
|
|
this.mSTEPINToolStripMenuItem.Enabled = true;
|
|
this.mSTEPOVERToolStripMenuItem.Enabled = true;
|
|
this.mSTEPToolStripMenuItem.Enabled = false;
|
|
this.mRUNTOCURToolStripMenuItem.Enabled = true;
|
|
this.miRun.Enabled = true;
|
|
this.StartButton.Enabled = true;
|
|
}
|
|
else
|
|
{
|
|
this.mDEBUGSTOPToolStripMenuItem.Enabled = false;
|
|
this.mSTEPToolStripMenuItem.Enabled = false;
|
|
this.StartDebugButton.Enabled = false;
|
|
this.StopDebugButton.Enabled = false;
|
|
this.StepOutButton.Enabled = false;
|
|
this.StepOverButton.Enabled = false;
|
|
this.StepIntoButton.Enabled = false;
|
|
this.mDEBUGSTARTToolStripMenuItem.Enabled = false;
|
|
this.mSTEPINToolStripMenuItem.Enabled = false;
|
|
this.mSTEPOVERToolStripMenuItem.Enabled = false;
|
|
this.mRUNTOCURToolStripMenuItem.Enabled = false;
|
|
this.mSTEPToolStripMenuItem.Enabled = false;
|
|
this.miRun.Enabled = false;
|
|
this.StartButton.Enabled = false;
|
|
}
|
|
}
|
|
|
|
bool mDEBUGSTOPToolStripMenuItem_Enabled;
|
|
bool mDEBUGSTARTToolStripMenuItem_Enabled;
|
|
bool mSTEPToolStripMenuItem_Enabled;
|
|
bool StartDebugButton_Enabled;
|
|
bool StopDebugButton_Enabled;
|
|
bool StepOutButton_Enabled;
|
|
bool StepOverButton_Enabled;
|
|
bool StepIntoButton_Enabled;
|
|
bool mSTEPINToolStripMenuItem_Enabled;
|
|
bool mSTEPOVERToolStripMenuItem_Enabled;
|
|
bool mRUNTOCURToolStripMenuItem_Enabled;
|
|
bool miRun_Enabled;
|
|
|
|
private void SaveDebugContext()
|
|
{
|
|
mDEBUGSTOPToolStripMenuItem_Enabled = this.mDEBUGSTOPToolStripMenuItem.Enabled;
|
|
mDEBUGSTARTToolStripMenuItem_Enabled = this.mDEBUGSTARTToolStripMenuItem.Enabled;
|
|
mSTEPToolStripMenuItem_Enabled = this.mSTEPToolStripMenuItem.Enabled;
|
|
StartDebugButton_Enabled = this.StartDebugButton.Enabled;
|
|
StopDebugButton_Enabled = this.StopDebugButton.Enabled;
|
|
StepOutButton_Enabled = this.StepOutButton.Enabled;
|
|
StepOverButton_Enabled = this.StepOverButton.Enabled;
|
|
StepIntoButton_Enabled = this.StepIntoButton.Enabled;
|
|
mSTEPINToolStripMenuItem_Enabled = this.mSTEPINToolStripMenuItem.Enabled;
|
|
mSTEPOVERToolStripMenuItem_Enabled = this.mSTEPOVERToolStripMenuItem.Enabled;
|
|
mRUNTOCURToolStripMenuItem_Enabled = this.mRUNTOCURToolStripMenuItem.Enabled;
|
|
mSTEPToolStripMenuItem_Enabled = this.mSTEPToolStripMenuItem.Enabled;
|
|
miRun_Enabled = this.miRun.Enabled;
|
|
}
|
|
|
|
private void RestoreDebugContext()
|
|
{
|
|
this.mDEBUGSTOPToolStripMenuItem.Enabled = mDEBUGSTOPToolStripMenuItem_Enabled;
|
|
this.mDEBUGSTARTToolStripMenuItem.Enabled = mDEBUGSTARTToolStripMenuItem_Enabled;
|
|
this.mSTEPToolStripMenuItem.Enabled = mSTEPToolStripMenuItem_Enabled;
|
|
this.StartDebugButton.Enabled = StartDebugButton_Enabled;
|
|
this.StopDebugButton.Enabled = StopDebugButton_Enabled;
|
|
this.StepOutButton.Enabled = StepOutButton_Enabled;
|
|
this.StepOverButton.Enabled = StepOverButton_Enabled;
|
|
this.StepIntoButton.Enabled = StepIntoButton_Enabled;
|
|
this.mDEBUGSTARTToolStripMenuItem.Enabled = mDEBUGSTARTToolStripMenuItem_Enabled;
|
|
this.mSTEPINToolStripMenuItem.Enabled = mSTEPINToolStripMenuItem_Enabled;
|
|
this.mSTEPOVERToolStripMenuItem.Enabled = mSTEPOVERToolStripMenuItem_Enabled;
|
|
this.mRUNTOCURToolStripMenuItem.Enabled = mRUNTOCURToolStripMenuItem_Enabled;
|
|
this.mSTEPToolStripMenuItem.Enabled = mSTEPToolStripMenuItem_Enabled;
|
|
this.miRun.Enabled = miRun_Enabled;
|
|
this.StartButton.Enabled = miRun_Enabled;
|
|
}
|
|
|
|
private void SetDebugButtonsAsByDebug()
|
|
{
|
|
RestoreDebugContext();
|
|
}
|
|
|
|
public void EnableCodeCompletionToolTips(bool flag)
|
|
{
|
|
if (flag)
|
|
{
|
|
foreach (CodeFileDocumentControl tp in this.OpenDocuments.Values)
|
|
{
|
|
AddEditorHandlers(tp);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
foreach (CodeFileDocumentControl tp in this.OpenDocuments.Values)
|
|
{
|
|
RemoveEditorHandlers(tp);
|
|
}
|
|
}
|
|
}
|
|
|
|
private bool watch_vis = false;
|
|
public void SetDebugTabsVisible(bool flag)
|
|
{
|
|
if (flag)
|
|
{
|
|
if (!DebugWatchListWindow.IsHidden)
|
|
{
|
|
watch_vis = true;
|
|
}
|
|
if (WorkbenchServiceFactory.DebuggerManager.ShowDebugTabs)
|
|
{
|
|
if (!BottomTabsVisible)
|
|
BottomTabsVisible = true;
|
|
ShowContent(DebugWatchListWindow, false);
|
|
ShowContent(DebugVariablesListWindow, false);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
//HideContent(DebugWatchListWindow);
|
|
if (!watch_vis)
|
|
{
|
|
HideContent(DebugWatchListWindow);
|
|
}
|
|
watch_vis = false;
|
|
HideContent(DebugVariablesListWindow);
|
|
}
|
|
}
|
|
|
|
private void ChangeDebugButtons(bool stop_as_visible)
|
|
{
|
|
if (PlayPauseButtonsVisibleInPanel)
|
|
if (stop_as_visible)
|
|
{
|
|
this.StartDebugButton.Visible = false;
|
|
this.StopDebugButton.Visible = true;
|
|
}
|
|
else
|
|
{
|
|
this.StartDebugButton.Visible = true;
|
|
this.StopDebugButton.Visible = false;
|
|
}
|
|
}
|
|
|
|
public void SetStopEnabled(bool enabled)
|
|
{
|
|
stopButton.Enabled = miStop.Enabled = enabled;
|
|
}
|
|
|
|
public void SetOptionsEnabled(bool val)
|
|
{
|
|
foreach (OptionsContent.IOptionsContent content in this.optionsContentEngine.ContentList)
|
|
content.Content.Enabled = val;
|
|
}
|
|
}
|
|
}
|