PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Events managed by default
  • Optional events
  • Placing the application in the foreground
  • Placing the application in the background
  • Changing the layout
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
Events managed by default
WINDEV and WINDEV Mobile manage the following events by default (in order of appearance in the code editor):
EventRuntime condition
Global declarationsDeclaring the variables global to the window. This is the first code run when opening the window.
Initialization (before version 180062)
End of initialization (after version 180062)
End of initialization
Run when opening the window.
The events are run in the following order:
  • Initializing the window controls (*)
  • Initializing the window
  • Focus gain
Remark: A blinking effect may appear if the code for updating the controls is included in this event. Indeed, the initialization code of controls is run before the update code.
ClosingRun when closing the window.
Remark: Resuming the input in one of the window controls in this code prevents from closing the window.
Versions 20 and later
Request for refreshing the display
New in version 20
Request for refreshing the display
Request for refreshing the display
Used to group the code for updating the window controls: content of controls, status (visible, grayed, etc.), caption to refresh, etc.
This event may expect parameters. Simply declare a procedure in the event. For example:
// Request for refreshing the display
PROCÉDURE AskForRefresh(RefreshType is boolean)
This event is started upon request by the following functions:
When these functions are called, you can specify the value of the parameters expected by the event.
Android This event is not available.
Windows Mobile Before closing with OK/Close button
Run when using the OK/Close button
Operating mode of the Close button
The following events are run:
  • "Before closing with OK/Close button" is run.
  • running the code of the "Cancel" button found in the window (if this button exists). If the window contains no "Cancel" button, the window is closed.
Operating mode of the OK button
The following events are run:
  • "Before closing with OK/Close button" is run.
  • running the code of "Validate" button found in the window (if this button exists). If the window contains no "Validate" button, the window is closed.
Remark: The window will not be closed if the event "Before closing with OK/Close button" calls ReturnToCapture.
AndroidAndroid Widget iPhone/iPadUniversal Windows 10 App This event is not available.
Focus gainRun when the window takes focus (the title bar is active) and when another application window loses focus:
  • the user clicked another application window
  • ReturnToCapture was run from another application window
This event will not be run:
  • when opening the first project window.
  • when running OpenChild or OpenSister from the current window.
  • if Close is called in the initialization code of window.
  • if the user clicks a window of another program then re-clicks the initial window.
This event will not be run:
  • when opening the first project window.
  • when running OpenChild, OpenMobileWindow or OpenSister from the current window.
  • if Close is called in the initialization code of window.
  • if the user clicks a window of another program then re-clicks the initial window.
AndroidAndroid Widget Universal Windows 10 App This event is not available.
Focus lossRun when the window loses focus when going to another window. This event is always called before the focus gain event of another window in the following cases:
  • closing the window (before the closing event)
  • the user clicked another application window
  • ReturnToCapture was run from another application window
This event will not be run:
  • if ReturnToCapture toward another window was run in the initialization code of window
  • if Close is called in the initialization code of window
  • if the user clicks a window of another program then re-clicks the initial window
AndroidAndroid Widget Universal Windows 10 App This event is not available.
Whenever modifiedRun when one of the window controls is modified (input performed by the user for example).
Versions 17 and later
AndroidUniversal Windows 10 App Changing the orientation
New in version 17
AndroidUniversal Windows 10 App Changing the orientation
AndroidUniversal Windows 10 App Changing the orientation
Run when the user turns the screen around. This allows you to reposition the controls when changing the orientation of the screen.
Versions 18 and later
AndroidiPhone/iPadUniversal Windows 10 App Closing a child window of the window
New in version 18
AndroidiPhone/iPadUniversal Windows 10 App Closing a child window of the window
AndroidiPhone/iPadUniversal Windows 10 App Closing a child window of the window
AndroidiPhone/iPadUniversal Windows 10 App Closing a child window of the window
Run when closing a child window opened from the current window.
You can:
  • find out the name of the child window that was closed by ..Name.
  • retrieve the return value of child window via ..ReturnedValue.
Example:
// -- Close a child window of WIN_OrderList
// Refreshes the list of orders if necessary
IF MyChildWindow..ReturnedValue = True THEN
OrderList()
END
The MyChildWindow keyword allows you to handle the characteristics of child window.
ResizingRun in the following cases:
  • Minimizing the window
  • Enlarging or resizing the window
  • Restoring the window once it was minimized
Universal Windows 10 App This event is not available.
Versions 18 and later
Android Widget Refreshing the Widget
New in version 18
Android Widget Refreshing the Widget
Android Widget Refreshing the Widget
Used to update the Widget content. This event is run:
  • when opening a Widget window.
  • at regular time interval. This interval is defined in the "Details" tab of description window.
Remark: WidgetDisplay redisplays the Widget and runs the refresh event.
(*) By default, the "Initializing" event of each control is run according to the order in which the controls were created in the window. To modify this runtime order:
  1. Select "Windows .. Edit the initialization order".On the "Window" pane, in the "Order" group, click "Initialization".
  2. In the window that is displayed, use the arrows on the right to modify the initialization order of controls.
Caution: If one or more controls use the persistence of controls, the "Whenever modified" code can be run when initializing the control. See Persistence of controls for more details.
Optional events
Several optional events can be managed.
To manage an optional event, simply select it in the icon bar of the code window.
To add an optional event:
  1. Select the requested control.
  2. Display the code window of this control (F2 key).
  3. Click the link "Add other processes to xxx" at the bottom of the window code, after the last event.Click the link "Add other events to xxx" at the bottom of the window code, after the last event.
  4. All the optional events available for the control are displayed.
  5. Check the optional event to add and validate.
    Note: You can select several optional events.
  6. The selected optional event is automatically added to the events managed by the control.
To disable an optional event, simply perform the same operations to display the list of optional events. Then simply uncheck the optional events to delete.
Note: If the disabled code contains WLanguage code, this code is automatically deleted.
You can manage, for example:
  • the control rollover with the mouse,
  • the left mouse button down, up, with a double click,
  • the right mouse button down, up, with double click,
  • the mouse wheel, etc.
Versions 18 and later
AndroidiPhone/iPad

Placing the application in the foreground

Run when the application is re-enabled and when it is placed in the foreground. This event is used, for example, to refresh the displayed data.
Remark: This event is run AFTER the event "Move to the foreground" of the project.
New in version 18
AndroidiPhone/iPad

Placing the application in the foreground

Run when the application is re-enabled and when it is placed in the foreground. This event is used, for example, to refresh the displayed data.
Remark: This event is run AFTER the event "Move to the foreground" of the project.
AndroidiPhone/iPad

Placing the application in the foreground

Run when the application is re-enabled and when it is placed in the foreground. This event is used, for example, to refresh the displayed data.
Remark: This event is run AFTER the event "Move to the foreground" of the project.
Versions 18 and later
AndroidiPhone/iPad

Placing the application in the background

Run when the application is in the background. This event is used, for example, to save the data.
Remark: This event is executed BEFORE the event "Move to the background" of the project.
New in version 18
AndroidiPhone/iPad

Placing the application in the background

Run when the application is in the background. This event is used, for example, to save the data.
Remark: This event is executed BEFORE the event "Move to the background" of the project.
AndroidiPhone/iPad

Placing the application in the background

Run when the application is in the background. This event is used, for example, to save the data.
Remark: This event is executed BEFORE the event "Move to the background" of the project.
Versions 23 and later
WINDEVAndroidiPhone/iPad

Changing the layout

Run when the layout is automatically modified.
Remark: WinChangeLayout does not trigger this event.
New in version 23
WINDEVAndroidiPhone/iPad

Changing the layout

Run when the layout is automatically modified.
Remark: WinChangeLayout does not trigger this event.
WINDEVAndroidiPhone/iPad

Changing the layout

Run when the layout is automatically modified.
Remark: WinChangeLayout does not trigger this event.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment