ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

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
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Default events
WINDEV manages the following events by default (in order of appearance in the 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.
Entry in edit in an eventRun:
  • 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 event "Before creating the 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 popup menu for example).
Selecting an eventRun when selecting an event found in the TimeLine control.
Moving an eventRun 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 eventRun 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 from the popup menu of TimeLine control.
  • when an event is deleted via the DEL key of keyboard.
Range selectionRun 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 eventRun when moving an event triggers the modification of the track associated with the event.
Whenever modifiedRun when moving the pager in the TimeLine control

(*) By default, the "Initializing" event of each control is executed according to the order in which the controls were created in the window. To modify this order of execution:
  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 popup menu, all you have to do is enter the following code in the event "Exit from event input":
PROCÉDURE ExitFromInput(evtModified is EventTimeline)
 
// Store the data
EVT.Title = evtModified.Title
EVT.EvtStart = evtModified.Start
EVT.EvtDate = evtModified.End
...
HAdd(EVT)

Advanced use of events with procedures

You can also allow the user to define more precisely the characteristics of his event during an addition or a modification. 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:
PROCÉDURE Edit(evtEdited is EventTimeline)
 
// Opens the window for entering an event
// with the selected event (in Creation or Modification mode)
Open(WIN_InputEVT_HFSQL, evtEdited)
 
// Returns False to lock the direct input in the TimeLine control
RESULT False
Optional events
Several optional events are supported. 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.
    Remark: 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.
Remark: If the disabled code contains WLanguage code, this code is automatically deleted.
You can manage, for example:
  • 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: 06/16/2022

Send a report | Local help