From 8537d88d4f13bf5b4a6f556a9742d4e0dab316bb Mon Sep 17 00:00:00 2001 From: László Németh Date: Mon, 29 Oct 2018 13:18:30 +0100 Subject: LibreLogo: stop program immediately at pressing Cancel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- librelogo/source/LibreLogo/LibreLogo.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'librelogo') 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") -- cgit