3,7 → 3,7 |
(************************************************) |
(* LISTTEST.PAS *) |
(* Author: Daniel Marschall *) |
(* Revision: 2022-02-16 *) |
(* Revision: 2022-02-13 *) |
(* License: Apache 2.0 *) |
(* This file contains: *) |
(* - Example how to use lists and selection CUI *) |
10,7 → 10,7 |
(************************************************) |
|
uses |
Crt, Drivers, StrList, VtsCui; |
Crt, StrList, VtsCui; |
|
var |
items: PStringList; |
17,11 → 17,8 |
i, itemIndex: integer; |
sTmp: string; |
begin |
InitVideo; |
CursorOff; |
InitList(items); |
|
CreateList(items); |
|
(* Fill the list for testing *) |
for i := 1 to 5 do |
begin |
31,14 → 28,13 |
|
(* Do inserts and deletions to test their functionality *) |
ListInsert(items, 'TEST', 0); |
ListDeleteElementByIndex(items, 0); |
ListDeleteElementByIndex(items, 0); |
ListDeleteElement(items, 0); |
ListDeleteElement(items, 0); |
ListInsert(items, 'FirstElement', 0); |
|
(* Test the selection GUI unit *) |
ClrScr; |
itemIndex := DrawSelectionList(3, 5, 15, 10, items, true, '', 0); |
ResetDefaultDosColors; |
itemIndex := DrawSelectionList(3, 5, 15, 10, items, true, 0); |
ClrScr; |
if itemIndex = -1 then |
begin |
53,7 → 49,4 |
FreeList(items); |
|
ReadLn; |
|
CursorOn; |
DoneVideo; |
end. |