wxRichTextCtrl, some questions

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
spectrum
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Sat Jul 21, 2007 12:17 pm

wxRichTextCtrl, some questions

Post 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
spectrum
briceandre
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 672
Joined: Tue Aug 31, 2010 6:22 am
Location: Belgium

Re: wxRichTextCtrl, some questions

Post 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 ?
spectrum
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Sat Jul 21, 2007 12:17 pm

Re: wxRichTextCtrl, some questions

Post 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.
spectrum
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Re: wxRichTextCtrl, some questions

Post 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
"Keyboard not detected. Press F1 to continue"
-- Windows
spectrum
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Sat Jul 21, 2007 12:17 pm

Re: wxRichTextCtrl, some questions

Post 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
spectrum
briceandre
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 672
Joined: Tue Aug 31, 2010 6:22 am
Location: Belgium

Re: wxRichTextCtrl, some questions

Post 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.
Post Reply