PC SOFT

WINDEV的在线文档

  • Overview
  • Handling the Scheduler control by programming
  • Adding a resource
  • Adding an appointment
  • Filling a Scheduler control with the data found in a HFSQL data file
  • Retrieving a list of appointments
  • Displaying the schedule from a specific resource or from a specific date
  • Deleting an appointment
  • Deleting a resource
  • Modifying the display of the control
  • Handling an appointment by programming
  • Using the popup menu (AAF)
  • Advanced use of the processes associated with the Scheduler control
  • Advanced use of processes with procedure
  • Managing the bank holidays
  • Properties specific to the Scheduler controls
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Overview
A Scheduler control can be:To handle a Scheduler control by programming, WinDev and WebDev propose the SchedulerXXX functions.

This help page explains how to handle a Scheduler control by programming. The example proposed in illustration is used to store the appointments in a HFSQL database.

Note: From version 19, HFSQL is the new name of HyperFileSQL.

Handling the Scheduler control by programming

Adding a resource

Adding a resource into a Scheduler control is performed by 计划表添加资源. This resource can correspond to a person, a room, ...

Example:

// Adds resources into a Scheduler control
计划表添加资源SCH_Schedule1"Vince"+图示链接"VP"))
计划表添加资源SCH_Schedule1"Tommy"+图示链接"TM"))
计划表添加资源SCH_Schedule1"Val"+图示链接"VR"))

In this example, 图示链接 is used to propose a displayed resource ("Vince" for example) and a resource handled by programming ("VP" for example).

WinDev Note: 计划表添加资源 is used to insert an image into the title of the resource.

Adding an appointment

Adding an appointment into a Scheduler control is performed by 计划表添加预约. This function accepts two syntaxes:

  • syntax used to specify the characteristics of the appointment: title, description, ...
// Adds a 1-hour appointment for tonight
MyResource字符串型
MyTitle字符串型
StartAPT日期时间型

MyResource"Vince"
MyTitle"Sales meeting"
StartAPT系统日期()+"17000000"

计划表添加预约SCH_ScheduleMyResourceMyTitleStartAPT

// Declares an 预约型 variable
MyAppointment预约型

// Fills the appointment
MyAppointment..标题="Sales meeting"
MyAppointment..内容="Meeting to discuss the weekly objectives."
MyAppointment..开始日期="201003220845"
MyAppointment..结束日期="201003221230"
MyAppointment..类别="Sales"
MyAppointment..ID=1

// Adds the appointment into the control
计划表添加预约SCH_ScheduleMyAppointment

The ..背景颜色 property of the 预约型 variable is used to define a display color for an appointment. If no background color is defined, the Scheduler control will automatically use the color associated with the category of the appointment.

Filling a Scheduler control with the data found in a HFSQL data file

The records are stored in a HFSQL file. The initial fill of the Scheduler control can be done by browsing the data file via the FOR EACH syntax and by adding each appointment via 计划表添加预约.

// 预约型 variable
MyAppointment预约型

// Browse the appointments stored in database
对于每个APT
// Fills the information of the variable
MyAppointment..标题=APT.Title
MyAppointment..内容=APT.Content
MyAppointment..开始日期=APT.StartDate
MyAppointment..结束日期=APT.EndDate
MyAppointment..类别=APT.Category
MyAppointment..ID=APT.APTID

// Adds the appointment into the Scheduler control
计划表添加预约SCH_MyScheduleMyAppointment
结束

Retrieving a list of appointments

计划表预约列表 is used to retrieve:

  • the list of all the appointments found in the Scheduler control:
// Array containing a list of 预约型
arrAppointmentList预约型的数组型0

// Lists of appointments
arrAppointmentList计划表预约列表SCH_MyScheduler

  • the list of appointments for a resource included between two dates:
// List of appointments for January 2010
arrAppointmentList预约型的数组型0

// Lists of appointments
arrAppointmentList计划表预约列表SCH_MySchedulerMyResource,...
"20100101""20100131"

  • the appointment currently selected or hovered:
// Selected appointment
arrAppointmentList预约型的数组型0

arrAppointmentList计划表预约列表SCH_MyScheduler计划.选定预约

17版本和更高版本

Displaying the schedule from a specific resource or from a specific date

To display the Scheduler control from:
计划表添加预约SCH_NoName1"ABC room""APT 1",...
系统日期()+"14000"系统日期()+"16000"
计划表资源位置SCH_NoName1"ABC room"
// Positions the schedule on today's date
PlanningPositionDateHeureSCH_Schedule今天())
17新版本

Displaying the schedule from a specific resource or from a specific date

To display the Scheduler control from:
计划表添加预约SCH_NoName1"ABC room""APT 1",...
系统日期()+"14000"系统日期()+"16000"
计划表资源位置SCH_NoName1"ABC room"
// Positions the schedule on today's date
PlanningPositionDateHeureSCH_Schedule今天())

Displaying the schedule from a specific resource or from a specific date

To display the Scheduler control from:
计划表添加预约SCH_NoName1"ABC room""APT 1",...
系统日期()+"14000"系统日期()+"16000"
计划表资源位置SCH_NoName1"ABC room"
// Positions the schedule on today's date
PlanningPositionDateHeureSCH_Schedule今天())

Deleting an appointment

计划表删除预约 is used to delete:
  • the appointment selected in the control.
  • a specific appointment.
// Deletes the first appointment
计划表删除预约SCH_Schedule1

Deleting a resource

计划表删除资源 is used to delete a resource from the Scheduler control.

// Deletes one of the resources
ResDel布尔型
ResDel计划表删除资源SCH_Schedule1"Vince"
如果ResDel,那么
信息"资源型 deleted"
结束

计划表删除全部 lets you delete all the appointments found in the Scheduler control as well as all the resources of the Scheduler control.

Modifying the display of the control

The current display of a Scheduler control can be modified via the following functions:

Handling an appointment by programming
You have the ability to handle an appointment by programming:
  • by using the subscript of the appointment to modify.
  • by pointing by reference on the appointment to modify.
1. Using the subscript

A subscript is returned by 计划表添加预约 whenever an appointment is added into a schedule. This subscript represents the added appointment. This subscript can be used to handle the appointment directly.

Example:

APTNum整数型
APTNum5

// Change the title displayed on the appointment #5
SCH_ROOMAPTNum】..标题="Blue room"

2. Using a reference

To handle an appointment, use the <- operator to associate the appointment found in the Scheduler control with the 预约型 variable. A modification performed on the variable will be automatically applied to the control.

Example:

直到是预约型
直到小于-SCH_RoomAPTNum
直到..标题="New title"

Using the popup menu (AAF)
WinDevWindows The Scheduler control is associated with a popup menu (AAF). The popup menu of the Scheduler control is used to:
  • modify the display mode of the control,
  • add, modify or delete an appointment.
To save the operations performed, you must use the processes of the Scheduler control.

In the relevant process, all you have to do is retrieve the appointment currently used and perform the corresponding process.

Example: To store in an APT data file an appointment added by the user via the popup menu, all you have to do is enter in the "Enter the appointment in input" process:

过程EditaptEdited预约型

// Store the data
APT.TitleaptEdited..标题
APT.StartDateaptEdited..开始日期
APT.EndDateaptEdited..结束日期
...
H添加APT

The same type of code can be implemented for the different processes of the Scheduler control. Indeed, a procedure was automatically declared by the Scheduler control for each process of the control that handles an appointment.

These procedures receive in parameter an 预约型 variable affected by the process.

Advanced use of the processes associated with the Scheduler control

Advanced use of processes with procedure

You can allow the user to define more precisely the characteristics of his appointment during an addition or a modification. To do so, create a window or a page with the information to fill.

In the code, all you have to do is open the window or the page in the "Enter the appointment in input" process. To lock the direct input, the process must return .

WinDevWindows This principle can be applied to all the processes called by the popup menu of the Scheduler control.

Example: Opening a window used to enter the appointment.

过程EditaptEdited预约型

// Opens the window for entering an appointment
// with the selected appointment (in Creation or Modification mode)
打开WIN_InputAPT_HFSQLaptEdited

// Returns False to lock the direct input in the Scheduler control
发送回

Managing the bank holidays
The bank holidays are managed by programming. Several WLanguage functions (starting with BankHolidayXXX) are available.

To define the bank holidays displayed in the Organizer, Scheduler and Calendar controls, you must use 假日添加. This function allows you to define the list of bank holidays that will be used. This function allows you to customize the bank holidays according to the country and to the local regulations. This function must be used at the beginning of the application because it has a global effect on the application.

The bank holidays will be colored in green in the schedule.

Example:

// Delete all the bank holidays
BankHolidayDeleteAll()
// Initialize the 11 bank holidays common to the French regions and to the French territories
BankHolidayAdd("0101" // 1st of January
BankHolidayAdd(bhEasterMonday // Easter Monday
BankHolidayAdd("0501" // 1st of May
BankHolidayAdd("0508" // 8th of May
BankHolidayAdd(bhAscensionDay // Ascension day
BankHolidayAdd(bhWhitMonday // Whit Monday
BankHolidayAdd("0714" // 14th of July
BankHolidayAdd("0815" // 15th of August (Assumption)
BankHolidayAdd("1101" // All Saints' Day
BankHolidayAdd("1111" // 11th of November
BankHolidayAdd("1225" // Christmas

// Add 2 additional bank holidays for the regions of Moselle and Alsace
BankHolidayAdd("1226" + CR + bhGoodFriday

Properties specific to the Scheduler controls
The following properties are used to manage a Scheduler control by programming.
14版本和更高版本
开始日期
14新版本
开始日期
开始日期
..开始日期 is used to find out and modify the start date of the period selected:
  • in a Calendar control.
  • in an Organizer control.
  • in a Scheduler control.
14版本和更高版本
结束日期
14新版本
结束日期
结束日期
..结束日期 is used to find out and modify the end date of the period selected:
  • in a Calendar control,
  • in an Organizer control.
  • in a Scheduler control.
17版本和更高版本
移动预约
17新版本
移动预约
移动预约
..移动预约 is used to find out and specify whether the user can move an appointment in a Scheduler control or in an Organizer control.
16版本和更高版本
移动粒度
16新版本
移动粒度
移动粒度
..移动粒度 is used to find out and modify the size of the grid used to move:
  • the appointments of an Organizer control.
  • the appointments of a Scheduler control.
  • the events of a TimeLine control.
  • the tasks found in a Gantt Chart column.
16版本和更高版本
持续时间粒度
持续时间粒度
..持续时间粒度 allows you to find out and modify the size of the grid used to resize:
  • the appointments of an Organizer control.
  • the appointments of a Scheduler control.
  • the events of a TimeLine control.
  • the tasks found in a Gantt Chart column.
15版本和更高版本
预约粒度
15新版本
预约粒度
预约粒度
..预约粒度 allows you to find out and modify the precision of the grid used by the Organizer control or by the Scheduler control to define the appointments.
17版本和更高版本
天高度
17新版本
天高度
天高度
..天高度 is used to find out and modify the height of the days in a Scheduler control where the days are displayed in row and the resources in column.
17版本和更高版本
资源高度
17新版本
资源高度
资源高度
..资源高度 is used to find out and modify the height of the resources in a Scheduler control where the resources are displayed in row.
17版本和更高版本
天分隔条高度
天分隔条高度
..天分隔条高度 is used to find out and modify the height of the breaks between the days in a Scheduler control where the days are displayed in row and the resources in column.
15版本和更高版本
工作日开始时间
工作日开始时间
..工作日开始时间 is used to find out and modify the start time of the working hours used:
  • by an Organizer control.
  • by a Scheduler control.
  • by a Gantt Chart column (in a Table or TreeView Table control).
15版本和更高版本
工作日结束时间
工作日结束时间
..工作日结束时间 is used to find out and modify the end time of the working hours used:
  • by an Organizer control.
  • by a Scheduler control.
  • by a Gantt Chart column (in a Table or TreeView Table control).
17版本和更高版本
天宽度
17新版本
天宽度
天宽度
..天宽度 is used to find out and modify the width of the days in a Scheduler control where the days are displayed in column and the resources in row.
17版本和更高版本
资源宽度
17新版本
资源宽度
资源宽度
..资源宽度 is used to find out and modify the width of the resources in a Scheduler control where the resources are displayed in column.
16版本和更高版本
掩码日期标题
掩码日期标题
..掩码日期标题 is used to find out and modify the mask used for the title of the day columns in an Organizer control or in a Scheduler control.
15版本和更高版本
显示天数
15新版本
显示天数
显示天数
..显示天数 is used to find out and modify the number of days displayed in an Organizer control or in a Scheduler control.
15版本和更高版本
星期的第一天
星期的第一天
..星期的第一天 is used to find out and modify the 1st day of the week displayed in:
  • a Calendar control.
  • an Organizer control.
  • an edit control in Date format with Calendar.
16版本和更高版本
资源
16新版本
资源
资源
..资源 is used to:
  • find out the resources visible in a Scheduler control.
  • find out the resource of the Scheduler control corresponding to the specified subscript.
16版本和更高版本
选定数据源
16新版本
选定数据源
选定数据源
..选定数据源 returns the name of the resource corresponding to the selection made by the user in a Scheduler control.
17版本和更高版本
预约直接输入
预约直接输入
..预约直接输入 is used to find out and specify whether a user can directly modify the title of an appointment in an Organizer or Scheduler control.
17版本和更高版本
选择时间段
17新版本
选择时间段
选择时间段
..选择时间段 is used to find out and indicate whether the user can select a period in a Scheduler control or in an Organizer control.

To find out the entire list of WLanguage properties that can be used with a Scheduler control, see Properties associated with the Scheduler control.