Class TLinkedListForm (unit SortLst) |
Inherits from
TForm
The next cell in the list.
procedure CmdInsertClick(Sender: TObject);
Add a new cell after the selected cell.
procedure CmdRemoveAfterClick(Sender: TObject);
Remove the cell after the selected cell.
procedure DrawList;
Display the list, highlighting the selected item.
procedure EnableButtons;
Enable the appropriate buttons.
procedure FormCreate(Sender: TObject);
Initialize the empty linked list.
procedure FormDestroy(Sender: TObject);
Free all the linked list memory.
procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
Select the item clicked.
procedure FormPaint(Sender: TObject);
Redraw the list.
procedure ValueTextChange(Sender: TObject);
Enable the appropriate buttons.
CmdInsert : TButton;
CmdRemoveAfter : TButton;
ValueText : TEdit;
bottom_sentinel : TCell;
num_items : Integer;
selected : Integer;
top_sentinel : TCell;
Private declarations
procedure CmdInsertClick(Sender: TObject);
Add a new cell after the selected cell.
procedure CmdRemoveAfterClick(Sender: TObject);
Remove the cell after the selected cell.
procedure DrawList;
Display the list, highlighting the selected item.
procedure EnableButtons;
Enable the appropriate buttons.
procedure FormCreate(Sender: TObject);
Initialize the empty linked list.
procedure FormDestroy(Sender: TObject);
Free all the linked list memory. This doesn't matter for this example program. It would be important if the program created and destroyed many forms.
procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
Select the item clicked.
procedure FormPaint(Sender: TObject);
Redraw the list.
procedure ValueTextChange(Sender: TObject);
Enable the appropriate buttons.
CmdInsert : TButton;
CmdRemoveAfter : TButton;
ValueText : TEdit;
bottom_sentinel : TCell;
num_items : Integer;
selected : Integer;
top_sentinel : TCell;
Private declarations