Terminal/console like display

Hi all,

Xojo desktop app. I need to display a small terminal/console like window, 8 lines by 40 columns wide using a fixed pitch font. I am displaying data received from an instrument and the client wants to see if formatted like on the small instruct LCD display.

Is there a control or third party control I can get that mimics such a display? Or what is the best way to build such a display?

I thought about just using a listbox but I cannot figure out how to make the font fixed pitch.

Thanks in advance

Ok I can get listbox to use fixed pitch font. I just missed that. But looking for a better display option still. Thanks!

Do you need the text to wrap, if it might ever wrap? If not, the Listbox sounds like your best bet.

lb.FontName = "Some Fixed Width Font"
lb.FontSize = 10 // ... or something

See https://docs.xojo.com/ListBox

For your simple use case, subclass the Listbox to add a “AppendRow” (or something) method that will add a new row and delete the first row, if that’s what you want, or scroll to the bottom.

Hi all, I am using listbox with a fixed pitch font but ideally I’d like something that I can change certain chars to be inverse to mimic the device display.

No, it does not need to do any automatically wrapping. The display I need to mimic is 40 columns by 8 lines and if there was something where I could say:

console(28, 3) = “A”

And some other way to set inverse or not that would be amazing.

Listbox works but does not give the full functionality I’d like. Didn’t know if anyone has done anything like that.

A terminal display would work too as most terminals are row/col addressable.

You could use a TextArea and manage the Col/Lines manually. You could also subclass a canvas and make anything you need there, but it will be some work. What does the listbox not give you that you need?

I wrote a TELNET class and included a terminal like display example. It is limited in features but I’m still trying to gather what you are missing from the OP. Do you have a mock-up of the desired end result by chance?

You can use the events to draw the text however you’d like. It’s still your best choice.

2 Likes

Sounds good guys! Thanks… I’ll take a look at the TELNET class and experiment with TextArea!