From a1a067d417644deff8d68380f01889b30fec4826 Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Wed, 7 May 2025 22:16:48 +0100 Subject: [PATCH] further work on panel quality --- app/appui.cls | 47 +++++++++++++++++++++++++++++++++------------ db/contacts.sqlite | Bin 10240 -> 10240 bytes 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/app/appui.cls b/app/appui.cls index 3970620..d2e96e8 100644 --- a/app/appui.cls +++ b/app/appui.cls @@ -159,8 +159,8 @@ /* Create a form panel */ max_y = win~lines max_x = win~cols - form_height = 14 - form_width = 55 + form_height = 15 + form_width = 60 start_y = (max_y - form_height) % 2 start_x = (max_x - form_width) % 2 formwin = self~DrawSubPanel(form_height, form_width, start_y, start_x, 0, "Add New Contact", .true) @@ -168,8 +168,10 @@ /* Create form fields */ formwin~mvaddstr(3, 2, "First Name: ") formwin~mvaddstr(4, 2, "Last Name: ") - formwin~mvaddstr(5, 2, "Phone: "); formwin~mvaddstr(5, 35, "Type: "); - formwin~mvaddstr(6, 2, "Email: "); formwin~mvaddstr(7, 2, "Email Type: "); + formwin~mvaddstr(5, 2, "Phone: "); formwin~mvaddstr(5, 42, "Type: "); + formwin~mvaddstr(6, 2, "Email: "); formwin~mvaddstr(6, 42, "Type: "); + formwin~mvaddstr(7, 2, "Street: ") + formwin~mvaddstr(8, 2, "City: "); formwin~mvaddstr(8, 28, "State: "); formwin~mvaddstr(8, 40, "PostCode: ") formwin~mvaddstr(form_height-2, 2, "[Enter] to save, [Esc] to cancel") formwin~refresh() @@ -189,8 +191,8 @@ self~dropWindow(formwin) RETURN END - phone_type = self~getInputField(formwin, 5, 45, 15) - if phone = .nil then do + phone_type = self~getInputField(formwin, 5, 48, 15) + if phone_type = .nil then do self~dropWindow(formwin) RETURN END @@ -199,8 +201,29 @@ self~dropWindow(formwin) RETURN END - email_type = self~getInputField(formwin, 7, 14, 15) - if email = .nil then do + email_type = self~getInputField(formwin, 6, 48, 15) + if email_type = .nil then do + self~dropWindow(formwin) + RETURN + END + + street = self~getInputField(formwin, 7, 10, 25) + if street = .nil then do + self~dropWindow(formwin) + RETURN + END + city = self~getInputField(formwin, 8, 10, 15) + if city = .nil then do + self~dropWindow(formwin) + RETURN + END + state = self~getInputField(formwin, 8, 35, 2) + if state = .nil then do + self~dropWindow(formwin) + RETURN + END + post = self~getInputField(formwin, 8, 50, 10) + if post = .nil then do self~dropWindow(formwin) RETURN END @@ -223,12 +246,12 @@ /* Display result message */ if result > 0 then do /* should be a result id number */ - formwin~mvaddstr(8, 2, "Contact ID ["result"] added successfully!") + formwin~mvaddstr(10, 2, "Contact ID ["result"] added successfully!") formwin~refresh() call SysWait 0.5 end else do - formwin~mvaddstr(8, 2, "Failed to add contact.") + formwin~mvaddstr(10, 2, "Failed to add contact.") formwin~refresh() call SysWait 0.5 end @@ -409,8 +432,8 @@ if buffer~length > 0 then do buffer = buffer~left(buffer~length - 1) win~move(y, x) - win~addstr(buffer || " ") /* Erase the last character */ - win~move(y, x + buffer~length) + win~addstr(buffer || " ") /* Erase the last character */ + win~move(y, x + buffer~length - 1) end end otherwise do diff --git a/db/contacts.sqlite b/db/contacts.sqlite index 4e01d377f0e353f8c1086533205a36a00b1c12a0..e81d6e08a3cf0e00966df90a830e79c7e87fce51 100644 GIT binary patch delta 944 zcmZuvU2D@&7*2B5th!YhtF|Q;R;83NGLoER?MYi(r_$b32E7wOPqWYko1D<5NUu8Z zP7svBe!$c_Z>0BL`WF;>;f4MQ@y0i?ek@x)5AXXv&+~pA9~>XNlK9itH}3MMAD+BL zX;C=g&?oc~byTTdKB)wdjQ5q-%<1$O=5=Elo95 z&D1Lwn1G=sNf^`KA%H9zetYz6ph8TnUSMiY>mrvgV%!?Le&8_g4uz{n2h6i4v3LVA zxWH7aiCiIvaT^#WARSEZgo%a{xCcv0BWDA@#C}$yu_Nw>qftC|ii#L{|#<8wRp{ULj5dpoLZ7>2BBD%QZ8T??JXT8H(V zfvsv-){Q;6Tp>#Ca_A{lAF!cI2Sgzpu_#<~1qc>vwZM`~&v+De1|a%07Wb&vnrXeFfcG|m~5+L z31SpaUZW%(3}l3O${HKH7o`H3o|fWZX1b9XkXIxQVL=cKykB;}VQS!HBkWoT|? zYJx?`!eTP7tn}u`?7x`}SOl4v)fo#i^7B&T^Gb7*Qj3b&c^H{x8I$w#N)nSxiY<77 z)-W>PW?;U}e3bdcW!( z2LO%A&r8g)G_=&UG@N{!Uz3B8`8oshb>=ldLl!e@gfPn5!&N1M{GgW#@`OW1X>MX( TQhrLMUUGge1H