SetClockControlTime
This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.
Syntax
void SetClockControlTime(char[] panel, char[] control, int hours, int minutes, int seconds);
void SetClockControlTime(char[] panel, char[] control, int time);
Function
Sets the time of thePanel DesignerClock Control. The panel is accessed by its individual panel name that is entered in thePanel Designer.
Parameters
panel Panel name, restricted to 128 characters."" – references allloaded panelsIf you open a panel the first time, the panel is loaded.
If you close the panel, it remains loaded.
control
- Symbol assignment is not case sensitive.
- If you want to access all elements of a panel the notation "" is used, see example below.
hours
Defines the hours of the time to be displayed in the clock control.
minutes
Defines the minutes of the time to be displayed in the clock control.
seconds
Defines the seconds of the time to be displayed in the clock control.
time
Defines the time in seconds to be displayed in the clock control. The corresponding hours, minutes and seconds are calculated during runtime.
Return Values
—
Reference example from the CANoe 12 help. Check the required configuration, database objects and API availability in your installed version; this is not a recorded compiler or runtime test. The following blocks are separate fragments or alternatives, not one combined program.
// Set the time in hours, minutes, seconds. It will be displayed '10:20:30'.
on key 'a'
{
SetClockControlTime("ClockControl1", "ClockCAPL", 10, 20, 30);
}
// Set the time in seconds. It will be displayed '01:00:00'.
on key 'b'
{
SetClockControlTime("ClockControl1", "ClockCAPL", 3600);
}
Related APIs
SetControlProperty | SetControlForeColor | SetControlBackColor | SetDefaultControlColors