[Lazarus] Displaying text with colour and insertion point

Paul Breneman list2010 at BrenemanLabs.com
Wed May 16 15:47:06 CEST 2012


Mark Morgan Lloyd wrote:
> Does anybody have any suggestions for a component to display status or 
> terminal text that will allow limited enhancement (colour, possibly 
> underline etc.)?
> 
> Over the last few weeks I've been tinkering with an emulator for an 
> obsolete mechanical terminal (IBM 2741), including support for the APL 
> character set. I started off using a listbox for simple output, noting 
> that this didn't have provision for multiple colours or marking the 
> insertion point. I moved on to stuffing characters into a memo, this 
> allowed me to force a current-position marker but still had no colour.
> 
> Looking at the CmdLine component, it appears OK as a command window 
> (i.e. accepting keyboard input etc.) but isn't so hot when the principal 
> requirement is to display text pushed into the underlying strings 
> storage from elsewhere: in particular, there isn't a way to force the 
> insertion point marker to the end of what's just been output.
> 
> I'm sure I'm not the only person who wants to do this sort of thing: 
> does anybody have any recommendations?

Mark,

I don't have any recommendations but I'm following this message thread 
with much interest.  Last fall I wrote a "serial debug terminal" with 
Free Pascal and fpGUI and that program has proved to be one of the most 
useful simple programs I've written in a long time.  I've customized it 
a few times already for real work projects and I also have some other 
projects planned.  If you want to see how simple the present code is see 
the "DbgTerm.pas" program at this page:
   http://www.turbocontrol.com/easyfpgui.htm

Right now you can't put the cursor in the terminal and send characters 
by typing them, but rather there are separate SendEdit and SendButton 
components.  I'd like to implement a more standard "terminal" operation 
so what you are discussing here applies to that.

I'd like to keep the present DbgTerm as a very simple example of serial 
communications code but I will consider having a more complex terminal 
program too.  I've run into many people who need a replacement for 
HyperTerminal since it has been gone from Vista and later Windows editions.

-- 
Regards,
Paul Breneman
www.dbReplication.com - VCL database replication components
www.TurboControl.com - Hardware and software development services
- Educational programming project for environment monitoring
- Information on using FreePascal for embedded systems
- Support information for the TurboPower open source libraries





More information about the Lazarus mailing list