fix quit selection
This commit is contained in:
parent
4f0071c711
commit
5e81a528a9
@ -19,8 +19,6 @@ Do forever
|
|||||||
if .environment['STOPNOW'] = 1 then do
|
if .environment['STOPNOW'] = 1 then do
|
||||||
app~cleanup() /* Clean up before exiting */
|
app~cleanup() /* Clean up before exiting */
|
||||||
call SysCls
|
call SysCls
|
||||||
/* Say .environment["REXX_PATH"] */
|
|
||||||
/* Say "Address Book Exited." */
|
|
||||||
exit 0
|
exit 0
|
||||||
end
|
end
|
||||||
app~reloop()
|
app~reloop()
|
||||||
|
@ -146,30 +146,29 @@
|
|||||||
self~DrawMenu(menuwin, menu_items, .environment~selected, win)
|
self~DrawMenu(menuwin, menu_items, .environment~selected, win)
|
||||||
menuwin~refresh
|
menuwin~refresh
|
||||||
end
|
end
|
||||||
when key = D2C(81) | key = D2C(113) | key = "q" | key = C2D("q") then do
|
when key = D2C(81) | key = D2C(113) then do /* Q for quit */
|
||||||
menuwin~endwin
|
call SysWait 0.25
|
||||||
.environment['STOPNOW'] = 1
|
.environment~selected = self~findInArray(menu_keys, key)
|
||||||
|
self~ProcessSelection(menuwin, menu_keys[.environment~selected])
|
||||||
RETURN
|
RETURN
|
||||||
end
|
END
|
||||||
when key = D2C(10) | key = D2C(13) then do /* Enter key - numeric codes only */
|
when key = D2C(10) | key = D2C(13) then do /* Enter key - numeric codes only */
|
||||||
menuwin~mvaddstr(19 - 1, 18, "Letter selection ["||menu_keys[.environment~selected]||"]")
|
menuwin~mvaddstr(19 - 1, 18, "Letter selection ["||menu_keys[.environment~selected]||"]")
|
||||||
menuwin~refresh
|
menuwin~refresh
|
||||||
call SysWait 0.25
|
|
||||||
self~ProcessSelection(menuwin, menu_keys[.environment~selected])
|
self~ProcessSelection(menuwin, menu_keys[.environment~selected])
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
otherwise do
|
otherwise do
|
||||||
if datatype(key) = 'CHAR' then do
|
|
||||||
key = lower(key)
|
key = lower(key)
|
||||||
pos = self~findInArray(menu_keys, key)
|
poz = self~findInArray(menu_keys, key)
|
||||||
if pos > 0 then do
|
if poz > 0 then do
|
||||||
|
.environment~selected = poz
|
||||||
|
self~DrawMenu(menuwin, menu_items, .environment~selected, win)
|
||||||
menuwin~mvaddstr(19 - 1, 18, "Letter selection ["||key||"]")
|
menuwin~mvaddstr(19 - 1, 18, "Letter selection ["||key||"]")
|
||||||
menuwin~refresh
|
menuwin~refresh
|
||||||
call SysWait 0.25
|
call SysWait 0.25
|
||||||
self~ProcessSelection(menuwin, key)
|
self~ProcessSelection(menuwin, key)
|
||||||
return
|
end /* if pos > 0 */
|
||||||
end
|
|
||||||
end
|
|
||||||
end /* otherwise */
|
end /* otherwise */
|
||||||
end /* select */
|
end /* select */
|
||||||
/* Only redraw if selection changed */
|
/* Only redraw if selection changed */
|
||||||
@ -210,7 +209,7 @@
|
|||||||
call SysWait 0.25
|
call SysWait 0.25
|
||||||
END
|
END
|
||||||
when key_char = 'q' then do
|
when key_char = 'q' then do
|
||||||
menuwin~mvaddstr(19 - 3, 5, "Exiting The Application... ");
|
menuwin~mvaddstr(19 - 3, 5, "Exiting the application... ")
|
||||||
menuwin~refresh
|
menuwin~refresh
|
||||||
call SysWait 0.25
|
call SysWait 0.25
|
||||||
menuwin~endwin
|
menuwin~endwin
|
||||||
@ -228,7 +227,11 @@
|
|||||||
return 0 /* Not found */
|
return 0 /* Not found */
|
||||||
|
|
||||||
::method cleanup
|
::method cleanup
|
||||||
expose win
|
expose win menuwin
|
||||||
/* Clean up ncurses */
|
/* Clean up ncurses */
|
||||||
|
menuwin~endwin
|
||||||
win~endwin
|
win~endwin
|
||||||
|
exit 0
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user