Class TLinkedListForm (unit LList)

Inherits from

TForm

The next cell in the list.

Constructors



Functions

procedure CmdInsertAfterClick(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.

Properties

Events

Variables

CmdInsertAfter : TButton;


CmdRemoveAfter : TButton;


ValueText : TEdit;


num_items : Integer;


selected : Integer;

For convenience.

sentinel : TCell;

Private declarations


Constructors


Functions


procedure CmdInsertAfterClick(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.


Properties


Events


Variables


CmdInsertAfter : TButton;


CmdRemoveAfter : TButton;


ValueText : TEdit;


num_items : Integer;


selected : Integer;

For convenience.


sentinel : TCell;

Private declarations