PC SOFT

WINDEV的在线文档

  • Overview
  • Handling the Organizer control by programming
  • Adding an appointment
  • Filling an Organizer control with the data found in a HFSQL data file
  • Retrieving a list of appointments
  • Displaying an Organizer control from a specific date
  • Deleting an appointment
  • Modifying the display of the control
  • Using the popup menu (AAF)
  • Possibilities of the popup menu
  • Advanced use of processes with procedure
  • Managing the bank holidays
  • Properties specific to the Organizer 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
An Organizer control can be:To handle an Organizer control by programming, WinDev proposes the OrganizerXXX functions.

This help page explains how to handle an Organizer 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 Organizer control by programming
Warning

In version 15, the appointments could be handled by the 日程表预约型 and 日程表重复型 variables.

From version 16, we recommend that you use the 预约型 and 重复型 variables. These variables can also be used when handling a Scheduler control.

Adding an appointment

Adding an appointment into an Organizer control is performed by 日程表添加预约. This function accepts two syntaxes:

  • syntax used to specify the characteristics of the appointment: title, description, ...
// Adds an appointment into the Organizer control
日程表添加预约ORG_MyOrganizer"Sales meeting""201003220845",...
"201003221230""Sales"

// 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
日程表添加预约ORG_OrganizerMyAppointment

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

Filling an Organizer control with the data found in a HFSQL data file

The records are stored in a HFSQL file. The initial fill of the Organizer control can be done by browsing the 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 to the Organizer control
日程表添加预约ORG_MyOrganizerMyAppointment

结束

16版本和更高版本
Reminder: You also have the ability to use an Organizer control linked to a data file. See Organizer control linked to a data file for more details.
16新版本
Reminder: You also have the ability to use an Organizer control linked to a data file. See Organizer control linked to a data file for more details.
Reminder: You also have the ability to use an Organizer control linked to a data file. See Organizer control linked to a data file for more details.

Retrieving a list of appointments

日程表预约列表 is used to retrieve:
  • the list of all the appointments found in the organizer control:
// Array containing a list of 预约型
arrAppointmentList预约型的数组型0

// Lists of appointments
arrAppointmentList日程表预约列表ORG_MyOrganizer
  • the list of appointments included between two dates:
// List of appointments for January 2010
arrAppointmentList预约型的数组型0

// Lists of appointments
arrAppointmentList日程表预约列表ORG_MyOrganizer"20100101""20100131"
  • the appointment currently selected or hovered:
// Selected appointment
arrAppointmentList预约型的数组型0

arrAppointmentList日程表预约列表ORG_MyOrganizer日程表.选定预约

Displaying an Organizer control from a specific date

To display the Organizer control from a specific date, use 日程表位置.

// Positions the organizer on today's date
OrganizerPosition(ORG_MyOrganizer1, Today())

// Positions the organizer on December 20, 2012
OrganizerPosition(ORG_MyOrganizer1, "20121220")

Deleting an appointment

日程表删除预约 is used to delete:
  • the appointment selected in the control.
  • a specific appointment.
// Deletes the first appointment
日程表删除预约ORG_MyOrganizer1

日程表删除全部 is used to delete all the appointments found in the Organizer control.

Modifying the display of the control

The current display of an Organizer control can be modified by the following functions:

Using the popup menu (AAF)
WinDev

Possibilities of the popup menu

The popup menu of the Organizer 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 Organizer 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 Organizer control. Indeed, a procedure was automatically declared by the Organizer control for each process of the control that handles an appointment.

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

WinDev

Advanced use of processes with procedure

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

In the code, all you have to do is open the window in the "Enter the appointment in input" process. To lock the direct input via the popup menu of the organizer, the process must return .

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

Example:

过程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 Organizer 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 controls and in the 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 Organizer control.

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 Organizer controls
The following properties are used to manage an Organizer control by programming.
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.
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).
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版本和更高版本
修改预约持续时间
修改预约持续时间
..修改预约持续时间 allows you to find out and specify whether the user can modify the duration of an appointment in a Scheduler or Organizer 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.
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 an Organizer control, see Properties associated with the Organizer control.