Page 1 of 1

wxRichTextCtrl, some questions

Posted: Wed Aug 10, 2011 12:48 pm
by spectrum
hi all,
i am using wxRichTextCtrl on linux, wxGTK wxWidgets 2.9.2 for developing a serial comm terminal,
below some questions,

1. is the caret customizable ? I would like it to be a rectangle, i already tried with GetCaret / SetCaret, SetSize etc, nothing works.
2. is there a way to allow the user to delete "only" the characters written by him (no the WriteText written chars) ?
3. is there sme other more appropriate wxWidgets control for this ?

many thanks

Regards,
angelo

Re: wxRichTextCtrl, some questions

Posted: Wed Aug 10, 2011 1:39 pm
by briceandre
1. No idea : it should be, but I never tried it
2. No : once the text has been inserted, the control does not remember if it was introduced from a keystroke or from a WriteText method. So, you will have to handle this functionality yourself.
3. I think yes. I am not sure you need rich text functionality for terminal emulation. Maybe a wxTextCtrl would do the trick ?

Re: wxRichTextCtrl, some questions

Posted: Wed Aug 10, 2011 2:29 pm
by spectrum
thanks for the replies.

- I need to handle some vt100 special codes, so to be able to change colors on the fly. wxTextCtrl is not able to do this.
- I am wondering what controls are using putty or gtkterm, since they allows colors and a rectangular cursor.

Re: wxRichTextCtrl, some questions

Posted: Wed Aug 10, 2011 2:41 pm
by Auria
For a terminal wxStyledTextCtrl may be more appropriate (it has features like code folding and syntax highlighting but you don't need to use them). I'm think the caret is customizable in it. A custom lexer might be able to handle vt100 colors too

Re: wxRichTextCtrl, some questions

Posted: Wed Aug 10, 2011 2:45 pm
by spectrum
i have found that gtkterm use "libvte-dev", and probably putty too.

Would be nice to find some c++ wrapper, or better, a wxWidgets similar equivalent.

regards

angelo

Re: wxRichTextCtrl, some questions

Posted: Wed Aug 10, 2011 4:23 pm
by briceandre
I need to handle some vt100 special codes, so to be able to change colors on the fly. wxTextCtrl is not able to do this.
Well, under Windows, you can handle colors with a wxTextCtrl. Take a look at wxTextCtrl::SetStyle method. I never tried this under Linux, but you can give it a try. Note that for this purpose, syntax highlightning capabilities of wxStyledTextCtrl will not be helpful as they are based on predefined syntax rules, and not information received from VT100 commands.