PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Focusing
  • ScreenFirst, SetFocus and ReturnToCapture
  • Error
  • ReturnToCapture function on a window
  • ReturnToCapture on a Table control column
  • ReturnToCapture on the current control
  • ReturnToCapture on the last selected control
  • Processes run when using ReturnToCapture
  • Function ReturnToCapture and FIN:
  • ReturnToCapture run in the event "Before closing with OK/Close button"
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Stops the current process and forces the input in the specified control, window or page.
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Example
// Si l'utilisateur n'a rien saisi dans le champ
IF SAI_Saisie1 = "" THEN
// On affiche un message et on remet l'utilisateur en saisie sur le champ
Error("Saisissez une valeur")
ReturnToCapture(SAI_Saisie1)
END
Windows MobileJavaUser code (UMC)
// Positionner le curseur de souris dans une cellule d'un champ Table (multisélection ou non)
TABLE_Nom_De_Table = Indice_de_ligne
ReturnToCapture(TABLE_Nom_De_Table.COL_Nom_de_colonne)
Syntax
ReturnToCapture([<Name of the control, window or page>])
<Name of the control, window or page>: control name, window name or optional page name
Name of control, column or window that will take focus (see Notes). If this parameter is not specified, the current control takes focus.
To indicate an control belonging to an open window different from the current one, <Name of control, window or page> must be of the form <Window name>.<Name of control>.
Versions 15 and later
Android Name of control or window that will take focus (see Notes). If this parameter is not specified, the current control takes focus.
New in version 15
Android Name of control or window that will take focus (see Notes). If this parameter is not specified, the current control takes focus.
Android Name of control or window that will take focus (see Notes). If this parameter is not specified, the current control takes focus.
Android Name of control or window that will take focus (see Notes). If this parameter is not specified, the current control takes focus.
Remarks

Focusing

Taking "focus" is represented in different ways:
  • Blinking cursor (or "Caret") for the edit controls.
  • Dotted rectangle for the other types of controls (Buttons, List Boxes, Radio Buttons, etc.).

ScreenFirst, SetFocus and ReturnToCapture

These functions have a different behavior:
  • ReturnToCapture stops the current process to force the input in the specified control.
  • ScreenFirst describes the next control that will be in edit (when the current code stops and when the input resumes).
  • SetFocus stops the current process, describes the next control that will be in edit and resumes the current process.

Error

A WLanguage error occurs if <Object name> does not correspond to a control found in the current window or page.
Windows MobileAndroidJavaUser code (UMC)

ReturnToCapture function on a window

If the parameter <control name, window name or page name> matches a window name, the window is enabled. The control that will take focus in this window will correspond to:
  • the last control previously in edit in this window,
  • the first control that can take focus in this window (if no input was previously performed in this window).
Windows MobileJavaUser code (UMC)

ReturnToCapture on a Table control column

The ReturnToCapture function gives the focus to the specified column. If the Table control is not being entered, the Table control goes into entry.
Windows MobileAndroidJavaUser code (UMC)

ReturnToCapture on the current control

The ReturnToCapture function used without parameter allows to give focus to the current control. This function, called in the exit code of edit control, is used to force the input in the selected control if the information typed does not correspond to the expected information.
Ajax

ReturnToCapture on the last selected control

ReturnToCapture used without parameters sets the focus on the current control. This function, called in the exit code of edit control, is used to force the input in the selected control if the information typed does not correspond to the expected information.
The control must be one of the following types of controls:
  • Edit control.
  • Check Box control.
  • Radio Button control.
  • List Box control.
  • Combo Box control.
  • Click Area control.
If the name of the control corresponds to a string that is built, the alias of the control must be used ("ControlAlias"+Num for example). In this case, no check is performed: JavaScript errors may occur if focus is given to a control that does not exist.
Reminder: The alias of a control corresponds to the name of this control in the HTML page. To find out this alias:
  • in the code editor, press Shift + F1.
  • by programming, use the Alias property.
Windows MobileAndroidJavaUser code (UMC)

Processes run when using ReturnToCapture

The WLanguage code that follows the call to ReturnToCapture is not run and the user takes control.
Special cases:
  • if the call to ReturnToCapture is performed in a code called by Execute, ExecuteCode or ExecuteProcess, the code called by Execute, ExecuteCode or ExecuteProcess is interrupted. The execution resumes after the call to Execute, ExecuteCode or ExecuteProcess.
  • if the call to ReturnToCapture is performed in the code of a function of a window other than the current window, the code of this function is interrupted and the execution resumes after its call.
  • if the call to ReturnToCapture is performed in the code of a component (procedure or method), the code of the component is interrupted and the execution resumes after the call to the procedure or method of the component.
  • if the call to ReturnToCapture is performed in a code of a procedure of internal window, the code of the procedure of the internal window is interrupted and the execution resumes after the call to the procedure of the internal window.
  • if the call to ReturnToCapture is performed in the code of a menu option, the code of the menu option is interrupted and the execution resumes after the call to the menu option.
  • if the call to ReturnToCapture is performed in a window procedure called from a supercontrol, the code of the procedure is interrupted and the execution resumes after the call to the procedure in the supercontrol.
  • if the call to ReturnToCapture is performed in a procedure of a supercontrol or control template, the code of the procedure is interrupted and the execution resumes after the call to the procedure of the supercontrol or control template.
The current process is permanently interrupted. For example:
ReturnToCapture("Saisie1")
Info("XXX")    // N'est jamais exécuté
In most cases, the exist events (from the current control or window) and the input events (in the specified control or window) are run at the same time as ReturnToCapture.
Exceptions:
  • No code is run if <Control name> is the current control.
  • The exit code of the selected control is not run if ReturnToCapture is used in one of the events of this control.
To avoid interrupting the process, use ScreenFirst or SetFocus.
AndroidJava The WLanguage code that follows the call to ReturnToCapture is not run. The execution of processes resumes:
Windows MobileAndroidJavaUser code (UMC)

Function ReturnToCapture and FIN:

After a call to ReturnToCapture, the code following the "END:" statement is not run. ReturnToCapture can be replaced by the call to ScreenFirst followed by RETURN or RESULT.
Windows Mobile

ReturnToCapture run in the event "Before closing with OK/Close button"

If ReturnToCapture is called in the event "Before closing with OK/Close button", the current window will not be closed.
Remark: The event "Before closing with OK/Close button" is associated with the "Close" or "OK" button in the window title bar.
Business / UI classification: UI Code
Component: wd260obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo Fechar Window
//Global
gn_fechando_manual is int=0

//Closing
IF gn_fechando_manual=0 THEN
IF YesNo("Deseja Fechar Nota Fiscal") THEN
ELSE
ReturnToCapture(EDT_cliente_cnpj_cpf_codigo)
END
END


//Botao Fechar
gn_fechando_manual=1
Close(WIN_GeraNotaFiscal)

//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/03/windev21-curso-233-window-fechar-ou-nao.html
De matos AMARILDO
17 Mar. 2016