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

Binary file not shown.