Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a IDE Wizard that creates a simple MARS Server Application
* Adding a IDE Wizard that creates a simple MARS Server Application
- Loading branch information
1 parent
4fd9702
commit b127137
Showing
13 changed files
with
1,651 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
unit MARS.Wizards.Modules.MainForm; | ||
|
||
interface | ||
|
||
uses | ||
MARS.Wizards.Utils, | ||
ToolsAPI; | ||
|
||
resourcestring | ||
SMARSServerMainFormSRC = 'MARSServerMainFormSRC'; | ||
SMARSServerMainFormDFM = 'MARSServerMainFormDFM'; | ||
SMainFormFileName = 'ServerMainForm'; | ||
|
||
type | ||
TMarsServerMainFormCreator = class(TInterfacedObject, IOTACreator, IOTAModuleCreator) | ||
public | ||
// IOTACreator | ||
function GetCreatorType: string; | ||
function GetExisting: Boolean; | ||
function GetFileSystem: string; | ||
function GetOwner: IOTAModule; | ||
function GetUnnamed: Boolean; | ||
|
||
// IOTAModuleCreator | ||
function GetAncestorName: string; | ||
function GetImplFileName: string; | ||
function GetIntfFileName: string; | ||
function GetFormName: string; | ||
function GetMainForm: Boolean; | ||
function GetShowForm: Boolean; | ||
function GetShowSource: Boolean; | ||
function NewFormFile(const FormIdent, AncestorIdent: string): IOTAFile; | ||
function NewImplSource(const ModuleIdent, FormIdent, AncestorIdent: string): IOTAFile; | ||
function NewIntfSource(const ModuleIdent, FormIdent, AncestorIdent: string): IOTAFile; | ||
procedure FormCreated(const FormEditor: IOTAFormEditor); | ||
end; | ||
|
||
implementation | ||
|
||
uses | ||
System.SysUtils; | ||
|
||
{$REGION 'IOTACreator'} | ||
|
||
function TMarsServerMainFormCreator.GetCreatorType: string; | ||
begin | ||
Result := sForm; | ||
end; | ||
|
||
function TMarsServerMainFormCreator.GetExisting: Boolean; | ||
begin | ||
Result := False; | ||
end; | ||
|
||
function TMarsServerMainFormCreator.GetFileSystem: string; | ||
begin | ||
Result := ''; | ||
end; | ||
|
||
function TMarsServerMainFormCreator.GetOwner: IOTAModule; | ||
begin | ||
Result := ActiveProject; | ||
end; | ||
|
||
function TMarsServerMainFormCreator.GetUnnamed: Boolean; | ||
begin | ||
Result := True; | ||
end; | ||
|
||
{$ENDREGION} | ||
{$REGION 'IOTAModuleCreator'} | ||
|
||
function TMarsServerMainFormCreator.GetAncestorName: string; | ||
begin | ||
Result := 'TForm'; | ||
end; | ||
|
||
function TMarsServerMainFormCreator.GetImplFileName: string; | ||
begin | ||
Result := GetCurrentDir + '\' + SMainFormFileName + '.pas'; | ||
end; | ||
|
||
function TMarsServerMainFormCreator.GetIntfFileName: string; | ||
begin | ||
Result := ''; | ||
end; | ||
|
||
function TMarsServerMainFormCreator.GetFormName: string; | ||
begin | ||
Result := 'MainForm'; | ||
end; | ||
|
||
function TMarsServerMainFormCreator.GetMainForm: Boolean; | ||
begin | ||
Result := True; | ||
end; | ||
|
||
function TMarsServerMainFormCreator.GetShowForm: Boolean; | ||
begin | ||
Result := True; | ||
end; | ||
|
||
function TMarsServerMainFormCreator.GetShowSource: Boolean; | ||
begin | ||
Result := True; | ||
end; | ||
|
||
function TMarsServerMainFormCreator.NewFormFile(const FormIdent, AncestorIdent: string): IOTAFile; | ||
begin | ||
Result := TMarsSourceFile.Create(SMARSServerMainFormDFM); | ||
end; | ||
|
||
function TMarsServerMainFormCreator.NewImplSource(const ModuleIdent, FormIdent, AncestorIdent: string): IOTAFile; | ||
begin | ||
Result := TMarsSourceFile.Create(SMARSServerMainFormSRC); | ||
end; | ||
|
||
function TMarsServerMainFormCreator.NewIntfSource(const ModuleIdent, FormIdent, AncestorIdent: string): IOTAFile; | ||
begin | ||
Result := NIL; | ||
end; | ||
|
||
procedure TMarsServerMainFormCreator.FormCreated(const FormEditor: IOTAFormEditor); | ||
begin | ||
end; | ||
|
||
{$ENDREGION} | ||
|
||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
unit MARS.Wizards.Modules.Resources; | ||
|
||
interface | ||
|
||
uses | ||
MARS.Wizards.Utils, | ||
ToolsAPI; | ||
|
||
resourcestring | ||
SMARSServerResources = 'MARSServerResources'; | ||
SServerResourcesFileName = 'ServerResources'; | ||
|
||
type | ||
TMarsServerResourcesCreator = class(TInterfacedObject, IOTACreator, IOTAModuleCreator) | ||
public | ||
// IOTACreator | ||
function GetCreatorType: string; | ||
function GetExisting: Boolean; | ||
function GetFileSystem: string; | ||
function GetOwner: IOTAModule; | ||
function GetUnnamed: Boolean; | ||
|
||
// IOTAModuleCreator | ||
function GetAncestorName: string; | ||
function GetImplFileName: string; | ||
function GetIntfFileName: string; | ||
function GetFormName: string; | ||
function GetMainForm: Boolean; | ||
function GetShowForm: Boolean; | ||
function GetShowSource: Boolean; | ||
function NewFormFile(const FormIdent, AncestorIdent: string): IOTAFile; | ||
function NewImplSource(const ModuleIdent, FormIdent, AncestorIdent: string): IOTAFile; | ||
function NewIntfSource(const ModuleIdent, FormIdent, AncestorIdent: string): IOTAFile; | ||
procedure FormCreated(const FormEditor: IOTAFormEditor); | ||
end; | ||
|
||
implementation | ||
|
||
uses | ||
System.SysUtils; | ||
|
||
{$REGION 'IOTACreator'} | ||
|
||
function TMarsServerResourcesCreator.GetCreatorType: string; | ||
begin | ||
Result := sUnit; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.GetExisting: Boolean; | ||
begin | ||
Result := False; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.GetFileSystem: string; | ||
begin | ||
Result := ''; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.GetOwner: IOTAModule; | ||
begin | ||
Result := ActiveProject; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.GetUnnamed: Boolean; | ||
begin | ||
Result := True; | ||
end; | ||
|
||
{$ENDREGION} | ||
{$REGION 'IOTAModuleCreator'} | ||
|
||
function TMarsServerResourcesCreator.GetAncestorName: string; | ||
begin | ||
Result := ''; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.GetImplFileName: string; | ||
begin | ||
Result := GetCurrentDir + '\' + SServerResourcesFileName + '.pas'; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.GetIntfFileName: string; | ||
begin | ||
Result := ''; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.GetFormName: string; | ||
begin | ||
Result := ''; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.GetMainForm: Boolean; | ||
begin | ||
Result := False; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.GetShowForm: Boolean; | ||
begin | ||
Result := False; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.GetShowSource: Boolean; | ||
begin | ||
Result := False; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.NewFormFile(const FormIdent, AncestorIdent: string): IOTAFile; | ||
begin | ||
Result := NIL; | ||
end; | ||
|
||
function TMarsServerResourcesCreator.NewImplSource(const ModuleIdent, FormIdent, AncestorIdent: string): IOTAFile; | ||
begin | ||
Result := TMarsSourceFile.Create(SMARSServerResources); | ||
end; | ||
|
||
function TMarsServerResourcesCreator.NewIntfSource(const ModuleIdent, FormIdent, AncestorIdent: string): IOTAFile; | ||
begin | ||
Result := NIL; | ||
end; | ||
|
||
procedure TMarsServerResourcesCreator.FormCreated(const FormEditor: IOTAFormEditor); | ||
begin | ||
end; | ||
|
||
{$ENDREGION} | ||
|
||
end. |
Oops, something went wrong.