PC SOFT

WINDEV的在线文档

  • Calling the same event several times on the same object
  • Procedure called by the Event function
  • Parameters used by the procedure
  • Events used by WinDev
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Intercepts a Windows event on a control, a group of controls or a WinDev or WinDev Mobile window. A specific WLanguage procedure is automatically run when the event is triggered on the specified object. To end the management of the event, all you have to do is use 结束事件.

Note: 事件 does not operate on a non-WinDev window.

例子
// Capture the mouse click on an edit control
WM_LBUTTONDOWN整数型513
事件MouseClick"EDT_EDIT1"WM_LBUTTONDOWN

// MouseClick procedure
过程MouseClick()
EDT_EDIT1""

语法
<Result> = 事件(<Procedure Name> , <Object Name> , <Windows Message>)
<Result>: Integer
  • Identifier of the event,
  • 0 if an error occurred.
<Procedure Name>: Character string (with or without quotes)
Name of the WLanguage procedure to run when intercepting the event. This procedure can be a global procedure of the project or a local procedure of the window that contains the code currently run. This function must comply with a specific standard (see the Notes).
For a given object, a single procedure can intercept a given event.
<Object Name>: Character string (with quotes)
Name of the control, group of controls or WinDev window on which the event must be managed. You also have the ability to use the following generic character strings:
<Window Name>.*The event is supported on all the controls found in the <Window Name> window (and on the <Window Name> window itself).
.* (dot star)The event is managed for all the controls found in the current window (except for the window itself).
*. (star dot)The event is managed in all the WinDev windows of the current application.
*.* (star dot star)The event is managed in all the WinDev windows and in all the controls of all the opened WinDev windows found in the current application.
<Windows Message>: Integer or character string
Number or name of the Windows message to manage. See the list of Windows events.
If this parameter corresponds to a character string, this string is case sensitive.
If this parameter corresponds to 0, all the Windows messages are intercepted.

注意

Calling the same event several times on the same object

事件 can be used to manage the same event several times for the same element (control, window, ...).

In this case, the events are "stacked":

  • the first event is managed until the next event is called.
  • when an event is not managed anymore (结束事件), the event found immediately before it (if it exists) is taken into account.

Procedure called by the Event function

The interception procedure called by 事件 must have the following format

FUNCTION ProcedureManageEvent(WindowsMessage, wParam, IParam)

WindowsMessage, wParam and lParam are three optional integers, used to send and to receive information about the message and the relevant objects.

Parameters used by the procedure

The interception procedure called by 事件 can use the following variables:
VariablesMeaning5.5 variable kept for backward compatibility
MySelf..NameName of the object (control, group of controls or window)
Read-only variable
事件.名称
MessageNumber of the message (first parameter of the procedure)
Read-only variable
事件.wMessage
wParamFirst parameter of the message (second parameter of the procedure)
Read-only variable
事件.wParam
lParamSecond parameter of the message (third parameter of the procedure)
Read-only variable
事件.lParam
Handle("")Handle of the object that received the message
Read-only variable
事件.hWnd
Value returned by the procedureReturns a value to Windows事件.返回



Note: If the process returns a value (an integer), the Windows event is stopped: this value is returned. If the process returns NO value, the execution continues.

Events used by WinDev

WinDev uses the events included between "WM_USER + 700" and "WM_USER + 1200". Therefore, other ranges of events must be used ("WM_USER + 1300" to "WM_USER + 1400" for example).

组件
WinDev wd200obj.dll