From 38f9df983d7ee09bcf73cf26c906a7070e93691b Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Wed, 7 May 2025 21:38:43 +0100 Subject: [PATCH] trying to reduce the ui latency --- app/appui.cls | 19 +++++++------------ db/contacts.sqlite | Bin 10240 -> 10240 bytes 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/appui.cls b/app/appui.cls index 33241de..3970620 100644 --- a/app/appui.cls +++ b/app/appui.cls @@ -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 diff --git a/db/contacts.sqlite b/db/contacts.sqlite index 8585a86125678511a8ef83f6ef221c9ac54d8845..4e01d377f0e353f8c1086533205a36a00b1c12a0 100644 GIT binary patch delta 243 zcmZn&Xb6}f&DcIs#+k8wW5N<XuOVmD>9n9M6HEo-h|WME}v zX=PwyWME{fYXC$Dp-mk3mnPnN1^Ycm)lS_&% zc!6dzGT&xkzRi4;`Nd{Ij@itUSMtla1BI;_WmU}sfLikN5_2pKEp;somDyPt7&Wym zeDjlXQjN@vfhaR4Rolcw!NAZu;g|!eSx-^Zz{6 delta 246 zcmZn&Xb6}f%~&^4#+k8hW5N<)79Wqz?)kYhIU542-g><^e!0`FV*smWGzPP;4m63Y3%7 zH}lIc%1zACHZcL(YiVd;U}<7xZe(T*F>(z9^Ht_GKm!*rv#2w(GECketSYL>1k&ja R)tR1~UJ6vd`IWGk2mmwcJOcm#