- Default events
- Events with procedures
- Advanced use of events with procedures
- Optional events
Events associated with a TimeLine control
WINDEV manages the following events by default (in order of appearance in the code editor): | | Event | Runtime condition |
---|
Initializing | Executed when the window is opened. * | Before creating the event | Run:- 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 event | Run:- 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 event | Run during the exit from event input (exit when adding an event or when modifying an event via the popup menu for example). | Selecting an event | Run when selecting an event found in the TimeLine control. | Moving an event | Run 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 event | Run 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 event | Run:- 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 selection | Run 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 event | Run when moving an event triggers the modification of the track associated with the event. | Whenever modified | Run 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: - On the "Window" tab, in the "Order" group, click "Initialization".
- In the window that appears, use the arrows on the right to change the order in which the controls are initialized.
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
Several optional events are supported.
To add an optional event: - Select the desired control.
- Display the code window of this control (F2 key).
- Click the link "Add other events to xxx" at the bottom of the window code, after the last event.
- All the optional events available for the control are displayed.
- Check the optional event to add and validate.
Remark: You can select several optional events. - 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.
|
|
|
|