TGForm

From Gestinux Wiki
Revision as of 14:45, 3 December 2014 by Tintinux (talk | contribs) (Created page with "TGForm is the common ancestor of all visible forms in Gestinux and Gestinux_util. == Launching == All forms must be created with the '''Launch''' function which is automatic...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

TGForm is the common ancestor of all visible forms in Gestinux and Gestinux_util.

Launching

All forms must be created with the Launch function which is automatically created in the new form. This may help moving to other interfaces.

Keys

Some keys are processed at this level (and should not be used elsewhere).

F1 : will display the help corresponding to the HelpKeyword property of the new form.

ESCAPE : closes the form (some code can be written in OnCloseQuery or OnClose)

F4 : in case you have setup a translation file (in Language > Translation), this key alone will toggle from a language to another to compare and check.

CTRL-F4 : also if there is a translation file, thsi key will open the translator form for the current form, to enter quickly translations.

Position and Dimensions

The first time a modal Form is launched, it is centered on it's parent, and it has the minimal width and height defined for this form in the Constraints property.

If the positions or the sizes are changed, they will be saved automatically (in a inifile) and used the next time the form is launched.

This do not applies to non modal and/or autosized forms.


Translations

Translate performs all automatic translations for as explained in Internationalisation programmation .

It is sometimes useful to override it in the new form, to perform translations by code (if TranslateMessage or TranslateText are used in the form, they should only be located in the descendant Translate procedure).

ErrorMessage, AbortMessage, ConfirmationMessage, CancelEntriesMessage and InformationMessage should be used (instead of SHowMessage and MessageDlg), and automatic translation is performed.


Gestinux_util forms

Forms belonging to Gestinux_util are using separate translation files, located in Gestinux_util instead of Gestinux.

The property IsUtilForm must be set to true in the OnCreate event of such forms, to use the right translation file.