diff --git a/app/appui.cls b/app/appui.cls index c665328..71e282a 100644 --- a/app/appui.cls +++ b/app/appui.cls @@ -126,7 +126,7 @@ return ::method addContactPanel - expose win db menuwin menu_items + expose win db menuwin menu_items formwin /* Create a form panel */ max_y = win~lines @@ -147,7 +147,7 @@ /* Input fields */ firstName = self~getInputField(formwin, 3, 14, 30) - if firstName = .nil then return /* User canceled */ + if firstName = .nil then RETURN lastName = self~getInputField(formwin, 4, 14, 30) if lastName = .nil then return @@ -175,15 +175,18 @@ end formwin~refresh() - call SysWait 1.5 + call SysWait 1 + self~dropAddWindow + return + + ::method dropAddWindow + expose win menuwin formwin formwin~erase() formwin~refresh() - - /* Redraw the main menu */ - self~setupMainMenu(win) + menuwin~refresh() + RETURN - return ::method listAllContactsPanel expose win db menuwin @@ -264,7 +267,7 @@ if term = .nil then do searchwin~erase() searchwin~refresh() - self~DrawMenu(menuwin, menu_items, .environment~selected, win) + self~setupMainMenu(win) menuwin~refresh() return end @@ -277,6 +280,16 @@ self~displaySearchResults(term) return + ::METHOD displaySearchResults + expose win menuwin db + use arg term + /* TODO: COMPLETE ME! */ + + self~setupMainMenu(win) + menuwin~refresh() + + RETURN + ::method getInputField use arg win, y, x, maxlen @@ -291,9 +304,9 @@ do forever key = win~getch() select - when key = D2C(27) then do /* ESC key */ - win~curs_set(0) /* Hide cursor */ + when key = 27 then do /* ESC key */ win~noecho() /* Stop showing typed characters */ + win~curs_set(0) /* Hide cursor */ return .nil /* Return nil to indicate cancellation */ end when key = D2C(10) | key = D2C(13) then do /* Enter key */ @@ -301,7 +314,7 @@ win~noecho() /* Stop showing typed characters */ return buffer /* Return the entered text */ end - when key = D2C(8) | key = 127 then do /* Backspace */ + when key = D2C(8) | key = D2C(127) then do /* Backspace */ if buffer~length > 0 then do buffer = buffer~left(buffer~length - 1) win~move(y, x) diff --git a/db/contacts.sqlite b/db/contacts.sqlite index f4c03bd..af99a28 100644 Binary files a/db/contacts.sqlite and b/db/contacts.sqlite differ