PC SOFT

WINDEV的在线文档

  • Overview
  • Handling the TimeLine control by programming
  • Adding a track
  • Adding an event
  • Filling a TimeLine control with the data found in a HFSQL data file
  • Retrieving a list of events
  • Deleting an event
  • Deleting a track
  • Modifying the display of the control
  • Using the popup menu (AAF)
  • Advanced use of the processes associated with the Timeline control
  • Advanced use of processes with procedure
  • Properties specific to the TimeLine 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 TimeLine control can be:To handle a TimeLine control by programming, WinDev proposes the TimeLine functions.

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

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

Handling the TimeLine control by programming

Adding a track

Adding a track into a TimeLine control is performed by 时间线添加磁道.

Example:

// Adds tracks into a TimeLine control
时间线添加磁道TL_Timeline1"Sub Bass"
时间线添加磁道TL_Timeline1"Scratchy Drums"
时间线添加磁道TL_Timeline1"Guitar1"

Note: 时间线添加磁道 is used to insert a background image into the track.

Adding an event

Adding an event into a TimeLine control is performed by 时间轴添加事件. This function accepts two syntaxes:

  • syntax used to specify the characteristics of the event: title, description, ...
// Adds a 5-second event into a TimeLine control configured to the second
MyTrack is string
MyTitle is string
EvtStart is int
EvtEnd is int

MyTrack = "Strings"
MyTitle = "Start"
EvtStart = 4
EvtEnd = 9

TimelineAddEvent(TL_Music, MyTrack, MyTitle, EvtStart, EvtEnd)

时间轴删除全部TL_Robots
Evt事件时间轴型

时间线添加磁道TL_Robots"Robot 1"
Evt..磁道="Robot 1"
Evt..标题="Startup"
Evt..开始=10
Evt..结束=150
Evt..背景颜色=浅绿色
时间轴添加事件TL_RobotsEvt

Evt..磁道="Robot 1"
Evt..标题="Special process"
Evt..开始=150
Evt..结束=450
Evt..背景颜色=柔和蓝色
时间轴添加事件TL_RobotsEvt

The ..背景颜色 property of the 事件时间轴 variable is used to define a display color for an event. If no background color is defined, the TimeLine control will automatically use the color associated with the category of the event.

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

The records are stored in a HFSQL data file. The initial fill of the TimeLine control can be done by browsing the data file via the FOR EACH syntax and by adding each event via 时间轴添加事件.

时间轴删除全部TL_Robots
// Declare the events
Evt事件时间轴型

// Browse the Robot data file
对于每个Robot
时间线添加磁道TL_robotsRobot.RobotName
// Browse the Evt_Robot data file
对于每个Evt_Robot满足RobotID等于Robot.RobotID
Evt..工具提示=Evt_Robot.EvtTooltip
Evt..标题=Evt_Robot.EvtTitle
Evt..开始=Evt_Robot.EvtStart
Evt..结束=Evt_Robot.EvtEnd
Evt..内容=Evt_Robot.EvtContent
Evt..磁道=Robot.RobotName
Evt..背景颜色=Evt_Robot.EvtColor
时间轴添加事件TL_RobotsEvt
结束
结束

Reminder: You also have the ability to use a TimeLine control linked to a data file. See TimeLine control linked to a data file for more details.

Retrieving a list of events

时间轴事件列表 is used to retrieve:
  • the list of all events found in the TimeLine control:
// Array containing a list of events
arrEvtList事件时间轴型的数组型0

// List of events
arrEvtList时间轴事件列表TL_Timeline
  • the list of events for a track included between two specific times:
// List of events for robot 1 found between 50s and 100s
arrEvtList事件时间轴型的数组型0
arrEvtList时间轴事件列表TL_Robots"Robot 1"50100
  • the event currently selected or hovered:
// Selected event
arrEvtList事件时间轴型的数组型0

arrEvtList时间轴事件列表TL_Robots计划.选定预约

Deleting an event

时间轴删除事件 is used to delete:
  • the event selected in the control.
  • a specific event.

// Deletes the first event
时间轴删除事件TL_MyTimeLine1

Deleting a track

时间轴删除线索 is used to delete a track from the TimeLine control.

// Deletes the SOUND track
ResDel布尔型
ResDel时间轴删除线索TL_MYTIMELINE"Sound"
如果ResDel,那么
信息"Track successfully deleted"
结束
时间轴删除全部 is used to delete all the events from the TimeLine control as well as all its tracks.

Modifying the display of the control

The current display of a TimeLine control can be modified by 时间轴改变模式. This function is used to modify the display mode of the control: second, millisecond or microsecond.

Using the popup menu (AAF)
The Timeline control is associated with a popup menu (AAF). The popup menu of the TimeLine control allows you to:
  • perform a zoom action on the control,
  • add, modify or delete an event.
To save the operations performed, you must use the processes of the TimeLine control.

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

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

过程EnterInInputevtEdited事件时间轴型

// Store the data
EVT.TitleevtEdited..标题
EVT.EvtStartevtEdited..开始
EVT.EvtEndevtEdited..结束
...
H添加EVT

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

These procedures receive in parameter an 事件时间轴 variable affected by the process.

Advanced use of the processes associated with the Timeline control

Advanced use of processes with procedure

You can also allow the user to define more precisely the characteristics of his event 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 event in input" process. To lock the direct input, the process must return .

This principle can be applied to all the processes called via the popup menu of the TimeLine control.

Example: Opening a window for entering the event.

过程EnterInInputevtEdited事件时间轴型

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

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

Properties specific to the TimeLine controls
The following properties are used to manage a TimeLine control by programming.
18版本和更高版本
总范围开始
18新版本
总范围开始
总范围开始
..总范围开始 is used to:
  • find out and modify the first displayable date or time in a Scheduler control or in a TimeLine control.
  • modify the first displayable time in a TimeLine control.
18版本和更高版本
可见范围开始
可见范围开始
..可见范围开始 is used to:
  • find out and modify the first visible date or time in a Scheduler control or in a TimeLine control.
  • modify the first visible time in a TimeLine control.
18版本和更高版本
总范围结束
18新版本
总范围结束
总范围结束
..总范围结束 is used to:
  • find out and modify the last displayable date or time in a Scheduler control or in a TimeLine control.
  • modify the last displayable time in a TimeLine control.
18版本和更高版本
可见范围结束
可见范围结束
..可见范围结束 is used to:
  • find out and modify the last visible date or time in a Scheduler control or in a TimeLine control.
  • modify the last visible time in a TimeLine 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.
18版本和更高版本
规则板.可修改
规则板.可修改
..规则板.可修改 is used to:
  • Find out whether the ruler of a TimeLine control can be moved by the user.
  • Make the ruler of a TimeLine control movable (or not) by the user.
18版本和更高版本
规则板.值
18新版本
规则板.值
规则板.值
..规则板.值 is used to find out and modify the position of a ruler in a TimeLine control.
18版本和更高版本
规则板.可见
18新版本
规则板.可见
规则板.可见
..规则板.可见 is used to:
  • Find out whether a ruler is visible in a TimeLine control.
  • Make a ruler visible or invisible in a TimeLine control.

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