|
|
|
|
|
- Overview
- The different parts of the window description
- 1. The characteristics of the window
- 2. Description of the buttons
- 3. Code of the buttons
MDL file (kept for backward compatibility): Window description
Warning
From version 2024, this feature is no longer available.
The MDL file is the file used to generate a RAD window. This file contains the entire description of the pattern to generate. This description is made of two distinct parts: - the description of the pattern,
- the description of the window.
This help page only presents the code used to describe the window. To present this code in details, the script of a Form.mdl pattern is used. CAUTION: In version 12, the RAD was entirely rebuilt. MDL files are kept for backward compatibility. For more details, see New RAD patterns. The different parts of the window description 1. The characteristics of the window ############################################################## # # F O R M # ############################################################### ############################################################### # # Description of form section # ############################################################### [FormArea] ############################# File=A AreaName=Form AreaDesc=Choose the file or query associated with the window Coord=6,6,200,500 FILETYPE=ExceptRelation The different elements used in this code are as follows: | | [FormArea] | Marks the beginning of the section for describing the window | File | File associated with the area (the window in this case) | AreaName | Name of the area | AreaDesc | Descriptive sentence used to choose the element associated with the window | Coord | Coordinates of the area, specified in the following format: <X>, <Y>, <Width>, <Height> | FileType | Type of accepted files: All, Relation, ExceptRelation |
2. Description of the buttons ############################################################## # # Description of the validation buttons associated with the form # ############################################################## [ButtonArea] ############################# NameAssocArea=Form Coord=212,6,80,54 AUTOEXTENSION=4 AreaName=Button_Form_Modif ############################# # Modification button ############################# BUTTON=OK,OK,Validation,GP_MODIF,OKButton BUTTON=Cancel,Cancel,Abandon,GP_MODIF,CancelButton The different elements used in this code are as follows: | | [ButtonArea] | Marks the beginning of the section for describing the window buttons | NameAssocArea | Indicates the name of the control area associated with the button area | %ifdef | Signals the beginning of a conditional code. The entire statement is as follows:
%ifdef .... %else %endif | Coord | Coordinates of the button area, specified in the following format: <X>, <Y>, <Width>, <Height> | AUTOEXTENSION | The area can be enlarged: 1. Vertical move 2. Vertical enlargement 4. Horizontal move 8. Horizontal enlargement | AreaName | Name of the button area | BUTTON | Description of one of the buttons: Name of button, caption, type of button, associated group, associated style in the skin template of project. This style must be selected among the following styles:
| | | NewButton | ModifyButton | DeleteButton | CloseButton | BrowseButton | FirstButton | PreviousButton | NextButton | LastButton | PrintButton | VisionButton | |
|
3. Code of the buttons ############################# # Code of OK button ############################# ButtonCode=Beginning,OK %define PCODE Click %ifdef PROC @// indicates that the form is no longer modified gbModifiedWindow = gbModifiedWindow OR MyWindow..Modified MyWindow..Modified=false // according to the window mode SWITCH Left(ExtractString(gWindowMode,1,"="),8) // creation mode CASE "Creation" // Implement the record and validate IF RADSave() THEN @ %ifdef SQL @ // add the record IF NOT HExecuteQuery({RAD_QRY_INSERT_A},hDefaultQuery, ... @ %repeat XXXX @ {RAD_ITEM_A},... @ %endrep @ {RAD_LAST_ITEM_A}) THEN Info("Unable to add a record"+CR+HErrorInfo()) ...
@ %endif %enddef PCODE Code=End The different elements used in this code are as follows: | | ButtonCode=Beginning,OK | Marks the beginning of the code for the OK button. The end of the code is signaled by Code=End | %Repeat | Signals a repetition in the name of the items to insert. In our example, all the items selected by the user are inserted into the code. The last item is indicated by the RAD_LAST_ITEM_A variable.
IF NOT HExecuteSQLQuery ({RAD_QRY_INSERT_A},hQueryDefault,... @ %repeat XXXX @ {RAD_ITEM_A},... @ %endrep @ {RAD_LAST_ITEM_A}) THEN |
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|