ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Controls: Available types / TimeLine control
  • Default events
  • Events with procedures
  • Advanced use of events with procedures
  • Optional events
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Default events
The following events appear by default in the WINDEV code editor:
EventRuntime condition
InitializingExecuted when the window is opened. *
Before creating the eventRun:
  • when "New event" is selected in the context menu of TimeLine control.
  • during the direct input of a new event via the keyboard.
Event entryRun:
  • when "New event" is selected in the context menu of TimeLine control.
  • during the direct input of a new event via the keyboard.
This event is run immediately after the "Before creating the event" event.
Exit input mode in an eventRun during the exit from event input (exit when adding an event or when modifying an event via the context menu for example).
Selecting an eventExecuted when selecting an event found in the TimeLine control.
Moving an eventExecuted when moving an event in the TimeLine control. This event is run at the end of the movement with the mouse (when the mouse is "released").
Resizing an eventExecuted when resizing an event in the TimeLine control (resize operation performed with the mouse for example). This event is run at the end of the resize (when the mouse is "released").
Deleting an eventRun:
  • when "Delete the event" is selected in the context menu of TimeLine control.
  • when an event is deleted via the DEL key of keyboard.
Range selectionExecuted when selecting a time period in the TimeLine control (click performed on a time range for example). When several time ranges are selected with the mouse, the event is run for each new selected range.
Reassigning an eventExecuted when moving an event triggers the modification of the track associated with the event.
Whenever modifiedExecuted when moving the pager in the TimeLine control

(*) By default, the "Initialization" event of each control is executed according to the order in which the controls were created in the window. To modify this runtime order:
  1. On the "Window" tab, in the "Order" group, click "Initialization".
  2. In the window that appears, use the arrows on the right to change the order in which the controls are initialized.
Events with procedures
To simplify the operations performed on the events of a TimeLine control, several procedures are proposed in each event. These procedures take as parameter the EventTimeline variable to use. All the details of the event handled by the context menu are automatically assigned to this variable.
Example: To store in an EVT data file an event added by the user via the context menu, simply enter the following code in the "Event entry output" event:
PROCEDURE SortieDeSaisie(evtModifie is EventTimeline)

// Mémorisation des données
EVT.Titre = evtModifie.Title
EVT.EvtDébut = evtModifie.Start
EVT.EvtFin = evtModifie.End
...
HAdd(EVT)

Advanced use of events with procedures

It is also possible to offer the user a more precise definition of the characteristics of his event when adding or modifying it.. To do so, create a window with the information to specify.
In the code, specify that the window must be opened in the "Enter input mode in an event" event. To lock the direct input via the context menu of the TimeLine control, the event must return False.
This principle can be applied to all the events called via the context menu of the TimeLine control.
Example:
PROCEDURE Edition(evtEdité is EventTimeline)

// Ouvre la fenêtre de saisie d'un événement 
// avec l'événement sélectionné (en mode Création ou Modification)
Open(FEN_SaisieEVT_HFSQL, evtEdité)

// Renvoie FAUX pour bloquer la saisie directe dans le champ TimeLine 
RETURN False
Optional events
Several optional events can be added. To add an optional event:
  1. Select the desired control.
  2. Display the code window of this control (F2 key).
  3. 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: Several optional events can be selected.
  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 deactivated code contains WLanguage code, this code is automatically deleted..
For example, you can use the following events:
  • the mouse hover over the control,
  • left mouse button down, up, double click,
  • right mouse button down, up, double click,
  • mouse wheel, etc.
For more details, see the Optional events.
Minimum version required
  • Version 18
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help