59 lines
1.9 KiB
Plaintext
59 lines
1.9 KiB
Plaintext
Hello
|
|
This is a little Demo for TCmdBox
|
|
You can type commands while this text is written here !
|
|
Available commands :
|
|
|
|
* help : Short list for all commands
|
|
* stop : Stops me from reading this text...
|
|
* pause : Interrupts me
|
|
* resume : Continues at the last position pause was called...
|
|
* start : Restarts reading this text..
|
|
* clear : Clears the output buffer
|
|
* clearhistory : clears history buffer for previous input
|
|
* exit : Exits the program
|
|
|
|
A few details to TCmdBox...
|
|
|
|
To put TCmdBox into Inputmode use (example)
|
|
|
|
CmdBox.StartRead(clRed,clBlack,'>',clSilver,clBlack);
|
|
|
|
If you give a string parameter to StartRead, it will be displayed directly before the input and will follow it.
|
|
|
|
Input is received through an Event called OnInput.
|
|
Changes can be watched by the programm by OnInputChange.
|
|
|
|
To keep TCmdBox in Inputmode just call StartRead in OnInput again.
|
|
|
|
If you resize the application or use splitter in the middle you notice lines are wrapped, there is no fixed or limited line width.
|
|
|
|
Input is also saved in a history list with limited to HistoryMax entries including current input.
|
|
|
|
Output content by using:
|
|
|
|
CmdBox.Write('Text');
|
|
|
|
or
|
|
|
|
CmdBox.Writeln('Text...');
|
|
|
|
These calls are supposed to be Threadsafe !
|
|
|
|
You can use all font and background colors possible on the Operating System, for example
|
|
|
|
CmdBox.TextColor(clRed);
|
|
CmdBox.TextBackGround(clSilver);
|
|
|
|
or
|
|
|
|
CmdBox.TextColors(clRed,clSilver);
|
|
|
|
The background color of the last character in a line determines the background color of the rest of the line.
|
|
|
|
The component should be able to show correct UTF8 codes of any kind (up to the whole 21 bits), therefore:
|
|
|
|
€, ä, ö,ü
|
|
|
|
should be correctly written as Euro, Ae, Oe, Ue (the last three are german) if you have selected a UTF8 capable Font and LCL-Interface.
|
|
|
|
I hope you can use the component, if you find bugs or have suggestions contact me by email : kccmp@gmx.de |