From beb22585a2d5199bc9f2b69d650cbcf0cd75f9c8 Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Tue, 6 May 2025 00:14:20 +0100 Subject: [PATCH] trying to get the windows to behave properly --- app/appui.cls | 35 ++++++++++++++++++++++++----------- db/contacts.sqlite | Bin 7168 -> 9216 bytes 2 files changed, 24 insertions(+), 11 deletions(-) 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 f4c03bd7783370ae0bb48397db7ea160006677d8..af99a28c891bdfecf5dfc3a152dc11ad3516b7b5 100644 GIT binary patch delta 969 zcmZp$Xz-XI%_`2oz`!|C!JbikW5NPvEmk0xk@+`}WZ-1}%`C_CglPp+1(Q7!GvjH- z$&9It<_sSh4l^_|xK4DGuD23oW6-lj%8^t9gT(;VJ`<48=E5ZuJ^pP5m35s!ctFOVzb&iMg18`4n^UW=Va6OJoZ delta 72 zcmZqhXt0