PC SOFT

WINDEV的在线文档

  • Overview
  • Managing the bank holidays
  • Managing the multi-selection
  • Multi-selection
  • Managing the period selection
  • WLanguage functions
  • Functions for managing the bank holidays
  • Functions for managing the Calendar control
  • Properties specific to the Calendar 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
WinDev, WebDev and WinDev Mobile enable you to handle a Calendar control by programming. To do so, use the variable of the Calendar control in the code.

The variable of the Calendar control corresponds to the selected date (if the control is multi-selection or with period selection, the variable corresponds to the first selected date). This date uses the format specified in the "Stored format" control found in the "General" tab of the control description. This variable is a string.

The Calendar control can be handled by programming with the WLanguage functions (Calendar functions and functions for managing the bank holidays) and with the WLanguage properties. The Calendar control is associated with several WLanguage processes.

Notes:

  • You also have the ability to handle a day of a Calendar control by programming. See Managing the calendar days for more details.
  • WinDev, WebDev and WinDev Mobile automatically manage the change of month or the change of year performed by the user.
18版本和更高版本
WinDevLinux The Calendar control is now available for the WinDev applications in Linux.
18新版本
WinDevLinux The Calendar control is now available for the WinDev applications in Linux.
WinDevLinux The Calendar control is now available for the WinDev applications in Linux.

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

假日添加 is used to define the bank holidays displayed in a calendar. 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.

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)

Managing the multi-selection
WinDev

Multi-selection

A calendar can be multi-selection: the calendar enables you to select several dates. To do so, "Multi-selection" must be checked in the "Details" tab of the description window of the control. You also have the ability to use ..多重选择.

To retrieve the selected dates, use the CalendarXXX functions of WLanguage.

Example:

// Browse the dates selected in the Calendar control
对于I1最优直到日历选定天数目CAL_Calendar1
跟踪日历选定日期CAL_Calendar1I))
结束

WinDev

Managing the period selection

A calendar can propose the period selection: the calendar enables you to select the start date and the end date of the period. The days found between these two dates are automatically selected.

To allow the period selection, "Period selection" must be checked in the "Details" tab of the description window of the control.

At run time, to select a period, all you have to do is click the Calendar control: the first click is used to select the start date of the period, the second click is used to select the end date of the period.

WinDev If the "Today" button is displayed ("Details" tab of the description window), the popup menu of this button proposes preset periods. The user can easily select the requested period.

To retrieve the start date and the end date of the selected period, all you have to do is use ..开始日期 and ..结束日期.

Example:

NbDays整数型
NbDays日期差数CAL_Calendar1..开始日期,CAL_Calendar1..结束日期)+1
信息"Selected period: from "+日期转换为字符串CAL_Calendar1..开始日期)+...
" to "+日期转换为字符串CAL_Calendar1..结束日期)+...
" which means "+NbDays+" day(s)"

WLanguage functions

Functions for managing the bank holidays

The following functions are used to manage the bank holidays:
14版本和更高版本
假日
14新版本
假日
假日
指明一个日子是否是节假日。
14版本和更高版本
假日添加
14新版本
假日添加
假日添加
将一个日子或一个日子列表指定为节日。
14版本和更高版本
假日删除全部
假日删除全部
清空所有节假日的列表。

Functions for managing the Calendar control

The following functions are used to manage the Calendar control:
14版本和更高版本
日历位置
14新版本
日历位置
日历位置
发送回在一个日历控件中显示的月。
14版本和更高版本
日历选定日期
日历选定日期
发送回在一个日历控件中选中的日期。
14版本和更高版本
日历取消选择日期
日历取消选择日期
在一个多选择的日历控件中取消选择一个日期。
14版本和更高版本
日历选定天数目
日历选定天数目
发送回在一个日历控件中选择的天数。
14版本和更高版本
日历选择日期
日历选择日期
在一个日历控件中选择一个日期。

Properties specific to the Calendar controls
The following properties are used to manage a Calendar control by programming.
最大界限Enables you to find out and modify the upper bound of the Calendar control.
最小界限Enables you to find out and modify the lower bound of the Calendar control.
开始日期Enables you to find out and modify the start date of a period selected in a Calendar control.
结束日期Enables you to find out and modify the end date of a period selected in a Calendar control.
存储格式Enables you to find out and modify the format of the value returned by the Calendar control.
图片Enables you to find out and modify the background image of the Calendar control.
多重选择Enables you to find out and modify the selection mode of a Calendar control

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