summaryrefslogtreecommitdiff
path: root/librelogo/source/LibreLogo/LibreLogo.py
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2018-10-29 13:18:30 +0100
committerLászló Németh <nemeth@numbertext.org>2018-11-05 16:22:13 +0100
commit8537d88d4f13bf5b4a6f556a9742d4e0dab316bb (patch)
tree91fa21a3d71e749b3246270ae301563ccefa1b1e /librelogo/source/LibreLogo/LibreLogo.py
parent4b5420f88e4dcc442ade5c844cdabd4365ddf8d9 (diff)
LibreLogo: stop program immediately at pressing Cancel
button of the inputbox or messagebox dialog window, instead of waiting for the next __checkhalt__() in a loop. Change-Id: I1366ad06152e70321a21e78a626f7a89eb5a7ea0 Reviewed-on: https://gerrit.libreoffice.org/62900 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'librelogo/source/LibreLogo/LibreLogo.py')
-rw-r--r--librelogo/source/LibreLogo/LibreLogo.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/librelogo/source/LibreLogo/LibreLogo.py b/librelogo/source/LibreLogo/LibreLogo.py
index 626c5d210f09..103b6061244e 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -303,10 +303,13 @@ def Input(s):
if inputtext:
inputtext = e.Text
else:
+ # Cancel button
__halt__ = True
# dispose the dialog
controlContainer.dispose()
+ # stop program at pressing Cancel
+ __checkhalt__()
return inputtext
except Exception:
__trace__()
@@ -333,7 +336,9 @@ def Print(s):
global __halt__
s = __string__(s, _.decimal)
if not MessageBox(_.doc.CurrentController.Frame.ContainerWindow, s[:500] + s[500:5000].replace('\n', ' '), "", "messbox", __OK_CANCEL__):
+ # stop program at pressing Cancel
__halt__ = True
+ __checkhalt__()
def MessageBox(parent, message, title, msgtype = "messbox", buttons = __OK__):
msgtypes = ("messbox", "infobox", "errorbox", "warningbox", "querybox")