trying to reduce the ui latency

This commit is contained in:
Greg Gauthier 2025-05-07 21:38:43 +01:00
parent 39b41430f6
commit 38f9df983d
2 changed files with 7 additions and 12 deletions

View File

@ -144,7 +144,6 @@
use arg window
self~SetPanelColor(window, 9)
window~erase()
window~refresh()
window~delwin()
win~refresh
self~setupMainMenu(win)
@ -209,7 +208,7 @@
if firstname = "" | lastname = "" then do
formwin~mvaddstr(8, 2, "First and Last names are required.")
formwin~refresh()
call SysWait 1.5
call SysWait 0.5
END /* don't add contact */
else DO
/* Add to database */
@ -226,12 +225,12 @@
if result > 0 then do /* should be a result id number */
formwin~mvaddstr(8, 2, "Contact ID ["result"] added successfully!")
formwin~refresh()
call SysWait 1.5
call SysWait 0.5
end
else do
formwin~mvaddstr(8, 2, "Failed to add contact.")
formwin~refresh()
call SysWait 1.5
call SysWait 0.5
end
end /* add contact */
self~dropWindow(formwin)
@ -267,12 +266,12 @@
if result = 0 then do /* should be a result id number */
delwin~mvaddstr(8, 2, "Contact deleted successfully!")
delwin~refresh()
call SysWait 1.5
call SysWait 0.5
end
else do
delwin~mvaddstr(8, 2, "Failed to add contact.")
delwin~refresh()
call SysWait 1.5
call SysWait 0.5
end
self~dropWindow(delwin)
RETURN
@ -302,7 +301,7 @@
listwin~mvaddstr(4, 18, "Last Name")
listwin~mvaddstr(4, 30, "Phone")
listwin~mvaddstr(4, 50, "Email")
listwin~mvaddstr(5, 2, "-- ---------- --------- --------------- ------------------")
listwin~mvaddstr(5, 2, "-- ---------- --------- --------------- -------------------------")
listwin~attroff(listwin~A_BOLD)
contacts = db~getAllContacts()
@ -321,7 +320,7 @@
end
end
else do
listwin~mvaddstr(5, 5, "No contacts found.")
listwin~mvaddstr(6, 5, "No contacts found.")
end
listwin~getch()
@ -449,7 +448,6 @@
menuwin~refresh
end
when key = D2C(81) | key = D2C(113) then do /* Q for quit */
call SysWait 0.25
.environment~selected = self~findInArray(menu_keys, key)
self~ProcessSelection(menuwin, menu_keys[.environment~selected])
RETURN
@ -468,7 +466,6 @@
self~DrawMenu(menuwin, menu_items, .environment~selected, win)
menuwin~mvaddstr(19 - 1, 18, "Letter selection ["||key||"]")
menuwin~refresh
call SysWait 0.25
self~ProcessSelection(menuwin, key)
end /* if pos > 0 */
end /* otherwise */
@ -496,7 +493,6 @@
when key_char = 'e' then do
menuwin~mvaddstr(19 - 3, 5, "TODO: Create an Edit Panel ");
menuwin~refresh
call SysWait 0.25
END
when key_char = 's' then do
self~searchContactPanel()
@ -507,7 +503,6 @@
when key_char = 'q' then do
menuwin~mvaddstr(19 - 3, 5, "Exiting the application... ")
menuwin~refresh
call SysWait 0.25
menuwin~endwin
.environment['STOPNOW'] = 1
END

Binary file not shown.