summaryrefslogtreecommitdiffstats
path: root/odk/examples/python/toolpanel/toolPanelPocBasic/Module1.xba
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:51:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:51:28 +0000
commit940b4d1848e8c70ab7642901a68594e8016caffc (patch)
treeeb72f344ee6c3d9b80a7ecc079ea79e9fba8676d /odk/examples/python/toolpanel/toolPanelPocBasic/Module1.xba
parentInitial commit. (diff)
downloadlibreoffice-940b4d1848e8c70ab7642901a68594e8016caffc.tar.xz
libreoffice-940b4d1848e8c70ab7642901a68594e8016caffc.zip
Adding upstream version 1:7.0.4.upstream/1%7.0.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'odk/examples/python/toolpanel/toolPanelPocBasic/Module1.xba')
-rw-r--r--odk/examples/python/toolpanel/toolPanelPocBasic/Module1.xba29
1 files changed, 29 insertions, 0 deletions
diff --git a/odk/examples/python/toolpanel/toolPanelPocBasic/Module1.xba b/odk/examples/python/toolpanel/toolPanelPocBasic/Module1.xba
new file mode 100644
index 000000000..9d44f7f01
--- /dev/null
+++ b/odk/examples/python/toolpanel/toolPanelPocBasic/Module1.xba
@@ -0,0 +1,29 @@
+<?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(&quot;CommandButton1&quot;)
+ theTextField = theDialog.getControl(&quot;TextInfo&quot;)
+
+ 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)+&quot;Color &quot; + cstr(rank) + &quot; randomly applied&quot;
+
+ theButton.label = &quot;Click Me to change color&quot;
+
+
+end sub
+</script:module> \ No newline at end of file