From 2ffb85bea1c792083c3f63e5c5a7ac9ff08612de Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 26 Sep 2005 00:05:01 +0000 Subject: Fixed bug where ESC exited Dialog when something had the focus --- simplegui.mod/simplegui.bmx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'simplegui.mod') diff --git a/simplegui.mod/simplegui.bmx b/simplegui.mod/simplegui.bmx index 90eb595..a7ca95c 100644 --- a/simplegui.mod/simplegui.bmx +++ b/simplegui.mod/simplegui.bmx @@ -953,7 +953,7 @@ End Function Rem bbdoc: Handles a TGUIHandler as if it's a modal dialog. -returns: True if @ok is pressed, False if @cancel or the ESCAPE key is pressed. +returns: True if @ok is pressed, False if @cancel or the ESCAPE key is pressed. ESCAPE is only allowed if nothing has the text focus. about: @gui is the GUI handler and widgets to display as a dialog., @ok is the clickable widget that OK's the dialog, @cancel the widget that cancels it. about: If @i is not null then this image is drawn as a mouse cursor. EndRem @@ -978,7 +978,7 @@ Function GUIDialog(gui:TGUIHandler, ok:TWidget, cancel:TWidget, i:TImage=Null) ok_pressed=True EndIf - If click=cancel Or KeyHit(KEY_ESCAPE) + If click=cancel Or (KeyHit(KEY_ESCAPE) And gui.GetFocus()=Null) done=True ok_pressed=False EndIf -- cgit v1.2.3