Copyright 2010-2017 Obihai Technology, Inc.
157
By default: xpos and ypos attributes are 0 if not specified
<Notifications>
Specifies and contains a list of notification child elements whose icons are to be shown on the title bar in the given order.
Attributes used:
-
list = a comma separated list of notifications to show on the title bar. A * includes all the built-in notifications
-
width = the total pixel width of the notication area on the title bar
-
align = specifies whether the icons should align to the right side of the notification area or to the left side of the
notification area. "right" is the default if this attribute is not specified. With right alignment, the icons are drawn in
right to left order. With left alignment, the icons are drawn in left to right order
-
base-url = A string to prepend to the icon attribute in each child element to be used as URL to get the icon image
Variables/Constants used:
-
$sys.hidetabs = 0 if the LineKeyTabs option is enabled, or 1 otherwise
-
$sys.ntabs = the value of LineKeyMaxTabs (2 or 4)
-
@dispW= the pixel width of the LCD: 480 for OBi1032/1062, 320 for OBi1022, and 800 for OBi2000 Series
-
@lkpg1 = the x-position of Line Key Tab 1
-
@lkpg1v2 = the skin-dependant x-position of Line Key Tab 1
<my-trash>
An example of a user-defined notification child element.
Attributes used:
-
icon = the url to download the icon. The actual URL is formed by prepending this attribute with the value of the
base-url. For this example, the full url is
http://192.168.15.149/icons/transh.png
-
refresh-id = Anarbitray but unique string among all referesh-
id’s to be used as reference
to trigger a redraw this icon
by an external application
-
xpace = x-pixel width of the holding box that holds the icon, which is drawn aligned with the left side of the holding
box if <Notifications> has align="left", or with the right side of the holding box otherwise.
By default: xspace = 30
<my-mic>
Another example of a user-defined notification child element, similar to <my-trash>
To see the effect of a left-aligned <Notifications>, this above example can be modified slighty by changing the value of
the
align
attribute from "right" to "left" and the xpos attribute from "0" to "150":
<
TitleBarStyle
size
=
'
10
'
textcolor
=
'
green
'
font
=
'
@gfont-bold
'
>
<
time
xpos
=
'
2
'
/>
<
date
xpos
=
'
68
'
/>
<
text
xpos
=
'
2
'
ypos
=
'
16
'
>
$prod.obinumber ($prod.mac)
</
text
>
<
Notifications
list
=
'
*,my-mic,my-trash
'
width
=
'
$eval($sys.hidetabs?@dispW,($sys.ntabs==4)?@lkpg1,@lkpg1v2)
'
align
=
'
left
'
xpos
=
'
150
'
base-url
=
'
http://192.168.15.149/icons/
'
>
<
my-trash
icon
=
'
trash.png
'
refresh-id
=
'
mytrash
'
xspace
=
'
60
'
/>
<
my-mic
icon
=
'
mic.png
'
refresh-id
=
'
mymic
'
xspace
=
'
45
'
/>
</
Notifications
>
</
TitleBarStyle
>
The picture below shows the corresponding result (with 4 Line Key Tabs and the
Tomáš
skin):
150
Tomáš
: $sys.hidetabs=0, $sys.ntabs=4
<TitleBarStyle> Attributes
All attributes are optional. When specified, the attributes are inherited by the child widgets, such as size (for text size),
textcolor, font, etc. The only exception is the bgcolor attribute, which is applied to the Title Bar itsef to overwrite the
default background color. Here is an example of using bgcolor attribute:
<
TitleBarStyle
size
=
'
10
'
bgcolor
=
'
0x444444,white,0
'
textcolor
=
'
blue
'
font
=
'
@gfont-bold
'
>
<
time
xpos
=
'
2
'
/>
<
date
xpos
=
'
68
'
/>
<
text
xpos
=
'
2
'
ypos
=
'
16
'
>
600 888 111 ($prod.mac)
</
text
>