Roclockwidget (hd2000 only) – BrightSign HD2000 Object Reference Manual User Manual

Page 46

Advertising
background image

roClockWidget (HD2000 only)

roClockWidget puts a clock on the screen. It has no extra interface, only construction arguments.
roClockWidget implements the ifTextWidget interface.

Object creation:
 CreateObject("roClockWidget", roRectangle rect, roResourceManager

res, rotINT32 display_type)

o

rect = the rectangle in which the clock is displayed. Based on the size of the rectangle, the

widget picks a font.

o

display_type = 0 for date only, 1 for clock only. To show both on the screen, two

widgets must be created.


Example:
rect=CreateObject("roRectangle", 0, 0, 300, 60)
res=CreateObject("roResourceManager", "resources.txt")
c=CreateObject("roClockWidget", rect, res, 1)
c.Show()

The resource manager is passed in to the widget and the widget uses the following resources within
resources.txt to display the time/date correctly.

Here are the 'eng' entries:

[CLOCK_DATE_FORMAT]
eng "%A, %B %e, %Y"
[CLOCK_TIME_FORMAT]
eng "%l:%M"
[CLOCK_TIME_AM]
eng "AM"
[CLOCK_TIME_PM]
eng "PM"
[CLOCK_DATE_SHORT_MONTH]
eng "Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec"
[CLOCK_DATE_LONG_MONTH]
eng
"January|February|March|April|May|June|July|August|September|October|No
vember|December"
[CLOCK_DATE_SHORT_DAY]
eng "Sun|Mon|Tue|Wed|Thu|Fri|Sat"
[CLOCK_DATE_LONG_DAY]
eng "Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday"

The following are the control characters for the date/time format strings:

// Date format
//
// %a Abbreviated weekday name
// %A Long weekday name
// %b Abbreviated month name
// %B Full month name
// %d Day of the month as decimal 01 to 31
// %e Like %d, the day of the month as a decimal number, but without
leading zero
// %m Month name as a decimal 01 to 12
// %n Like %m, the month as a decimal number, but without leading zero

46

Advertising
This manual is related to the following products: