Table of Contents

TIDEEngine Class

Main controller component for the Scripter Studio IDE, coordinating all IDE parts and encapsulating script project operations.

Remarks

TIDEEngine is the main component for scripter IDE management. It is the controller component for the IDE, sending and receiving notifications to/from IDE parts (designer, memo, inspector, toolbars) and making them work together. It also encapsulates all operations with script projects. You can use TIDEEngine to create new projects, load and execute existing ones, programatically add new files, forms, among other operations. You can use TIDEEngine to build your own scripter IDE. In this case you assign the several parts of the IDE (scripter, inspector, designer, etc.) to the respective properties of TIDEEngine, and it will make all work together. TIDEEngine provides several high-level methods like DlgOpenFile, DlgSaveFile, DlgNewProject, that performs all operation of displaying the open/save dialogs, load all files and notify the IDE parts to be updated. Note that if you use TIDEEngine associated with TIDEDialog component (which is a totally pre-built IDE), you don't need to use those methods, since TIDEDialog already provides an IDE form with menus and toolbars that are already configured to call those TIDEEngine methods.

Syntax

Unit: IDEMain

TIDEEngine = class(TComponent);

Methods

Name Description
ActiveFileModified Notifies the IDE that the active file was modified. This is often called by external/custom editors.
AddNotifier Call AddNotifier to add a TIDEEngineNotifier object which will receive notifications by the engine about changes in the IDE. See TIDEEngineNotifier for more information.
BeginRegister​Components Begins a batch component registration operation to prevent toolbar updates until EndRegisterComponents is called.
CanRedoDesigner Indicates if a redo operation can be performed on form designer. If no form is being displayed it always return false
CanUndoDesigner Indicates if an undo operation can be performed on form designer. If no form is being displayed it always return false
CompileProject Compiles the main unit script of the project, and its dependencies.
CreateMainUnits Creates the initial script units needed for a blank project that runs an empty form.
DebugPause Pauses the script execution, for IDE debugging purposes
DebugReset Halts script execution.
DebugRunToLine Performs debug action "run to line": run the active script until the line currently selected in memo editor.
RunMode is used only if the project is not running, to specify which script will be used to start execution.
DebugStepOver Performs debug step over action in the current active script.
RunMode is used only if the project is not running, to specify which script will be used to start execution.
DebugToggleBreak Toggles breakpoint on/off in the memo and script, in the line number specified by ALine.
If ALine is -1 then current line in memo will be toggled for breakpoint
DebugTraceInto Performs debug step into action in the current active script.
RunMode is used only if the project is not running, to specify which script will be used to start execution.
DebugUntilReturn Performs debug action "run until return": run the active script until the routine exists.
RunMode is used only if the project is not running, to specify which script will be used to start execution.
DlgAddWatch Calls the Add Watch dialog to add a new watch while debugging. Returns nil if no watch is added, otherwise returns the newly created TatScripterWatch object. There is no need to destroy this object later, the engine takes care of it automatically.
DlgCloseActiveFile Same as DlgCloseFile, except that you don't have to pass the file to closed, it uses the currently active file.
DlgCloseAll Closes all files and the project, prompting the end-user to save modified files as needed.
DlgCloseFile Closes the specified file, asking the end-user to save it if modified.
DlgNewProject Opens a dialog to create a new script project and returns true if the end-user confirmed the operation.
DlgOpenFile Opens a file dialog to choose a script file, adds it to the project, and returns the new TIDEProjectFile.
DlgOpenProject Opens a dialog to choose and load a project file, returning true if the project was opened successfully.
DlgRemoveActiveFile Same as DlgRemoveFile, except you don't have to pass the file to be removed, it removes the currently active file.
DlgRemoveFile Removes the file specified by AFile from the project. If the file was not saved, it shows a dialog asking for saving it. The method returns true if the file was successfully removed.
DlgSaveActiveFile Same for DlgSaveFile method, except you don't have to pass the file to be saved, it uses the currently active file in the project.
DlgSaveActiveFileAs Same as DlgSaveFileAs, except you don't have to pass the file to be saved, it uses the currently active file in the project.
DlgSaveAll Saves all files in the project, opening Save As dialogs for any files not yet saved.
DlgSaveFile Saves the specified file, opening a Save As dialog if it has not been saved before.
DlgSaveFileAs Opens a Save As dialog to save the specified file under a new name.
DlgSaveProject Save the current project. If the project was not saved yet, it calls DlgSaveProjectAs to choose the file name for the project.
DlgSaveProjectAs Opens a save dialog to save the current project. Returns true if the project was saved sucessfully.
It does not save the files, only the main project file.
DlgSelectLanguage Opens a dialog for the end-user to choose a script language and returns the selected language.
DlgSelectMainUnit This method opens a dialog window for the end-user to choose the unit which will be the main unit of project.
If the operation was canceled by end-user, this method returns false, otherwise it returns true.
EndRegisterComponents Call EndRegisterComponents to terminate an operation started with BeginREgister​Components method.
LoadProject LoadProject loads the current project using current settings. You will rarely call LoadProject, it is internally used by OpenProject method, which is the one you should use to programatically load a project from file.
NewFormUnit Programatically adds a new file containing a script and an associated form to the current project.
NewProject Programatically creates a new blank project, discarding any existing project without confirmation.
NewUnit Programatically adds a new script-only file (without a form) to the current project.
NextRedoDesigner​Action Retrieves the name of next redo action for the form designer If it is an empty string, then there is no redo action to perform.
NextUndoDesigner​Action Retrieves the name of next undo action for the form designer If it is an empty string, then there is no undo action to perform.
NotifyDesignerChange For internal use only. Do not rely on this method.
OpenFile Opens the file specified by AFileName, adds it to the project, and makes it active in the IDE.
OpenProject Loads the project specified by AFileName and all its associated files, replacing any existing project.
RedoDesigner Performs an Undo operation in the form designer. If there is nothing to redo, or if there is no form being designed, nothing happens.
RegisterAdditionalTab Registers the following components in the tab "Additional": TBitBtn, TSpeedButton, TMaskEdit, TImage, TShape, TBevel, TStaticText, TSplitter
RegisterComponent Registers a component class so it appears in the IDE palette toolbar and can be placed in form designs.
RegisterDialogsTab Registers the following components in the tab "Dialogs": TOpenDialog, TSaveDialog, TFontDialog, TColorDialog, TPrintDialog, TPrinterSetupDialog
RegisterStandardTab Registers the following components in the tab "Standard": TMainMenu, TPopupMenu, TLabel, TEdit, TMemo, TButton, TCheckBox, TRadioButton, TListBox, TComboBox, TGroupBox, TPanel, TRadioGroup}
RegisterWin32Tab Registers the following components in the tab "Win32".
TTabControl, TPageControl, TProgressBar, TTreeView, TListView, TDateTimePicker
RemoveNotifier Call RemoveNotifier to remove the TIDEEngineNotifier object specified by ANotifier which was previously registered with AddNotifier. The object will no longer receive notifications from the engine.
RunActiveScript Runs the script currently active in the IDE. Save as RunScript(​rmActive​Unit)
RunProject Executes the main unit script. Same as RunScript(​rmMain​Unit)
RunScript Executes a script in the project according to the specified RunMode.
SaveProject Saves the current project and all its files using their current settings and file names without dialogs.
SyncFilesFromScripts Synchronizes the project file list with the scripts currently held by the associated scripter component.
ToggleViewMode Toggles the edit mode from unit view to form view and vice-versa. Basically it displays and set focus on the memo if the form designer is active, and vice-versa
UndoDesigner Performs an Undo operation in the form designer. If there is nothing to undo, or if there is no form being designed, nothing happens.
UnregisterComponent Overloaded
UnregisterComponent(TComponentClass)
UnregisterComponent(string)
UnregisterTab Unregisters all existing registered components belonging to the page specified by APage. In other words, the tab specified by APage will be removed and will not appear in the component palette toolbar in the IDE.
UpdateIDE Call UpdateIDE to update all IDE elements, specially the memo and form designer, to reflect any changes to AFile made programatically. The file specified by AFile will become the current active file in the IDE.
VisibleFileCount Return the number of visible files in IDE

Properties

Name Description
ActiveFile Returns the project file that is currently active (selected) in the IDE.
ActiveScript ActiveScript provides access to the TatScript object associated with the project file currently active (selected) inthe IDE.
AutoStyler Indicates whether the IDE memo editor automatically adjusts its syntax highlighting to match the current script language.
BasePath Gets or sets the base directory used for resolving relative file paths of project files.
ComponentCombo Gets or sets the TIDEComponentComboBox component used to display and select components in the IDE.
ComponentsFilter Specifies which components should be displayed in the component palette.
DesignControl Gets or sets the TIDEFormDesignControl component that handles form designing in the IDE.
Designer Provides access to the TIDEFormDesigner used to design the currently active form.
FileExtBasicUnit Specifies the file extension used for basic source code files. Default value is '.bsc'
FileExtForm Specifies the file extension used for form files. Default value is '.dfm'
FileExtPascalUnit Specifies the file extension used for pascal source code files. Default value is '.psc'
Files Gets the collection of all files belonging to the current project.
FormDesigner Not used.
Inspector Gets or sets the TIDEInspector component used as the object inspector in the IDE.
MainUnit Specifies the main unit of the project. The main unit is the unit which will be executed when the project runs.
Memo Gets or sets the TIDEMemo component used as the source code editor in the IDE.
Options Provides access to subproperties that control the behavior of the IDE. See TIDEEngineOptions documentation.
PaletteButtons Gets or sets the TIDEPaletteButtons component used as the modern-style palette toolbar in the IDE.
PaletteToolbar Gets or sets the TIDEPaletteToolbar component used as the classic-style palette toolbar in the IDE.
PreventDefault​Event​Creation Specifies if a default event is edited when a component is double clicked in the designer.
ProjectExt Specified the default extension for TMS Scripter project files.
Default value is ".ssproj". This value will be used in open/file dialogs used to load/save project fiels.
ProjectName ProjectName holds the name of the current project, without file path or file extension.
RegisteredComps RegisteredComps property provides a collection of all components currently registered in the engine that will be available in IDE component palette toolbars for the end-user to use in form designing.
Scripter Gets or sets the TIDEScripter component used by the engine for all scripting operations.
SelectedComponent Retrieves the component which is current selected in the environment. If multiple components are selected, this property returns nil
TabControl Gets or sets the tab control component used to display the list of visible files in the IDE.
VisibleFiles[​Index] Provides indexed access to all visible files in the IDE.
WatchList Gets or sets the TIDEWatchListView component that displays debug watches in the IDE.

Events

Name Description
BeforeAddWatchDlg BeforeAddWatchDlg event is fired before a add watch dialog is displayed (when DlgAddWatch method is caled).
OnActiveFileChanged OnActiveFileChanged is fired when the currently active (selected) file in the IDE changes.
OnCheckValidFile OnCheckValidFile is used to inform the engine if a project file exists or not. See TCheckValidFileEvent for more information.
OnComponentPlaced OnComponentPlaced is fired when a new component is placed (added) in the form being designed.
OnDesignerSelection​Changed OnDesignerSelection​Changed is fired when the current selected componented is changed in form designer.
OnGetComponentImage OnGetComponentImage is fired, for each registered component, when the component palette toolbar builds itself, to allow programmer to provide an icon image for the component to be displayed in the palette toolbar.
OnLoadFile OnLoadFile can be used to load a project file from a different place other than the hard disk.
See TIDELoadFileEvent for more information.
OnOpenDialog OnOpenDialog can be used to display a custom open dialog instead of the standard one used by the IDE engine.
See TIDEOpenDialogEvent for more information.
OnProjNameChanged OnProjNameChanged event is fired when the name of current project is changed, either because of a save as operation, or because a new project was created/open
OnRunningChanged OnRunningChanged event is fired when a script execution starts or stops.
OnSaveDialog OnSaveDialog can be used to display a custom save dialog instead of the standard one used by the IDE engine.
See TIDESaveDialogEvent for more information.
OnSaveFile OnSaveFile can be used to save a project file to a different place other than the hard disk.
See TIDESaveFileEvent for more information.
OnShowSourceEditor Event fired when the IDE needs to display the source code editor at a specified cursor position.
OnViewModeChanged OnViewModeChanged is fired when the display mode of current active file changes from unit (source code) to form or vice-versa.