TIDEProjectFile Class
Represents a script file within a project, holding its script reference, form data, view state, and file path.
Remarks
TIDEProjectFile object holds information about a script file in project. For each file in the project, a TIDEProjectFile object is created in the IDE Engine. A file in a project corresponds to a script. The file can be just a single script, or a script and a form associated with it. This object holds several information about the file, for example, if the file is visible, if the script or form is being displayed, the associated script object, etc.
Syntax
Unit: IDEMain
TIDEProjectFile = class(TCollectionItem);
Methods
| Name | Description |
|---|---|
| ChangeFileName | Changes the file name of this project file, updating the script unit name and notifying dependent scripts if requested. |
| IsForm | Returns true if this project file is a script form. If the project file is only a script unit without a form, the method returns false. |
| LoadFormFromString | Loads the form (if exists) from the string AString previously saved. Parameter ADMFormat specified if the string contains the form resource saved in binary or text format. |
| Save | Saves the file content to disk using the current file name without displaying any dialog. |
| SaveFormToString | Saves the current form data to a string and returns it. Use LoadFormFromString to restore it later. |
| UpdateFormHeader | UpdateFormHeader changes the script source code in order to update the form header ($FORM directive). It is used by the IDE when the file name or form name changes, for example, so the script source code must be updated automatically. |
Properties
| Name | Description |
|---|---|
| FilePath | Contains the path in which this file is saved. FilePath can have an absolute or relative value. If relative, this property contains the file path relative to TIDEEngine.BasePath property. |
| Form | Contains a reference to the script form instance associated with this file. If the file does not contain a form, this property is nil. |
| FormResource | Contains the current form data in string format. The information is saved using the Delphi streaming system and is presented in text format. |
| Modified | Indicates if the current file was modified since created, loaded or saved by last time. |
| Saved | Indicates whether this project file has been saved to disk at least once. |
| Script | Gets or sets the TatScript object associated with this file. |
| UnitName | Contains the unit name of this file. Usually the unit name is the same as the file name, and you rarely need to change this property. |
| ViewMode | Gets or sets whether the file is currently displayed as source code or as a form designer. |
| Visible | Indicates if the current file is visible in the IDE or not. The file can be invisible (not being displayed) but still belongs to the script project. |