A new Delphi VCL Component: TEditShell
Some time ago I wanted to write my own very special shell in Delphi. While thinking about how exactly the shell should look like, I found that I would definitly need a good shell VCL that offers all the luxury I am used to have from my Linux experience. And this is what came out so far. The source code can be downloaded from EditShell.pas.
Using a TEditShell
A fully featured TEditShell has such features as auto completion and command history. The component can be used almost like a normal TEdit but the trick lies in the Up-, Down- and Tab keys. With the Up and Down keys you can select an entry among the older entries. When pressing Tab the component searches through all old entries and gives a small hint window showing those entries that have the same prefix as the text that was entered so far. It also completes the text entered so far with the first entry of the history that matches. The part that was completed is selected to ease further changes.
Programming with TEditShell
To use all features of the EditShell you have to associate a TMemo with the Memo property of the shell. This Memo serves as the command history. The TEditShell has another property called Timout, that gives the time in milliseconds for which the choices are displayed. For simpler coding, the component offers an OnExecute event that is issued whenever the user presses Enter within the shell. The parameter Command of the event handler contains the text that the user typed in the EditShell. After pressing Enter the text of the shell is cleared.
