Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit ade101b

Browse files
committed
Merge pull request livecode#1189 from montegoulding/bugfix-296
[[ Bug 296 ]] Autofoucs on message box when typing
2 parents 5c195b2 + 1833089 commit ade101b

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

Toolset/libraries/revbackscriptlibrary.livecodescript

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,15 @@ on releaseStack
12511251
if not gREVSuppressMessages or (gREVSuppressMessages and revOKTarget()) then pass releaseStack
12521252
end releaseStack
12531253

1254+
on keyDown pWhich
1255+
if word 1 of the target is "card" and \
1256+
the mode of stack "Message Box" is not 0 \
1257+
and the short name of this cd of stack "Message Box" is among the items of "Single Line,Multiple Lines" then
1258+
dispatch "revIDEFocusOnMessageBox" to stack "Message Box" with pWhich
1259+
end if
1260+
pass keyDown
1261+
end keyDown
1262+
12541263
on mainStackChanged
12551264
if there is a stack "revApplicationOverview" then
12561265
if the mode of stack "revApplicationOverview" is not 0

Toolset/palettes/message box/behaviors/revmessageboxbehavior.livecodescript

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,13 @@ command removeAll
264264
unlock screen
265265
end removeAll
266266

267+
on revIDEFocusOnMessageBox pChar
268+
if lSelectedCard is among the items of "Single Line,Multiple Lines" then
269+
focus on field "message" of card lSelectedCard
270+
put pChar into the selectedChunk
271+
end if
272+
end revIDEFocusOnMessageBox
273+
267274
command scriptAction pID, pName
268275
switch the short name of the target
269276
case "scriptLines"

notes/bugfix-296.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Autofocus on message box when typing
2+
3+
When typing in the IDE and there is no field in focus if the message box
4+
is open it will automatically focus

0 commit comments

Comments
 (0)