ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / RAD / RAD Compatible 11
  • Overview
  • The different parts of the window description
  • 1. The characteristics of the window
  • 2. Description of the buttons
  • 3. Code of the buttons
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Warning
From version 2024, this feature is no longer available.
Overview
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
FileFile associated with the area (the window in this case)
AreaNameName of the area
AreaDescDescriptive sentence used to choose the element associated with the window
CoordCoordinates of the area, specified in the following format: <X>, <Y>, <Width>, <Height>
FileTypeType 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
NameAssocAreaIndicates the name of the control area associated with the button area
%ifdefSignals the beginning of a conditional code. The entire statement is as follows: %ifdef .... %else %endif
CoordCoordinates of the button area, specified in the following format: <X>, <Y>, <Width>, <Height>
AUTOEXTENSIONThe area can be enlarged:
1. Vertical move
2. Vertical enlargement
4. Horizontal move
8. Horizontal enlargement
AreaNameName of the button area
BUTTONDescription 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:
NewButtonModifyButtonDeleteButton
CloseButtonBrowseButtonFirstButton
PreviousButtonNextButtonLastButton
PrintButtonVisionButton

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,OKMarks the beginning of the code for the OK button. The end of the code is signaled by Code=End
%RepeatSignals 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
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/25/2024

Send a report | Local help