29 lines
804 B
Plaintext
29 lines
804 B
Plaintext
![]() |
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Module1" script:language="StarBasic">
|
||
|
global theDialog
|
||
|
|
||
|
|
||
|
Sub dialogOnLoad(event)
|
||
|
|
||
|
theDialog = event.source
|
||
|
|
||
|
End Sub
|
||
|
|
||
|
sub buttonClick(event)
|
||
|
|
||
|
|
||
|
theButton = theDialog.getControl("CommandButton1")
|
||
|
theTextField = theDialog.getControl("TextInfo")
|
||
|
|
||
|
colors = Array(rgb(255,0,0),rgb(0,255,0),rgb(0,0,255))
|
||
|
rank = getSystemTicks() mod 3
|
||
|
|
||
|
theDialog.Model.BackgroundColor = colors(rank)
|
||
|
theTextField.text = cstr(Now) + chr(10)+"Color " + cstr(rank) + " randomly applied"
|
||
|
|
||
|
theButton.label = "Click Me to change color"
|
||
|
|
||
|
|
||
|
end sub
|
||
|
</script:module>
|