• Default events
  • Events with procedures for quick use
  • Advanced use of events with procedure
  • Optional events
  • Sort code of a column
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Events associated with a Gantt Chart column
Default events
WINDEV manages the following events by default for a "Gantt Chart" column (in order of appearance in the code editor):
EventRuntime condition
InitializationExecuted when the window is opened. *
Before creating the taskRun when selecting "New task" from the popup menu of the "Gantt Chart" column.
Entry in input in a taskRun when selecting "New task" in the context menu of the "Gantt Chart" column. This event is run immediately after the event "Before creating the task".
Exit from task inputRun during the exit from task input (exit when adding a task or when modifying a task via the popup menu for example).
Select a taskRun when selecting a task found in the "Gantt Chart" column. This event is executed when the popup menu opens.
Moving a taskRun when moving a task in the "Gantt Chart" column (move performed with the mouse for example).
Resizing a taskRun when resizing a task in the "Gantt Chart" column (resize operation performed with the mouse for example).
Deleting a taskRun when selecting "Delete the task" from the popup menu of the "Gantt Chart" column.
After linking a prerequisite task to a taskRun once the link was created via the popup menu (select "Link a prerequisite task" and click the prerequisite task).
Modifying the progress of a taskRun when the user changes the cursor of the progression bar in the task.

(*) 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 for quick use

Most of the events associated with the Gantt Chart column are run:
  • when using the context menu of the "Gantt Chart" column.
  • when using the mouse.
To handle tasks more easily, several procedures appear in each event. These procedures take in parameter:
All the characteristics of the element handled by the popup menu or by the mouse are automatically assigned to this variable.
Example: To store a task added by the user via the popup menu in a "Task" data file, simply enter the following code in the event "Exit from task input":
PROCEDURE EnterInInput(gtEdited is GanttTask)

// Store the data
Task.Title = gtEdited.Title
Task.StartDate = gtEdited.StartDate
Task.EndDate = gtEdited.EndDate

Advanced use of events with procedure

You can also allow the user to define more precisely the characteristics of his task during an addition or a modification.
To do so, create a window with the information to specify.
In the code, simply open the window in the event "Enter the task in input". To lock the direct input via the context menu of the column, the event must return False.
This principle can be applied to all the events called by the context menu of the column.
PROCÉDURE EnterInInput(gtEdited is GanttTask)
// Opens the window for task input
// with the selected task (in Creation or Modification mode)
Open(WIN_TaskInput, gtEdited)
// Returns False to lock the direct input in the column
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:
  • how columns are sorted (event "Whenever sorting"). This event is run when the user sorts the column with and .
  • how the magnifier is used to perform a search (event "Whenever performing a search with the magnifier"). This event is run during the search (for each character typed) from the "magnifier" search control.
  • The column resized by the user.

Sort code of a column

When the user clicks the title of a table column, the sort code of column is automatically called.
To find out the sort direction, declare a parameter at the beginning of the sort code.
// -- Whenever COL_Gantt is sorted
PROCÉDURE Sort_col(bAscending)
Trace(bAscending? "Ascending column sort" ELSE "Descending sort")
Minimum version required
  • Version 19
Click [Add] to post a comment