PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Events managed by default
  • Events with procedures for quick use
  • Advanced use of events with procedure
  • Optional events
  • Sort code of a column
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 associated with a Gantt Chart column
Events managed by default
WINDEV manages the following events by default for a "Gantt Chart" column (in order of appearance in the code editor):
EventRuntime condition
InitializationRun when opening the window. *
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" from the popup 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).
Selecting 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 event "Initializing" of each control is run according to the order in which the controls were created in the window. To modify this runtime order:
  1. 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.

Events with procedures for quick use

Most of the events associated with the Gantt Chart column are run:
  • when using the popup menu of the "Gantt Chart" column.
  • when using the mouse.
To simplify the operations performed on the tasks, several procedures are proposed 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
...
HAdd(Task)

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 popup menu of the column, the event must return False.
This principle can be applied to all the events called by the popup menu of the column.
Example:
PROCEDURE 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
RESULT False
Optional events
Several optional events can be managed.
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 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:
  • the sort of columns (event "Whenever sorting"). This event is run when the user sorts the column using the icons and .
  • the use of magnifier 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
PROCEDURE Sort(bAscending)
Trace(bAscending? "Ascending column sort" ELSE "Descending sort")
Minimum version required
  • Version 19
Comments
Click [Add] to post a comment