Package FormsConstructor v1.1

 

Using

The Package is intended for extended use of RAD technologies in YOUR programs and projects. The Package consists of bounded parts allowing, within the framework of usual ambience of the development to simplify making the following things:

 

Little about DFM / XFM and RAD

The IDE and strictly compiled code (exe file) are built around use DFM / XFM - a resource. The Compiled code - a set component, but DFM / XFM - a resource this card to generations object and change their characteristic when boot. At development DFM / XFM - a facility are found in the manner of files (unit1.dfm) when compiling are integrated in exe-files (the field RCDATA).

Herewith in DFM / XFM - a resource are saved published characteristic main object boot (TForm or TFrame) but rest components are embedded and their characteristic are too saved. When initializing the program are defined address "published" methods/function main object boot upon their names, which you have assigned to cause under On_XXX event.

The compiled set component (that components, which can be used at generations of the program)- is defined, first of all, through description object in "published" section.

Itself a DFM / XFM - resource allows to create any amount an object from compiled set component and describe their properties.

 

TForm1 = class(TFormER)

//“published” //!!!!!!!!!!!!!!!

  Button1: TButton;

  procedure Button1Click(Sender: TObject);

private

public

published // !!!!!!!!!!!!!

  property TextAbout: String read FTextAbout write SetTextAbout;

end; 

  

In detail about changing external and function type of application

The package is basically intended for making the programs in which user itself defines, what components to him to use and what property to change that much in complex multifunctional applications comfortable. Including possible create one base component a form with description all possible component and create for it several interfaces specially under determined activity with possibility of their change by user. This possible from for use script language, which allows to change the properties an object and start "published" procedures.

 

Units and components

Unit FormER/QFormER

- include the facility for automatic boot/save of the forms (TForm or TFrame) from/in DFM / XFM files or from DFM / XFM integrated resource (the module FormER for Windows applications, module QFormER for Cross-platform applications).

By default works with DFM / XFM-file of your project (unit1.dfm, unit2.dfm). Also pay attention to examples Object Repository (Form-constructor and Form-constructor Clx) in them forms are presented in DFM-code (MenuItem 'Text DFM' unchecked) rather then text type as by default.

 

Unit FormER/QFormER

Variable

Description

TFormER

Component, is a legal successor TForm and is intended for its change i.e. when making the new form is used TForm1 = class(TFormER)

Form_LoadFromFile: Boolean

Defines, will whence be done call from file or built-in resource under following making the form or forms (on default: False)

Form_UnitFile: string

 

Contains filename, from which will be realized boot the form or forms under their creation

 

TFormER

Property

Description

UnitFile: string

Name of the module, whence was a boot form or filename where it is necessary its save

LoadFromFile: Boolean

Form was boot from file

MakeBackupFile: Boolean

Create BackUp file at save the form

 

Note. Property Visible = True when initializing the program marks that form be displayed immediately as active (main), thereby for  that forms which you do not want to do active, but they visible, directly before save need assign Visible = False, then bring back into former position. If all forms when boot with Visible = False, that first form is assigned active.

1)       ‘C:\Project1\’ or ‘’ – name DFM / XFM file is defined automatically on given object (it complies with name of the module in which is described saved / boot object);

2)       ‘..\..\unit1.dfm’ – location of the file is defined for locations a exe - file;

3)       ‘..\unit1’ – extension .dfm or .xfm is substituted except whole other;

 

Unit xFMHandle

- include facility for boot / save object, convertation  DFM / XFM files in text files conversely.

Note. The name of the files, used in method of this module, can be specified in the manner of:

4)       ‘C:\Project1\’ or ‘’ – name DFM / XFM file is defined automatically on given object (it complies with name of the module in which is described saved / boot object);

5)       ‘..\..\unit1.dfm’ – location of the file is defined for locations a exe - file;

6)       ‘..\unit1’ – extension .dfm or .xfm is substituted except whole other;

 

Unit xFMHandle

Method

Description

ConvertFileResourceToText(const ResFile,TxtFile: String): String

Convertation DFM / XFM file in text file, returns full name of the text file

ConvertTextFileToResource(const TxtFile, ResFile: String): String

Convertation text file-resource in DFM / XFM file, returns full name of the file-resource

InitComponent(Instance: TComponent; LoadFromFile: Boolean; UnitFile: String): Integer

Boot of the object or from file if it exists or from precompiled resource

InitComponentByStep(Instance: TComponent; var LoadFromFile: Boolean; var UnitFile: String)

Boot of the object on step:

1)       try to load from file;

2)       if file contains not correct resource or does not exist to load resource from BackUp file if this not possible go to step 3;

3)       If component pertains or to TForm or to TFrame to load from precompiled resource;

SaveComponentResFile(const FileName: string; Instance: TComponent; MakeBackupFile: Boolean): String

Save the component in DFM / XFM file. Returns the full way to file.

Variable

Description

ExePath: String

Path, where is found exe-file your program, from which and are defined all absolute ways on given relative

BrokenExt: String = '.broken'

*Extension incorrect xFM files

BackUpExt: String = '.saved'

*Correct previous versions xFM files have an extensions BackUpExt

ResExt: String

Extension xFM file, or '.dfm (for Windows applications) or '.xfm (for Cross-platform applications) or that, which set you

* - they are intended for maximum capacity to work of your programs even though user accidentally something will spoil.

 

Unit MacrosHandle

- includes the facility for processing Pascal-like script-language in run-time mode. Which is intended for start "published" procedures any object and change published characteristic object.

Note: in macros you may to start not only procedures of its form but procedures of other forms and object provided that they are described as “published”, but objects which is described not in Design-Time mode (declared as Application, Screen and etc.) are added to list changeable component (the method AddPointComponent).

Syntax: String of macros can include several operators with follow syntax

Procedure (use parameter inadmissible): for example: Form1.ShowMe;

Operators of the assignation: ‘=’ or ‘:=’ and for sets a possible ‘+=’ и ‘-=’;

Integer: 109 or $6D;

String:  "word" or ‘'word’;

Set: [item1, item2] or (item1, item2) or item1, item2;

For example macros:

‘Form1.ShowmMe

Form1.Caption = “Form1”

Form1.Top =11’

 

Unit MacrosHandle

Variable

Description

MacrosHandler: TMacrosHandler

Variable-component, is intended for processing of all macro commands of your application

 

MacrosHandler: TMacrosHandler

Method

Description

AddPointComponent(_Name: string; _pComponent: PComponent)

Add the component (described as MacrosHandler) to list active component for following its call on first queue

AddAliace(_Aliace,_Text: String)

Add the pen name to in macro command text _Aliace was interpreted as _Text

GetPropValueByMacros(Macros: String; var Prop: TPropRec): TpropValue

The reception of value of property, its type and other satellite information when interpreting macros. Where Macros, for instance: 'Form1.Memo1.Height'

ExecMacros(Macros: String)

Execution macros

 

Unit ActionM

- includes the component, which allows to use instead of procedures of the processing the messages of the macro command in buttons, elements of menu.

 

TActionM

Property

Description

MacrosOnExecute: String

Text of macros, which will be execute when coming the event OnExecute

 

What component works: at registrations of this package component TActionM is added to TActionList (category 'MacrosAction'). Already when initialization of exhibit at purpose characteristic MacrosOnExecute on event OnExecute is put procedure, which and starts MacrosHandler.ExecMacros(FMacrosOnExecute). In the following at collecting our TActionM object with button or element of menu, handler OnExecute is put and on OnClick buttons or element of menu.

 

Unit PropEditors

- includes the user components for change property of object in run-time mode.

 

Unit PropEditors

Component

Description

TpropCheckBox

It is intended for change Boolean/Set property

TpropEdit

It is intended for change Text/Integer property

TpropRadioButton

It is intended for change Enum property

 

TPropCheckBox

Method or property

Description

UpdatePropertyValue

Procedure of the renovation the value of property in manual mode (necessary to execute if automatic renovation is disconnected)

PostponeUpdate: Boolean

Disconnect/include automatic renovation a characteristic in component, for manual renovation it is necessary to execute procedure UpdatePropertyValue

SetEnumName: string

Name of the value or values (through comma) from list which necessary to add/delete

(for instance: bsToolWindow)

PropertyName: string

Name of property, which it is necessary to change

(for instance: Form1.BorderStyle)

 

TPropEdit

Method or property

Description

UpdatePropertyValue

Procedure of renovation the value of property characteristic in manual mode (necessary to execute if automatic renovation is disconnected)

PostponeUpdate: Boolean

Disconnect/include automatic renovation a characteristic in component, for manual renovation it is necessary to execute procedure UpdatePropertyValue

Text: string

Value of string or integer number in text type

(for instance: ‘Form1’ or ‘250’)

PropertyName: string

Name of property, which it is necessary to change

(for instance: Form1.Caption or Form1.Height)

 

TPropRadioButton

Method or property

Description

UpdatePropertyValue

Procedure of renovation the value of property in manual mode (necessary to execute if automatic renovation is disconnected)

PostponeUpdate: Boolean

Disconnect/include automatic renovation a property in component, for manual renovation it is necessary to execute procedure UpdatePropertyValue

EnumName: string

Name of the value from list, on which it is necessary to change a value of property

(for instance: wsNormal)

PropertyName: string

Name of property, which it is necessary to change

(for instance: Form1.WindowState)

 

Unit ResourceStringsManage

- includes the facility for change value of string resource and following their use i.e. the facilities for localization of application (the module is basically intended for change the strings-constants, precompiled by directive ResourseString on string variable, whose values are saved in same DFM / XFM - a file).

.

 

Unit ResourceStringsManage

Component or variable

Description

TResourceStrings

It is intended for accompaniment/change string constants of your application

ResourceStringsManager: TResourceStringsManager

Variable-component, is intended for access to all strings constant declare in component TResourceStrings whole your application

 

TResourceStrings

Property

Description

ResourceStrings: TResStrItems

List of strings resource, where StringName - a name of the string, which is uses for its identifications (must be such, either as name variable in module), StringName - value of the string

 

ResourceStringsManager: TResourceStringsManager

Method

Description

SetStringValue(const StrName: String; var StrValue: String);

The procedure to adding the name of the string and its value to list of the string-variable.

Update;

Procedure of the servicing the list of strings (it is necessary to start in each module after adding all strings-variable)

 

What component works: first you create the special module for work with strings-variable (see FCConsts.pas) in which you adding string to list string-resource. All that strings which you have added or adding to object created from class TResourceStrings change, in step of generations of the form or run-time mode, value of the strings-variable in module. I.e. with strings-variable possible to work as well as with constant described by directive resourcestring.

Note: possible change and standard modules IDE for compatibility them with component TResourceStrings (at code where they are used change no need).

  

P.S. Excuse me for my English.

Package FormsConstructor v 1.1

 Copytight © 2003 Gena A. Petrov.

All right reserved.