1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE script:module PUBLIC
"-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3 <script:module xmlns:
script=
"http://openoffice.org/2000/script" script:
name=
"Module1" script:
language=
"StarBasic">
7 Sub dialogOnLoad(event)
9 theDialog = event.source
13 sub buttonClick(event)
16 theButton = theDialog.getControl(
"CommandButton1
")
17 theTextField = theDialog.getControl(
"TextInfo
")
19 colors = Array(rgb(
255,
0,
0),rgb(
0,
255,
0),rgb(
0,
0,
255))
20 rank = getSystemTicks() mod
3
22 theDialog.Model.BackgroundColor = colors(rank)
23 theTextField.text = cstr(Now) + chr(
10)+
"Color
" + cstr(rank) +
" randomly applied
"
25 theButton.label =
"Click Me to change color
"