diff --git a/bin/fullappdemo.xex b/bin/fullappdemo.xex index 8c52777..cfb0a5e 100644 Binary files a/bin/fullappdemo.xex and b/bin/fullappdemo.xex differ diff --git a/src/a8defines.pas b/src/a8defines.pas index db2f249..9a58c36 100644 --- a/src/a8defines.pas +++ b/src/a8defines.pas @@ -14,7 +14,7 @@ interface const // Version - LIB_VERSION = '1.1.0'; + LIB_VERSION = '1.1.1'; // Window Record and Memory Alloc WRECSZ = 10; diff --git a/src/a8libgadg.pas b/src/a8libgadg.pas index 29c1116..744c49f 100644 --- a/src/a8libgadg.pas +++ b/src/a8libgadg.pas @@ -484,7 +484,7 @@ function GList(bN, x, y, bE, bI, bV, bS: Byte; pS: TStringArray): Byte; // Set drawing position xp := 0; yp := 0; - bEnd := Min(bStart + bV - 1, bS - 1); + bEnd := WMin(bStart + bV - 1, bS - 1); for bL := 0 to bS - 1 do begin diff --git a/src/a8libmisc.pas b/src/a8libmisc.pas index 9ad2911..379af01 100644 --- a/src/a8libmisc.pas +++ b/src/a8libmisc.pas @@ -25,7 +25,7 @@ interface // -------------------------------------------------- function IKC2ATA(bN: Byte): Byte; function WaitKCX(bI: Byte): Word; -function Min(x, y: Byte): Byte; +function WMin(x, y: Byte): Byte; implementation @@ -140,9 +140,9 @@ function WaitKCX(bI: Byte): Word; Poke(KEYPCH, KNONE); end; -function Min(x, y: Byte): Byte; +function WMin(x, y: Byte): Byte; (* -@description: Min returns the smallest value of X and Y. +@description: WMin returns the smallest value of X and Y. *) begin diff --git a/src/a8libstr.pas b/src/a8libstr.pas index da0f43d..0b1fe79 100644 --- a/src/a8libstr.pas +++ b/src/a8libstr.pas @@ -66,23 +66,7 @@ procedure StrAI(pS: PByte; bS: Byte); // Process each element for bL := 0 to bS - 1 do begin - if (pS^ >= 0) and (pS^ <= 31) then - begin - pS^ := pS^ + 64; - end - else if (pS^ >= 32) and (pS^ <= 95) then - begin - pS^ := pS^ - 32; - end - else if (pS^ >= 128) and (pS^ <= 159) then - begin - pS^ := pS^ + 64; - end - else if (pS^ >= 160) and (pS^ <= 223) then - begin - pS^ := pS^ - 32; - end; - + pS^ := byte(ata2int(char(pS^))); // Increment pointer to next char Inc(pS); end; @@ -96,25 +80,7 @@ procedure StrAI(pS: PByte; bS: Byte); // ------------------------------------------------------------ function CharAI(bC: Byte): Byte; begin - if (bC >= 0) and (bC <= 31) then - begin - Result := bC + 64; - end - else if (bC >= 32) and (bC <= 95) then - begin - Result := bC - 32; - end - else if (bC >= 128) and (bC <= 159) then - begin - Result := bC + 64; - end - else if (bC >= 160) and (bC <= 223) then - begin - Result := bC - 32; - end - else begin - Result := bC; - end; + Result := byte(ata2int(char(bC))); end; diff --git a/src/fullappdemo.pas b/src/fullappdemo.pas index 844a882..ba29029 100644 --- a/src/fullappdemo.pas +++ b/src/fullappdemo.pas @@ -10,7 +10,7 @@ // Pull in include files uses - Crt, a8defines, a8defwin, a8libmisc, a8libstr, a8libwin, a8libgadg, a8libmenu; + crt, sysutils, a8defines, a8defwin, a8libmisc, a8libstr, a8libwin, a8libgadg, a8libmenu; // Variables var @@ -43,7 +43,7 @@ function FileInput: Boolean; selected_list: Byte; read_list: Byte; bM: Byte; - tmp: Byte; + i, tmp: Byte; begin Result:= false; @@ -56,7 +56,7 @@ function FileInput: Boolean; FillChar(@selected_file[tmp + 1], FILE_SIZE - tmp, CHSPACE ); win_file:=WOpen(5, 4, 30, 16, WOFF); - WOrn(win_file, WPTOP, WPLFT, 'Choose file'); + WOrn(win_file, WPTOP, WPLFT, 'Choose a file'); WPrint(win_file, 2, 2, WOFF, 'File:'); @@ -73,13 +73,35 @@ function FileInput: Boolean; // file read_file:= GInput(win_file, 8, 2, GFILE, 12, selected_file); + if (read_file <> XESC) then + begin + for i:=0 to Length(list_files) - 1 do + begin + if list_files[i] = Trim(selected_file) then + begin + selected_list:= i + 1; + GList(win_file, 2, 5, GDISP, selected_list, 8, Length(list_files), list_files); + end; + end; + end + else if (read_file = XESC) then + begin + bM:= XESC; + break; + end; // Drives combo read_drive:= GCombo(win_file, 21, 5, GEDIT, selected_drive, 8, list_drives); if (read_drive <> XESC) then begin selected_drive := read_drive; + end + else if (read_drive = XESC) then + begin + bM:= XESC; + break; end; + GCombo(win_file, 21, 5, GDISP, selected_drive, 8, list_drives); // Files List @@ -92,7 +114,13 @@ function FileInput: Boolean; SetLength(selected_file, FILE_SIZE); FillChar(@selected_file[tmp + 1], FILE_SIZE - tmp, CHSPACE ); WPrint(win_file, 8, 2, WOFF, selected_file); + end + else if (read_list = XESC) then + begin + bM:= XESC; + break; end; + GList(win_file, 2, 5, GDISP, selected_list, 8, Length(list_files), list_files); // Buttons to confirm @@ -228,15 +256,39 @@ function FormInput: Boolean; // Edit fields bA := GInput(bW1, 8, 2, GNUMER, 27, cA); + if (bA = XESC) then + begin + bM:= XESC; + break; + end; bB := GInput(bW1, 8, 3, GALPHA, 27, cB); + if (bB = XESC) then + begin + bM:= XESC; + break; + end; bC := GInput(bW1, 8, 4, GALNUM, 27, cC); + if (bC = XESC) then + begin + bM:= XESC; + break; + end; bD := GInput(bW1, 8, 5, GANY, 27, cD); - + if (bD = XESC) then + begin + bM:= XESC; + break; + end; // ----- Spinner Input ----- bV := GSpin(bW1, 8, 6, 0, 100, bVp, GEDIT); if (bV <> XESC) then begin bVp := bV; + end + else if (bV = XESC) then + begin + bM:= XESC; + break; end; // ----- Display Radio Buttons - horizontal ----- @@ -250,6 +302,11 @@ function FormInput: Boolean; if (bRA <> XESC) then begin bRAp := bRA; + end + else if (bRA = XESC) then + begin + bM:= XESC; + break; end; // Redisplay buttons @@ -262,6 +319,11 @@ function FormInput: Boolean; if (bRB <> XESC) then begin bRBp := bRB; + end + else if (bRB = XESC) then + begin + bM:= XESC; + break; end; // Redisplay buttons @@ -280,6 +342,11 @@ function FormInput: Boolean; if (bCha <> XESC) and (bCha <> XTAB) then begin bChap := bCha; + end + else if (bCha = XESC) then + begin + bM:= XESC; + break; end; // until (bCha = XESC) or (bCha = XTAB) or (bCha = XNONE); @@ -292,6 +359,11 @@ function FormInput: Boolean; if (bChb <> XESC) then begin bChbp := bChb; + end + else if (bChb = XESC) then + begin + bM:= XESC; + break; end; // until (bChb = XESC) or (bChb = XTAB) or (bCha = XNONE); @@ -304,6 +376,11 @@ function FormInput: Boolean; if (bChc <> XESC) then begin bChcp := bChc; + end + else if (bChc = XESC) then + begin + bM:= XESC; + break; end; // until (bChc = XESC) or (bChc = XTAB) or (bCha = XNONE);