PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Gain of focus
  • ScreenFirst, SetFocus and ReturnToCapture
  • Error
  • ReturnToCapture on a window
  • ReturnToCapture on a Table control column
  • ReturnToCapture on the current control
  • Processes run when using ReturnToCapture
  • ReturnToCapture and END:
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.
Example
// If no value was entered by the user in the control
IF EDT_Edit1 = "" THEN
// Display a message and position the user in edit on the control
Error("Enter a value")
ReturnToCapture(EDT_Edit1)
END
WINDEVJavaUser code (UMC)
// Position the mouse cursor in a cell of a Table control (multiselection or not)
TABLE_Table_Name = Row_Subscript
ReturnToCapture(TABLE_Table_Name.COL_Column_Name)
Syntax
ReturnToCapture([<Object Name>])
<Object Name>: Optional character string (with or without quotes)
Name of control, column or window that will take focus (see Notes). If this parameter is not specified, the current control takes focus.
To specify a control belonging to a window other than the current window, <Object Name> must have the following format: <Window Name>.<Control Name>.
Remarks

Gain of focus

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, ...).

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 <Control Name> does not correspond to a control found in the current window or page.
WINDEVJavaUser code (UMC)

ReturnToCapture on a window

If <Object Name> corresponds to 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).
WINDEVJavaUser code (UMC)

ReturnToCapture on a Table control column

ReturnToCapture gives focus to the specified column. If the Table control is not currently in edit, the Table control becomes editable.
WINDEVJavaUser code (UMC)

ReturnToCapture on the current control

ReturnToCapture used without parameter gives focus to the current control. This function, called in the exit code of edit control, is used to force the input in the current control if the information typed does not correspond to the expected information.
WINDEVJavaUser 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("Edit1")
Info("XXX")    // Is never run
In most cases, the exit process (from the current control or window) and the entry process (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 current control is not run if ReturnToCapture is used in one of the processes of this control.
To avoid interrupting the process, use ScreenFirst or SetFocus.
Java The WLanguage code that follows the call to ReturnToCapture is not run. The execution of processes resumes:
WINDEVJavaUser code (UMC)

ReturnToCapture and END:

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.
Component : wd240obj.dll
Minimum required version
  • 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
Mar. 17 2016